1, change the table method may be your account is not allowed to login from the remote, only in localhost. This time, as long as the computer on the localhost, log in to MySQL, change the "MySQL" Database in the "User" table "host", from "localhost" to "%"
Code:mysql-u root-p123
Mysql>use MySQL;
Mysql>update User Set host = '% ' where user = ' root ';
Mysql>select host, user from user;
Note: In fact, we can add a user, the necessary permissions granted to this user, and the user's host set to%
2, Authorization Law 1, if you want to use "myuser" user "MyPassword" password from any host to connect to the MySQL server. SQL code:
grant all privileges on * . * to myuser " @" % Identified by mypassword with grant option FLUSH privileges ;
Example 2, if you want to allow users to myuser from the IP 192.168.1.6 host to the MySQL server, and use MyPassword as the password SQL code:
GRANT All Privileges on *. * to ' MyUser '@'192.168.1.3'by 'mypassword ' with GRANT OPTION ;
FLUSH privileges;
Note: Different system host will produce different results, 1:windows under the general in accordance with one of the above operations can be; 2, for the Linux environment, just follow the above steps are not enough, the specific steps are as follows:
Find the appropriate configuration file for your MySQL installation directory/etc/mysql/my.cnf
Comment out "bind-address = 127.0.0.1"
MySQL--remote access to MySQL's solution