User Tools

Site Tools


linux:mysql_reset_root_password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
linux:mysql_reset_root_password [2018/06/06 18:04]
admin
linux:mysql_reset_root_password [2018/06/06 18:09] (current)
admin
Line 7: Line 7:
 systemct stop mysqld systemct stop mysqld
 </​code>​ </​code>​
-  - +  - add this line to /​etc/​my.cnf 
 +<code bash> 
 +skip-grant-tables 
 +</​code>​ 
 +  - start mysql service 
 +<code bash> 
 +systemct start mysqld 
 +</​code>​ 
 +  - Log in like root (whitout password) 
 +<code bash> 
 + mysql -u root 
 +</​code>​ 
 +  - change root password 
 +<code bash> 
 +mysql> use mysql; 
 +Reading table information for completion of table and column names 
 +You can turn off this feature to get a quicker startup with -A 
 + 
 +Database changed 
 +mysql> update user set authentication_string=password('​Isr_1234'​) where user='​root';​ 
 +Query OK, 1 row affected, 1 warning (0.00 sec) 
 +Rows matched: 1  Changed: 1  Warnings: 1 
 + 
 +mysql> flush privileges;​ 
 +Query OK, 0 rows affected (0.00 sec) 
 + 
 +mysql> exit 
 +</​code>​ 
 + 
 +  - comment line from /​etc/​mycnf 
 +  - restart mysql service 
 +<code bash> 
 +systemct; restart mysqld 
 +</​code>​ 
 + 
linux/mysql_reset_root_password.1528301045.txt.gz · Last modified: 2018/06/06 18:04 by admin