Home > Operation and Maintenance > Linux Operation and Maintenance > What to do if mysql in linux has 10061 error

What to do if mysql in linux has 10061 error

WBOY
Release: 2022-06-23 15:30:31
Original
4260 people have browsed it

Solution: 1. Log in to the mysql command line as the root user, and use the "vi /etc/mysql/mysql.conf.d/mysqld.cnf" command to change the "bind-address" field content to " 0.0.0.0"; 2. Use "grant all on *.* to account@'%' identified by 'password' with grant option" to authorize the specified IP address and restart mysql.

What to do if mysql in linux has 10061 error

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What should I do if mysql in Linux has a 10061 error?

Mysql 10060 error is usually caused by the firewall

ufw allow 3306;        //允许外部访问3306端口
ufw allow from 192.168.1.115;  //允许此IP访问所有的本机端口
ufw status;            //查看防火墙状态
ufw disable/enable;      //关闭或打开防火墙
Copy after login

You can just perform the installation without installing ufw: apt-get install ufw;

mysql 10061 error is caused by configuration

Solution

First step:

Check mysql first Running status

netstat -ntlp | grep -v tcp6;  //查看端口状态
mysql -V;           //查看mysql版本号
find / -name mysqld.cnf;     // 查找mysqld.cnf 的位置
Copy after login

If the port is 127.0.0.1:3306, solution

vi /etc/mysql/mysql.conf.d/mysqld.cnf;  //将bind-address = 127.0.0.1 修改成 bind-address = 0.0.0.0
Copy after login
service mysql restart;    //重启mysql
netstat -ntlp | grep -v tcp6;   //查看端口状态为0.0.0.0:3306即可
Copy after login

Step 2:

grant all on *.* to Replace here with the account you want to log in@'%' identified by 'Replace here with the password of the account' with grant option;

The example is as follows:

What to do if mysql in linux has 10061 error

Recommended learning: Linux video tutorial

The above is the detailed content of What to do if mysql in linux has 10061 error. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template