Mysql – how to find password for theSQL database server

MySQLphpmyadmin

How can I find the password for my database on phpMyAdmin? I want to connect mySQL database just by using mysqli_connect and understand that three strings are needed, but I can't seem to find where the password could be. If anyone could help that would be great. Thanks

Best Answer

You can do it with some simple commands:

sudo su

cd /etc/mysql
cat my.cnf

When the file my.cnf is opened you can read it's contents, and it should contain your username and password for the current installation.

Hope this helps! ;)