MySQL Forums
Forum List  »  Newbie

Could Not access data base! My SQL?
Posted by: Hina Imran
Date: July 15, 2014 01:06PM

So I have been trying to setup a local instance for a wen application. I am new to my SQL and i cannot understand how to actually connect this database to the actual web application sitting in the /var/www folder in my computer.



I have created a database in command line terminal

mysql> create database mydatabase

-> ;

Query OK, 1 row affected (0.00 sec)



mysql> create user 'host'@'website.local' identified by 'hmypassword';

Query OK, 0 rows affected (0.00 sec)



mysql> create user 'host'@'%' identified by 'mypassword';

Query OK, 0 rows affected (0.00 sec)



mysql> grant all privileges on database.* to 'host'@'%';

Query OK, 0 rows affected (0.01 sec)



mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)



mysql> exit

Bye



mysql -u host -h 127.0.0.1 -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 52

Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)



how to actually connect this database to the website? I also don't understand how to make a schema for this databse. whenever I try to refresh my web browser I get the following message
Could not access database!

SQLSTATE[HY000] [2002] Connection refused

Options: ReplyQuote


Subject
Written By
Posted
Could Not access data base! My SQL?
July 15, 2014 01:06PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.