Problem description
Out of interest, I have MySQL servers and clients installed on both the Windows and Ubuntu systems. Now there are some preliminary information:
- IP address of Windows system: 192.168.5.196
- Ubuntu System IP Address: 192.168.5.228
Now I'm trying to connect the Ubuntu Terminal host remotely on Windows.
First, configure MySQL access on the remote Ubuntu host, as follows:
Mysql> Grant all privileges the ' longlong ' @ '% ' identified by ' 123456 ';
Now, check the MySQL permissions information on the Ubuntu host as follows:
Now, telnet to the Ubuntu host MySQL database on Windows, the result is:
have been quoted this error!
Problem Solving Methods
After csdn ask to ask this question, tried everyone's suggestions, such as through the Mysql-u xx-p xxxx-h xxxx or shut down the Windows Firewall and through the UFW Disable command to shut down the Ubuntu firewall, still cannot solve this problem.
Later, I learned that on Ubuntu, MySQL was configured throughout MySQL via the/ETC/MYSQL/MY.CNF configuration file. Excerpt one or two:
[Mysqld]
3306 Port =
Basedir =/usr
DataDir =/var/lib/mysql
Tmpdir =/tmp
# Instead of skip-networking The default is now-listen only
# on localhost which are more compatible and are not less secure.
Bind-address = 127.0.0.1
Note that in the above configuration file, there is a sentence for the configuration command:
Bind-address = 127.0.0.1
This command indicates that the Ubuntu host is listening locally and processing only local connection requests.
We can also use the netstat command to view the relevant port listening information:
Shell> NETSTAT-ANP | grep 3306
Output> TCP 127.0.0.1:3306 LISTEN
Now, we comment out the MY.CNF bind-address statement and restart the MySQL service:
shell> sudo service MySQL restart
output> MySQL stop/waiting mysql start/running, process 25765
Now, when we remotely connect to the MySQL database on Ubuntu in Windows, we don't get an error.
Run the netstat command again:
Shell> NETSTAT-ANP | grep 3306
Output> TCP 0.0.0.0:3306 LISTEN
At this point, we found that the 3306 port is no longer just listening on the local, but also can listen to the connection request from the remote.
Problem solving for remote connection to MySQL database