当服务器部署mysql,navicat远程访问,修改密码时需要修改两次
1、修改本地登录密码
mysql > SET PASSWORD = PASSWORD('123456');
mysql > FLUSH PRIVILEGES;
重启mysql服务
service mysql restart
上面命令如果报错,则采取以下方法:
[root@]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service
Failed to restart mysqld.service: Unit mysqld.service not found.
[root@]# whereis mysql
mysql: /usr/local/mysql /usr/local/mysql/bin/mysql
[root@]# /etc/init.d/ | grep mysql
-bash: /etc/init.d/: Is a directory
[root@]# ll /etc/init.d/ | grep mysql
[root@]# find / -name mysql.server
/usr/local/mysql/support-files/mysql.server
[root@]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
[root@]# service mysql restart
Shutting down MySQL.... SUCCESS!
Starting MySQL. SUCCESS!
[root@]# service mysql stop
Shutting down MySQL.... SUCCESS!
[root@]# service mysql start
Starting MySQL. SUCCESS!
2、修改远程访问登录密码
在mysql的user表中
刷新权限
FLUSH PRIVILEGES;