MySQL Administration
MySql root password reset on CentOS/Oracle Linux/Red Hat
Stop MySql
# service mysqld stop
Start MySql without any security or passwords
# /usr/bin/mysqld_safe --skip-grant-tables &
Change / Reset MySql root password
# mysql -u root
mysql> USE mysql
mysql> UPDATE user SET Password=PASSWORD('new_password') WHERE user='root'
mysql> FLUSH PRIVILEGES;
mysql> exit;Restart MySql
# service mysqld restart
MySql root password reset on Debian/Ubuntu
To connect to MySQL as the root user do the following:$ sudo mysql --defaults-extra-file=/etc/mysql/debian.cnf
REFERRERS
MySqlAdministration
MySqlDesignQuery