MySQL is a widely used database that enjoys great stability as it has been tested for many years. It also has certain replication features that allow us to set up a decentralized and scalable infrastructure. In this first article, we will cover the necessary steps to have a basic server on Gentoo as well as the initial steps in which the installation will be secured and the default databases will be removed, leaving the service ready for exploitation.
The MySQL ebuild allows us to compile with different use flags. To know the meaning of each one:
equery uses dev-db/mysql
Indicate which USE flags to use for MySQL:
dev-db/mysql USEs
Compile:
Assign a root password:
Finish the installation by removing the test table:
mysql_secure_installation
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
We are now ready to enter:
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
It should be noted that if we want to access from the outside, we must bind the service to the IP of the computer:
#bind-address = 127.0.0.1
bind-address = IP
“In upcoming articles, I will explain how to perform basic operations with databases, tables, and more.”