Reset Root Password in MySQL(MariaDB)
Let's check how to Reset Root Password for MySQL or MariaDB.
The script can be slightly different depending on OS and MySQL Editions.
Stop current running MySQL(MariaDB)
OS: Red Hat, Centos etc. DB: MySQL
sudo /etc/init.d/mysqld stop
OS: Ubuntu, Debian. DB: MariaDB
sudo /etc/init.d/mysql stop
-- OR
sudo service mysql stop
-- OR
sudo systemctl stop mysql
Start MySQL(MariaDB) skipping permission check
sudo mysqld_safe --skip-grant-tables &
Note!
|
Set new Password for Root User
Connect to MySQL without a password.
mysql -uroot
Update Root Password.
UPDATE mysql.user SET authentication_string=PASSWORD("<new strong password>") WHERE User='root';
-- OR
UPDATE mysql.user SET PASSWORD=PASSWORD("<new strong password>")
WHERE User='root';-- ORALTER USER 'root'@'localhost' IDENTIFIED BY VIA mysql_native_password USING PASSWORD('<new strong password');
Apply changes.
flush privileges;
Exit from MySQL
quit;
Stop & Start MySQL(MariaDB)
OS: Red Hat, Centos etc. DB: MySQL
sudo /etc/init.d/mysqld stop
sudo /etc/init.d/mysqld start
OS: Ubuntu, Debian. DB: MariaDB
sudo /etc/init.d/mysql stop-- ORsudo service mysql stop-- ORsudo systemctl stop mysql
And
sudo /etc/init.d/mysql start-- ORsudo service mysql start-- ORsudo systemctl start mysql
Connect to MySQL(MariaDB) with the new password
mysql -u root -p
The 3 Best Casinos in Atlantic City - MapyRO
ReplyDeleteCasinos in 서산 출장마사지 Atlantic City — 1 Casino, 2 Casino, 3 Casino, 4 Casino, 5 Casino, 춘천 출장안마 6 Casino, 7 Casino, 8 Casino, 9 부천 출장마사지 Casino, 10 Casino, 11 Casino, 울산광역 출장샵 12 Casino, 13 Casino, 14 Casino, 15 Casino, 나주 출장샵 16 Casino, 17 Casino, 18 Casino, 19 Casino, 20 Casino, 21