Connected Linux server operating Mysql and add remote access to the Root User

1. Link remote Linux server

2. Then enter ->

mysql -u root -p

Enter appear Enter password: Then we enter the root password into the carriage again

3. Switch to mysql database ->

use mysql

4. look at the existing user permissions and connection ->

select user, password, host from user;

5. Add a root user password temporarily empty, to allow access to any Ip '%' ->

GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘’ WITH GRANT OPTION;

Add a password can also be added directly to the root user ->

GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;

6. modify the root password ->

update user set password=PASSWORD(‘123456’) where user=‘root’;

7. The refresh of the permissions mysql ->

flush privileges;

Released seven original articles · won praise 3 · Views 166

Guess you like

Origin blog.csdn.net/qinghuan100/article/details/105168728