Home  >  Article  >  Database  >  How to solve the problem that IP cannot connect to mysql

How to solve the problem that IP cannot connect to mysql

藏色散人
藏色散人Original
2020-10-26 09:22:104179browse

To solve the problem that IP cannot connect to mysql: first execute the command "grant all privileges on *.* to 'username'@'IP address' identified by 'password';" in Navicat tool; then refresh Just click the permissions.

How to solve the problem that IP cannot connect to mysql

Recommendation: "mysql tutorial"

MySQL native IP cannot be connected, so use localhost and 127.0. 0.1 can connect | Solution

1. Use the command in Navicat tool or other tools: (remove all ' single quotes)

grant all privileges on *.* to '用户名'@'IP地址' identified by '密码';

2. After executing the above command, use the following Use the command to refresh the permissions

flush privileges;

Specific instructions:

all privileges: All permissions can also be written as select, update, etc.

*.*: All tables of all libraries such as databasename .*

Username: The user name that needs to be logged in

IP: The IP address of the database

identified by 'password' means connecting by password

The above is the detailed content of How to solve the problem that IP cannot 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