I have an ubuntu server with mysql installed, at one point I saw the php code running on the server could access mysql but I can't access mysql remotely, for another server or sequal pro.
$ mysql -u root -p
mysql> GRANT ALL on *.* TO 'thomas'@'%';
mysql> exit
$ mysql -u thomas -p
mysql> show grants;
+------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for thomas@localhost |
+------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'thomas'@'localhost' IDENTIFIED BY PASSWORD '[ENCRYPTEDPASSWORD]' WITH GRANT OPTION |
+------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> exit
$ mysql -u thomas -p -h [SERVERIP]
ERROR 1045 (28000): Access denied for user 'thomas'@'[SERVERNAME]' (using password: YES)
Update:
I wen't in and dropped all the users that where made (some didn't have passwords) I was going by the mysql.user
table and using the drop user
command.
CREATE USER 'thomas'@'localhost' IDENTIFIED BY '[PASSWORD]';
GRANT ALL PRIVILEGES ON *.* TO 'thomas'@'localhost' IDENTIFIED BY '[PASSWORD]';
GRANT ALL PRIVILEGES ON *.* TO 'thomas'@'[SERVERIP]' IDENTIFIED BY '[PASSWORD]';
GRANT ALL PRIVILEGES ON *.* TO 'thomas'@'%' IDENTIFIED BY '[PASSWORD]';
the table now looks like this:
+--------------+------------------+
| Host | User |
+--------------+------------------+
| localhost | root |
| localhost | phpmyadmin |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | debian-sys-maint |
| localhost | thomas |
| [SERVERIP] | thomas |
| % | thomas |
+--------------+------------------+