Mysql reset forgotten root password
Topic: How to reset mysql root password in vicidial
Overview:
MySQL is an open-source relational database management system (RDBMS),
MariaDB is a fork of the MySQL database management system.
Vicidial use either mysql or mariadb as there default database software.
Issue: Mysql root password Forgot
In the MySQL ecosystem, root is the default user created during installation.
What to do when you forgot the root password of MySQL
Follow the below steps to reset the mysql root password.
Steps: Reset mysql root password
Step 1 : stop the mysql
/etc/init.d/mysql stoporsystemctl stop mysqld
it will outputs
stopping MySQL database server : mysqld
Step 2 : starting the mysql in safemode
run the below command to start mysql in safe mode
mysqld_safe --skip-grant-tables &
the above command outputs as
[1]5988Starting mysqld daemon with databases from /var/lib/mysqlmysqld_safe[6025]: started
Step 3 : logging to mysql
mysql -u root
outputs
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Step 4 : updating new password for mysql root
copy paste the below mysql commands
use mysql
update user set password=PASSWORD("yournewpassword") where user='root';
flush privileges
quit
Step 5 : Stop and Start the mysql
/etc/init.d/mysql stop/etc/init.d/mysql startorsystemctl stop mysqldsystemctl start mysqld
Step 6 : login to mysql with new password
mysql -u root -p yournewpassword