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.
2. Use the "mysql -uroot -proot" command to connect to the local mysql service.
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.
4. Use "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root ' WITH GRANT OPTION;" command can change the settings of the remote connection.
5. Use the "flush privileges;" command to refresh the newly modified permissions to make them effective.
6. Use "select host,user from user;" to check whether the modification is successful.
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!