当前位置:网站首页>Linux MySQL command

Linux MySQL command

2022-06-21 19:35:00 Faith_ two hundred and seventy-three million nine hundred and n

1、mysql stay linux Check out my.cnf The method of location

locate my.cnf

2、 start-up 、 restart 、 The shutdown command

1、 restart :

systemctl restart mysqld

2、 stop it

systemctl stop mysqld

3、 Start up

service mysqld start

Two 、 Forget your password and change it mysql Password operation :

Turn off password verification first , Get into mysql, And then modify it root Password of account , Turn on password verification

First modify :
1、 modify /etc/my.cnf The configuration file

vi /etc/my.cnf

2、 stay [mysqld] Add under skip-grant-tables, Save it .

Sign in :

1、mysql -u root -p

2、 No password required , Directly enter ( appear Enter Password It's the same. Go straight back , You can login successfully )

3、 Change password

update user set authentication_string=password(‘ New password ’) where user=‘root’;
flush privileges;

sign out :

quit;

go back to /etc/my.cnf file , find [mysqld]、 Add the following skip-grant-tables Delete or comment out directly .

restart mysql: Restart first , In the stop , When executing the start command

原网站

版权声明
本文为[Faith_ two hundred and seventy-three million nine hundred and n]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211759286334.html