用户工具

站点工具


zh:notes:centos_mysql_pwd

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
zh:notes:centos_mysql_pwd [2022/10/22 20:43]
pzczxs
zh:notes:centos_mysql_pwd [2023/03/23 07:42] (当前版本)
pzczxs [Start mysql Service]
行 1: 行 1:
 ====== Reset the Password of MySQL in the CentOS ====== ====== Reset the Password of MySQL in the CentOS ======
-===== Stop mysql =====+===== Stop mysql Service ​=====
 <code bash> <code bash>
-> systemctl stop mysqld+> systemctl stop mysqld.service
 </​code>​ </​code>​
  
-===== Set the MySQL environment ​Option =====+===== Set the Environment ​Option =====
 <code bash> <code bash>
 > systemctl set-environment MYSQLD_OPTS="​--skip-grant-tables"​ > systemctl set-environment MYSQLD_OPTS="​--skip-grant-tables"​
 </​code>​ </​code>​
  
-===== Start mysql =====+===== Login as root without Password ​=====
 <code bash> <code bash>
 +> systemctl start mysqld.service
 > mysql -uroot > mysql -uroot
 </​code>​ </​code>​
行 23: 行 24:
 </​code>​ </​code>​
  
-===== Stop mysql =====+===== Stop mysql Service and Unset the Environment Option ​=====
 <code bash> <code bash>
-> systemctl stop mysqld+> systemctl stop mysqld.service 
 +> systemctl unset-environment MYSQLD_OPTS
 </​code>​ </​code>​
  
-===== Unset the MySQL Environment Option ​=====+===== Start mysql Service ​=====
 <code bash> <code bash>
-> systemctl ​unset-environment MYSQLD_OPTS+> systemctl ​start mysqld.service
 </​code>​ </​code>​
  
-===== Start mysql =====+===== Login with New Password ​=====
 <code bash> <code bash>
-systemctl start mysqld+mysql -uroot -p
 </​code>​ </​code>​
  
 ~~DISCUSSION:​closed~~ ~~DISCUSSION:​closed~~
  
zh/notes/centos_mysql_pwd.1666442595.txt.gz · 最后更改: 2022/10/22 20:43 由 pzczxs