資料庫上手避坑之--修改sql的root密碼
阿新 • • 發佈:2020-11-24
[developRos nication]# mysqladmin -u root -p flush-privileges password //使用命令修改系統 Enter password: [developRos nication]# mysql -u root -p //使用老密碼登陸 Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.5.8-MariaDB Arch Linux Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> \q //用\q退出 Bye [developRos nication]# mysql -u root -p //使用老密碼登陸 Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 Server version: 10.5.8-MariaDB Arch Linux Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> exit //用exit退出或者執行mysqladmin -u root -p flush-privileges重新整理也可以 Bye [developRos nication]# exit exit nication ~ mysql -u root -p //使用新密碼登陸 Enter password: ERROR 1698 (28000): Access denied for user 'root'@'localhost' nication ~ mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 7 Server version: 10.5.8-MariaDB Arch Linux Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.