*Install MariaDB
This is option for you to choose either MariaDB or MySQL (Next page)
The next component of the LEMP Stack on Ubuntu 20.04 is MySQL.
Letβs begin by updating the repository and installing the MySQL package using apt
.
Press Y
and ENTER
to continue the installation MariaDB package.
Once the package installer has finished, we can check to see if the MariaDB service is running.
If running, you will see a green Active status like below.
You may to type CTRL
+C
and hit ENTER
or Q
to exit the service status.
Configure MariaDB Security
For new MariaDB installations, the next step is to run the included security script. This script changes some of the less secure default options for things like remote root logins and sample users.
The next prompt asks you whether youβd like to set up a database root password. On Ubuntu, the root account for MariaDB is tied closely to automated system maintenance, so we should not change the configured authentication methods for that account. Doing so would make it possible for a package update to break the database system by removing access to the administrative account.
Press ENTER
for none.
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.
Set root password? [Y/n]
Press Y
and type your new password root.
By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.
Remove anonymous users? [Y/n]
Press Y
.
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n]
Press Y
.
By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? [Y/n]
Press Y
.
Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
Reload privilege tables now? [Y/n]
Press Y
.
Test MariaDB
If running, you will see a green Active status like below.
You may to type CTRL
+C
and hit ENTER
or Q
to exit the service status.
You've completed this section, now your website already integrates with MariaDB.
Last updated
Was this helpful?