Linux從入門到放棄 數據庫修改root密碼

[root@localhost support-files]# systemctl stop mysqld.service 
[root@localhost support-files]# mysqld_safe --skip-grant-tables --skip-networking &
[1] 17502
[root@localhost support-files]# 2020-01-18T03:30:30.451790Z mysqld_safe Logging to '/data/mysql/data/localhost.localdomain.err'.
2020-01-18T03:30:30.491899Z mysqld_safe Starting mysqld daemon with databases from /data/mysql/data
[root@localhost support-files]# mysql 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> alter user root@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)

[root@localhost support-files]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.26 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit
Bye

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章