0

I'm learning to run my own VPS and I tried install whole stack few times already. But I found one thing that is not same in the all tutorials: mysql_install_db command.

I'm using Ubuntu LTS and it was always like this:

apt install mariadb-server
mysql_secure_installation

Everything running. Now I found that after install there should be iniciallization command. I'm confused, because all seems running fine, but maybe my installation is missing something important? Or this mysql_install_db command is not needed at all? Will be thankful for the explanation.

1 Answers1

2

The mysql_secure_installation is a security script, whereas mysql_install_db

initializes the MariaDB data directory and creates the system tables in the mysql database, if they do not exist.

Because you have installed MariaDB as a package from your distribution using apt install mariadb-server this initialization has been already done. Therefore, you don't need to run the script mysql_install_db, but you still benefit from running mysql_secure_installation.

Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129