dx486107
By:
dx486107

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)?

July 18, 2017 383 views
MySQL Debian

$ 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'

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
    
Have another answer? Share your knowledge.