mysql 5.7 2003 cant connect to mysql server on 10061 unknown error

created at 08-23-2021 views: 30

Solution for the 2003-Can’t connect to Mysql on ‘host name’ (10061) error when use navicat to connect mysql database remotely

Authorize remote connection to mysql method:

grant all privileges on *.* to `user_name` identified by `password`;

# then refresh
flush privileges; 

If you are using mysql8, you need to create a new user for authorization, and report an error directly with root authorization;
mysql8 authorized remote connection please click

Need to modify the mysql configuration file

cat /etc/mysql/my.cnf

The output is as follows:

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

Enter /etc/mysql/mysql.conf.d/ to modify

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

Modify bind-address = to bind-address =

Save and exit

sudo service mysql restart (must restart the database, otherwise it's useless)

ok, you can connect to this database remotely at this time.

created at:08-23-2021
edited at: 08-23-2021: