Could not access database I have been trying to setup a local instance for a new application.  I am new to MYSQL 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&gt; create database mydatabase
    -&gt; ;
Query OK, 1 row affected (0.00 sec)  

mysql&gt; create user 'host'@'website.local' identified by 'hmypassword';
Query OK, 0 rows affected (0.00 sec)

mysql&gt; create user 'host'@'%' identified by 'mypassword';
Query OK, 0 rows affected (0.00 sec)

mysql&gt; grant all privileges on database.* to 'host'@'%';
Query OK, 0 rows affected (0.01 sec)


mysql&gt; flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; 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 database.  Whenever I try to refresh my web browser I get the following message:

Could not access database!

SQLSTATE[HY000] [2002] Connection refused
You create database mydatabase and then you grant on database.*
The correct is:

grant all privileges on mydatabase.* to 'host'@'%';