I'm working on this for 4 days and I know it is all over google, but I did all the required stuff but still no connection.
I created to 2 vagrant boxes, one for web server and one for mysql.
web: 192.168.50.50 mysql: 192.168.40.40
I edited the /etc/mysql/my.cnf file and placed:
bind-address = 192.168.40.40
now I created a user named "bob" with password "12345" with all permissions.
CREATE USER 'bob'@'localhost' IDENTIFIED BY '12345';
GRANT ALL PRIVILEGES ON *.* TO 'bob'@'192.168.50.50';
and flushed privileges
now I can see all is good in the database:
+--------------+------------------+
| Host | User |
+---------------+------------------+
| % | root |
| 192.168.50.50 | bob |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | debian-sys-maint |
| localhost | root |
| mysql | root |
+---------------+------------------+
but when I try to connect threw the webserver:
mysql -ubob -h192.168.40.40 -p12345
I get this:
ERROR 1045 (28000): Access denied for user 'bob'@'192.168.40.1' (using password: YES)
what is that ip "192.168.40.1" who is he and how did he appeared? and how do I fix that?