Navicat远程链接mysql-8数据库具体操作
未经允许不得转载
*Navicat**远程链接mysql-8数据库具体操作方案*
*一:本地链接*
*二:公有云链接*
*备注:此文档是以root用户演示。项目最好用其他用户*
*具体步骤:*
*公有云链接*
*1.登录mysql数据库* *mysql -uroot -pXXX*
创建普通用户并授权
*2. 查看*
执行:show databases;
use mysql
SELECT Host, User, plugin from user
*3.修改root或者普通用户的加密方式*
执行修改命令根据你需要访问的host进行修改 (当前模拟是更改了所有加密)
ALTER USER 'root'@'localhost' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
ALTER USER 'root'@'192.168.0.0' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'192.168.0.0' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
ALTER USER 'root'@'127.0.0.1' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
ALTER USER 'root'@'%' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
如图:
*4.打通隧道(检查是否链接成功--公网默认是8066)*
*5.通过远程工具链接*
*本地链接*
*1.登录mysql数据库* *mysql -uroot -pXXX*
*2.查看*
执行:show databases;
use mysql
SELECT Host, User, plugin from user;
*3.修改root或者普通用户的加密方式*
执行修改命令根据你需要访问的host进行修改 (当前模拟是更改了所有加密)
ALTER USER 'root'@'localhost' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
ALTER USER 'root'@'192.168.0.0' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'192.168.0.0' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
ALTER USER 'root'@'127.0.0.1' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
ALTER USER 'root'@'%' IDENTIFIED BY 'XXXX' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'XXXX';
FLUSH PRIVILEGES;
*4.打通隧道(本地打通隧道端口可以自定义 只要不冲突就可以)*
*5.登录本地安装的mysql客户端验证(客户端根据自己喜好放)*
*6.查看本地是否链接成功*
*7.通过远程工具链接*
*此模拟公有云 本地都正常链接*