Skip to content
Advertisement

Why is my default password for mysql not empty string [closed]

I ran this [sudo apt-get install mysql-server] in the terminal and when I logged in as root [mysql -u root -p] the empty space is not my password. According to what I’ve read the installation should prompt for a password but mine did not pop up yet it still rejected the empty string as password

Advertisement

Answer

A default install of MySQL on Debian / Ubuntu has password-less access when you are logged on as the system root user, but not other times that you log into as the MySQL root user.

You need to become the root user on the system first.

sudo su -
mysql
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement