Default password of mysql in ubuntu server 16.04

Debashisenator picture Debashisenator · Feb 23, 2017 · Viewed 119.1k times · Source

I have installed ubuntu 16.04 server. Mysql server was installed by default in it. When I am trying to access the mysql with mysql -u root -p, I am unable to log in to mysql because I dont have the password. Is there any default password?

I have also tried with --skip-grant-tables, even this does not work. Even trying to log in with just mysql -u root is a failure.

Answer

Maoz Zadok picture Maoz Zadok · Apr 11, 2018

This is what you are looking for:
sudo mysql --defaults-file=/etc/mysql/debian.cnf
MySql on Debian-base Linux usually use a configuration file with the credentials.