• notice
  • Congratulations on the launch of the Sought Tech site

mysql open remote connection

Point of departure

Because the bridge project needs to use MySQL database, thinking that the MySQL of my laboratory server has been installed, I installed Navicat to prepare for remote connection, and connected through the shell to find that the operation was normal

mysql -u root -p

But an error occurred when using Navicat to connect, and the connection was refused, so I thought that MySQL might not allow remote login

Enable remote IP login permission

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Add bind-address =

lc-messages-dir = /usr/share/mysql
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address          =

Then restart MySQL

/etc/init.d/mysql restart

Add user

After opening the remote login, a new error occurred: ...is not allowed to connect to this MySql server
So log in to MySQL through the shell, and execute the following commands in turn

use mysql;update user set host=’%’ where user=’root’;

Then the remote connection is successful


Technical otaku

Sought technology together

Related Topic


Leave a Reply