Home  >  Article  >  Database  >  How to open a remote connection in MySQL

How to open a remote connection in MySQL

黄舟
黄舟Original
2017-08-02 16:17:581803browse

When we work in the company, we often encounter mysql database stored on someone's computer. If we want to connect to the mysql service, the computer with the mysql service must enable remote connection.

1. Use the "Ctrl + R" key combination to quickly open the cmd window, and enter the "cmd" command to open the cmd window.

How to open a remote connection in MySQL

2. Use the "mysql -uroot -proot" command to connect to the local mysql service.

How to open a remote connection in MySQL

3. Use the "use mysql" command to select the database to be used, modify the basic information of the remote connection, and save In mysql database, so use mysql database.

How to open a remote connection in MySQL

4. Use "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root ' WITH GRANT OPTION;" command can change the settings of the remote connection.

How to open a remote connection in MySQL

5. Use the "flush privileges;" command to refresh the newly modified permissions to make them effective.

How to open a remote connection in MySQL

6. Use "select host,user from user;" to check whether the modification is successful.

How to open a remote connection in MySQL

The above is the detailed content of How to open a remote connection in 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