How to modify mysql password under linux, including local password and remote password. navicat remote login

When the server deploys mysql, navicat remote access, you need to modify the password twice

1. Modify the local login password

mysql > SET PASSWORD = PASSWORD('123456');
mysql > FLUSH PRIVILEGES;

Restart the mysql service

service mysql restart

If the above command reports an error, take the following method:

[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. Modify the remote access login password and refresh the permissions
in the mysql user table
insert image description here

FLUSH PRIVILEGES;

Guess you like

Origin blog.csdn.net/weixin_44999830/article/details/130631569