Wednesday, February 6, 2013

MYSQL Enable Users or Root Remote Access Suse Linux 11.3



All you need to do is update the user table host field with % for which ever user you need to grant remote access permission.

Remember that when you remotely try to connect, if there is no connection, means Firewall or network issue, if there is an access dined error mean you need to follow the below demonstration:


TestManager:~ # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.46-log SUSE MySQL RPM

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql;Database changed
mysql> select host,user from user;
+------------+-----------------+
| host       | user                |
+------------+-----------------+
| %          | root                  |
| %          | super_user     |
| 127.0.0.1  | root             |
| linux-npc5 |                     |
| linux-npc5 | root             |
| localhost  |                      |
| localhost  | asad            |
| localhost  | my_new_username |
| localhost  | root              |
+------------+-----------------+
9 rows in set (0.00 sec)

mysql> update user set host='%' where user='root' and host='linux-npc5';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
(This error came because I have two records for user root, one is correct one is bad, let delte the bad one)
mysql> delete  from user where user='root' and host='linux-npc5';
Query OK, 1 row affected (0.00 sec)

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

mysql>
========================================================================

Testing from Workbench:




No comments:

Post a Comment

Followers

Search This Blog