MariaDB Configuration: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 5: Line 5:


=Post-Install=
=Post-Install=
 
==Start at Boot==
==Secure==


<pre>
<pre>
mysql_secure_installation
systemctl enable mariadb.service
systemctl start mariadb.service
</pre>
</pre>


<pre>
==Secure==
Enter current password for root (enter for none):
...
Set root password? [Y/n] Y
...
Remove anonymous users? [Y/n] Y
...
Disallow root login remotely? [Y/n] Y
...
Remove test database and access to it? [Y/n] Y
...
Reload privilege tables now? [Y/n] Y
...
</pre>


==Test==
Make sure the database is started.


<pre>
For MariaDB 10 and newer (the old name of the tool is <code>mysql_secure_installation</code>):
cd /usr
<syntaxhighlight lang='bash'>
/usr/bin/mysqld_safe --datadir=/var/lib/mysql
/usr/bin/mariadb-secure-installation
cd /usr/mysql-test; perl mysql-test-run.pl
</syntaxhighlight>
</pre>


=Start at Boot=
<font size=-2>
 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
<pre>
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
systemctl enable mariadb
systemctl start mariadb
[...]
</pre>
Enter current password for root (enter for none): <enter>
OK, successfully used password, moving on...
[...]
Switch to unix_socket authentication [Y/n] n
  ... skipping.
[...]
Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
[...]
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] Y
[...]
Remove test database and access to it? [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
[...]
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
</font>

Latest revision as of 01:51, 1 January 2024

Internal

Post-Install

Start at Boot

systemctl enable mariadb.service
systemctl start mariadb.service

Secure

Make sure the database is started.

For MariaDB 10 and newer (the old name of the tool is mysql_secure_installation):

/usr/bin/mariadb-secure-installation

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

[...]

Enter current password for root (enter for none): <enter>
OK, successfully used password, moving on...

[...]

Switch to unix_socket authentication [Y/n] n
 ... skipping.

[...]

Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..

[...]

Remove anonymous users? [Y/n] Y

[...]

Disallow root login remotely? [Y/n] Y

[...]

Remove test database and access to it? [Y/n] Y

[...]

Reload privilege tables now? [Y/n] Y

[...]

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.