Question

What is the root password asked by "mysql_secure_installation" script on a debian 9 system that was setup using SSH (i.e. no root password)?

Posted July 18, 2017 9.7k views
MySQLDebian

$ mysqlsecureinstallation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 1698 (28000): Access denied for user ‘root’@'localhost’

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @dx486107

Like it says in the note, if you just installed MariaDB yourself manually, then there is no password and you can just press enter.

EDIT: Also note that root via SSH has nothing to do with root via MariaDB.

  • Thanks for the reply. I have found out that I must run the command mysqlsecureinstallation with sudo as below. This solved my problem.

    sudo mysql_secure_installation
    
Submit an Answer