I want my mysql server to be remotely accessible by ip 192.168.1.3
so I changed the bind-address in /etc/mysql/my.cnf
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
bind-address = 192.168.1.3
but still I am getting ceres is not allowed to MySQL.
$ mysql -u username -h 192.168.1.3 -p
Enter password:
ERROR 1130 (HY000): Host 'ceres' is not allowed to connect to this MySQL server
server that is running mysql server is ceres @ 192.168.1.3
mysql> SHOW VARIABLES WHERE Variable_name = 'hostname';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| hostname | ceres |
+---------------+-------+
1 row in set (0.00 sec)
following google search result that lead me to SO, I did this
mysql> SELECT host FROM mysql.user WHERE User = 'root';
+-------------+
| host |
+-------------+
| 127.0.0.1 |
| ::1 |
| localhost |
| raspberrypi |
+-------------+
4 rows in set (0.00 sec)
which did not listed the ip of remote client that is trying to insert to sql db ! So I added root to run from remote using
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.177';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT host FROM mysql.user WHERE User = 'root';
+---------------+
| host |
+---------------+
| 127.0.0.1 |
| 192.168.1.177 |
| ::1 |
| localhost |
| raspberrypi |
+---------------+
5 rows in set (0.00 sec)
I also ran the above pn %
.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT host FROM mysql.user WHERE User = 'root';
+---------------+
| host |
+---------------+
| % |
| 127.0.0.1 |
| 192.168.1.177 |
| ::1 |
| localhost |
| raspberrypi |
+---------------+
6 rows in set (0.00 sec)
mysql> FLUSH PRIVILEGES;
and now On remote machine Iam still getting this error:
Error: 76 = Access denied for user 'root'@'192.168.1.177' (using password: YES).