Home  >  Article  >  Database  >  How to solve linux mysql2003 error

How to solve linux mysql2003 error

藏色散人
藏色散人Original
2020-10-28 09:28:354047browse

Linux mysql2003 error solution: first enter the mysql directory; then open the my.cnf file, find "bind-address = 127.0.0.1", and add the "#" symbol in front; finally add "kip -external..." code is enough.

How to solve linux mysql2003 error

# Recommended: "

mysql video tutorial

Not much to say, just go to the code


1. Enter in the console and enter the mysql directory,

sudo su  //进入root权限cd /etc/mysql

2. Open my. cnf file, find bind-address = 127.0.0.1 and comment it out with # in front, as follows: #bind-address = 127.0.0.1

3. Then add the following code; OK .

skip-external-lockingskip-name-resolve

If #bind-address = 127.0.0.1 is not found in the my.cnf file, as shown in the figure:


How to solve linux mysql2003 error Then enter the second path /etc Open the mysqld.cnf file in the /mysql/mysql.conf.d/ folder and modify it.

4. Restart the mysql service

service mysql restart

By the way, let me tell you how to solve the is not allowed to connect to this MySQL server error when connecting;

1. Enter mysql -uroot -p password on the console to enter mysql

(2. Enter use mysql; to enter the mysql database

3. Enter update user set host='%' where user=' root' ; to allow access through IP.) Note: The method in brackets allows everyone to connect, which is easy to be hacked by others, so you need to set up designated IP access. The specific method is as follows:
Directly enter:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'要指定的IP地址' IDENTIFIED BY '设置的密码' WITH GRANT OPTION;

You can also update the host to % first, and then update the host to your own IP through the graphical interface (SqlYog, workbench, etc.).

4. Continue to enter flush privileges; Remember, no matter which method you choose above, you must perform this step to update the database user permissions. Very important! ! !
5. Then reconnect and the problem will be solved.

The above is the detailed content of How to solve linux mysql2003 error. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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