Two methods to implement Mysql remote connection configuration When we work in the company, we often encounter MySQL databases stored on someone's computer. If we want to connect to the MySQL service, the computer with the MySQL service installed must open a remote connection. The first one: root@ubuntu:/usr/local/MySQL# mysql -hlocalhost -uroot -proot; mysql>use mysql; mysql>insert into user ( host, user, password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, Create_tablespace_priv )VALUES ( '%', //Fixed IP replaces % 'cap', password('cap'), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y' ); mysql> FLUSH PRIVILEGES; Second type: root@ubuntu:/usr/local/mysql#mysql -hlocalhost -uroot -proot; mysql>GRANT ALL PRIVILEGES ON *.* TO 'test'@'%'IDENTIFIED BY 'test' WITH GRANT OPTION; //Replace % if using fixed IP mysql> FLUSH PRIVILEGES; Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: Detailed explanation of how to exit Docker container without closing it
>>: Two ways to use react in React html
I encountered several browser compatibility issue...
IE's conditional comments are a proprietary (...
Table of contents uni-app Introduction HTML part ...
This article shares the specific method of instal...
In the process of writing HTML, we often define mu...
This article example shares the specific code of ...
First of all, this post is dedicated to Docker no...
Occasionally, I need to group select contents. In ...
In the past, almost every website had a sitemap p...
Preface In order to reflect the difference betwee...
Table of contents Preface: 1.Brief introduction t...
1. First, generate the public key and private key...
Use JS to implement a random roll call system for...
This article records the detailed installation pr...
Table of contents background analyze method backg...