阿里云服务器mysql密码重置、远程连接设置

密码重置
第一步在linux上输入:mysqladmin -u root -p password
结果:Enter password: 输入原密码
New password: 输入新密码
Confirm new password:输入新密码
远程连接
第一步输入:mysql -uroot -p
结果:Enter password: 输入密码
第二步输入:use mysql;(切换到mysql)
结果:Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
第三步输入:update user set host = ‘%’ where user = ‘root’;
结果:Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
第四步输入:flush privileges;(刷新权限)
结果:Query OK, 0 rows affected (0.00 sec)

别忘了安全组,开放3306端口哦
直接添加安全组规则出入开放3306

基本这样就结束了,用你工具连接就好,这里我用的Navicat连接
转载请带连接哦!

猜你喜欢

转载自blog.csdn.net/qq_43061705/article/details/84374374