After installing MySQL on the server in the lab today, you can find that a remote computer cannot connect to the MySql server. The operating system of the server is Ubuntu14.04. So I checked some information on the Internet and finally got it done after a long time. The specific steps are as follows. After installing MySQL, modify the following file sudovimetcmysqlmy. cnf and find bind-.
After installing MySQL on the server in the lab today, you can find that a remote computer cannot connect to the MySql server. The operating system of the server is Ubuntu 14.04. So I checked some information on the Internet and finally got it done after a long time. The specific steps are as follows. After installing MySQL, modify the following file sudo vim/etc/mysql/my. cnf and find bind-.
After installing MySQL on the server in the lab today, you can find that a remote computer cannot connect to the MySql server. The operating system of the server is Ubuntu 14.04. So I checked some information on the Internet and finally got it done after a long time. The specific steps are as follows.
After installing MySQL, modify the following file:
sudo vim /etc/mysql/my.cnf
Findbind-address = 127.0.0.1
, Change the binding address0.0.0.0
Or comment out the row directly.
Then start the MySQL Service
sudo /etc/init.d/mysql start
Open MySQL
sudo mysql -uroot -p
Enter the password, enter the MySQL command line, and execute the following commands in the MySQL Command Line
grant all PRIVILEGES on *.* to root@'%' identified by 'onePassword';
Run
use information_schemaselect * from user_privileges;
If the query has the following results:'root'@'%'
, Indicating that mysql has authorized remote connection.
Exit MySQL command line and execute
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
Add port 3306 to iptables.
Run the following command to restart the MySQL service.
sudo /etc/init.d/mysql restart
Then other computers can remotely connect to the MySLQ on the server. Although the problem is not big, it is not the first time, but every time it takes a lot of time to solve the problem, make a small record, in case you encounter similar problems in the future, you have to start from scratch.