1024programmer Mysql How to set mysql remote access password

How to set mysql remote access password

How to set the remote access password for mysql: first log in to mysql, and query the user table and host authority commands; then delete the remote access user root, and update the authority commands; finally recreate the remote operation account for remote access authorization and update permissions.

Related free learning recommendation: mysql video tutorial

mysql method of setting remote access password :

1. Login to mysql command: mysql -uroot -p (press enter to enter password)

2. Query user table and host Permission command:

use mysql
 select user, host from mysql.user;

Note: The % here means that any machine can remotely connect to the server through root, we can directly delete this user and redefine the user and password.

6. Re-create the remote operation account, authorize remote access and update permissions, and execute the following codes in sequence:

create user 'root'@'%' identified with mysql_native_password by '123456';
 grant all privileges on *.* to & # 39; root & # 39; @ & # 39; % & # 39; with grant option;
 flush privileges;

The above is the detailed content of how to set the remote access password for mysql. For more information, please pay attention to other related articles on 1024programmer.com!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/how-to-set-mysql-remote-access-password/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索