====== MySQL reset root password ======
- Stop mysql service
systemct stop mysqld
- add this line to /etc/my.cnf
skip-grant-tables
- start mysql service
systemct start mysqld
- Log in like root (whitout password)
mysql -u root
- change root password
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
- comment line from /etc/mycnf
- restart mysql service
systemct; restart mysqld