reset mysql-mariadb root password in Linux

HomeOther Contentreset mysql-mariadb root password in Linux
reset mysql-mariadb root password in Linux
reset mysql-mariadb root password in Linux
Reset MySQL/MariaDB root password

Step 1:
Stop the MySQL/MariaDB service
CentOS/RHEL 7 Ubutu 16
systemctl stops mysqld/mariadb

CentOS/RHEL 6/5 Ubuntu 14

mysqld service stop

2nd step:
Start the MySQL daemon with “mysqld_safe”

mysqld_safe – skip-grant-tables

Press CTRLz to suspend a process by sending it the SIGSTOP signal

Step 3:

Database connection without password

mysql –userroot mysql

Step 4:

Update root password

update user defined PasswordPASSWORD('new-password') where user'root';
OR
set password for 'root'@'localhost'password('new-password');
dump privileges;
exit;

Step 5:

kill all mysql processes and restart the mysql/mariadb service

pkill -9 myslqd
CentOS/RHEL 7, Ubuntu 16

systemctl restart myslq/mariadb
CentOS/RHEL 7, Ubuntu 16

restarting the mysqld/mariadb service.

http://www.linuxtopic.com/2017/02/reset-mysqlmariadb-root-password-in.html

Please take the opportunity to connect and share this video with your friends and family if you find it useful.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *