Reset - Mysql - password-ubuntu
Reset MySQL root password in ubuntu
- edit config file by
sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf
- in [mysqld] section, below ‘skip-external-locking’ add line
skip-grant-tables
- restart MySQL
sudo systemctl restart mysql
- enter mysql
mysql -u root -p
- switch to mysql database
use mysql;
- change root password to ‘passwd’:
UPDATE mysql.user SET authentication_string=password('passwd') WHERE User='root' AND Host ='localhost';
- update plugin field:
UPDATE user SET plugin="mysql_native_password";
(plugin field is used to authenticate user, if it is empty, server will use built-in method)
flush privileges; quit;
revert back the config file /etc/mysql/mysql.conf.d/mysqld.cnf by remove or comment out the line has been added.
start mysql again and login with new passwd
sudo systemctl start mysql
K8s installation on Centos