当前位置:网站首页>Problems encountered in using MySQL

Problems encountered in using MySQL

2022-06-25 16:45:00 Niu you Dao Xue Mian

1、 Problem description

this morning mysql Still using , In the afternoon , Just say my password is wrong and I can't log on .
 Insert picture description here
But I have never touched any other configuration ?

2、 terms of settlement

Here I reload mysql. If you don't have important data, you can do this . If there's important data , Try backing up your data first .

  • First delete all mysql The dependent libraries
sudo pacman -R mysql libmysqlclient mysql-clients
  • Then delete mysql Configuration file for ( Go to the super user interface first )
cd /var/lib/mysql 
rm -rf *
  • install mysql
sudo pacman -S mysql
  • initialization mysql( This step obtains mysql Initial password )
sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

 Insert picture description here

  • restart mysql( Be careful , Be sure to restart mysql)
sudo systemctl restart mysqld
  • land mysql( Use your initial password )
mysql -u root -p

 Insert picture description here

  • Change Password
    Get into mysql in the future , Reset password .

I really appreciate it , Because there is no restart step , I've done it dozens of times ...

原网站

版权声明
本文为[Niu you Dao Xue Mian]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251610336746.html