MySQL remote connection cannot open solution
1, Change Table method .
Please use MySQL management tools, such as: SQLyog Enterprise, navicate MySQL
Your account may not be allowed to log in remotely, only in localhost. This time, as long as the computer in localhost using MySQL management tools login MySQL, change the "MySQL" Database in the "User" table in the "host" item, from "localhost" renamed "%"
2. The law of authorization.
A: You want to MySQL account myuser use password mypassword from any host to connect to the MySQL server, then the MySQL command line to enter:
Grant all privileges in *.* to ' myuser ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;
If the above command has not worked, then use the following command, must be successful!
If you want to allow the MySQL account myuser to connect to the MySQL server from the IP-192.168.1.3 host and use MyPassword as the password, enter at the MySQL command line:
Grant all privileges in *.* to ' myuser ' @ ' 192.168.1.3 ' identified by ' MyPassword ' with GRANT OPTION;
This is supplemented by other netizens:
On the remote host, I opened the MySQL service, with phpMyAdmin can be opened, such as user name is root, password is 123456. However, the remote connection with the Mysql client, but reported errors, such as Mysql-front reported the following error.
Access denied for user ' root ' @ ' 121.42.8.33′ (using Password:yes)
Strange, phpMyAdmin can be normal access, and mysql-front why can not connect it? Possible reasons, should be the IP limit, phpmyadmin in connection with the localhost, and we access the page to use the remote host IP, while the mysql-front connected to the remote host.
The workaround is as follows: We need to create a new user, and then grant all IP access to the right.
In the following SQL statement, username is the username, password the password you want to set:
CREATE USER ' username ' @ ' localhost ' identified by ' password ';
Grant all privileges in *.* to ' username ' @ ' localhost ' with GRANT OPTION;
CREATE USER ' username ' @ '% ' identified by ' password ';
Grant all privileges in *.* to ' username ' @ '% ' with GRANT OPTION;
CREATE USER ' username ' @ ' localhost ' identified by ' password ';
Grant all privileges in *.* to ' username ' @ ' localhost ' with GRANT OPTION;
CREATE USER ' username ' @ '% ' identified by ' password ';
Grant all privileges in *.* to ' username ' @ '% ' with GRANT OPTION;
By executing the above statement, you create a new account with a username of username, a password of password, and then log in with a new account to connect successfully.