Home >Database >navicat >How to deal with failure of navicat to connect to mysql

How to deal with failure of navicat to connect to mysql

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-08-17 13:22:3524261browse

How to deal with failure of navicat to connect to mysql

#1. Local connection The local database cannot be connected and error code 1251 is reported.

The first step is to open the Command Line Client.

How to deal with failure of navicat to connect to mysql

How to deal with failure of navicat to connect to mysql

The second step is to enter the mysql password and press Enter. It is the password set when installing mysql. Just enter the password. No. Add a semicolon.

Related recommendations: "Navicat for mysql graphic tutorial"

The third step, enter ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysql Password'; press Enter. Don't miss the semicolon after it. The password for mysql is the password set when installing mysql.

The fourth step is to enter FLUSH PRIVILEGES; press Enter (don’t miss the semicolon at the end).

2. The connection to the database server within the LAN was unsuccessful.

The first step is to open the MySQL server, enter the password, and the connection is successful.

How to deal with failure of navicat to connect to mysql

How to deal with failure of navicat to connect to mysql

The second step is to open the database: use mysql.

Retrieve user and host fields: mysql> select user, host from user;

How to deal with failure of navicat to connect to mysql

If there is no user with user = root and host = %, execute The following statement:

update user set host='%' where user='root';

The third step is to grant root authorization (all permissions).

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

The fourth step is to make the granted permissions effective immediately.

flush privileges;

The above is the detailed content of How to deal with failure of navicat to connect to mysql. 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