MySQL是一个关系数据库管理系统(RDBMS),它作为服务器运行,为多用户提供对多个数据库的访问权限。数据库。MySQL源代码是免费提供的,因为它最初是由Oracle开发的。MySQL用C和C ++编写,并且与所有主要操作系统兼容。MySQL可用于多种应用程序,但最常见于Web服务器。
在AlmaLinux 8上安装MySQL
步骤1.首先,让我们首先确保您的系统是最新的。
sudo dnf update sudo dnf install epel-release
步骤2.在AlmaLinux上安装MySQL 8。
现在,我们运行以下命令来安装MySQL:
sudo dnf install mysql-server mysql
成功安装后,请使用以下命令启动以使其在系统启动时启动:
sudo systemctl restart mysqld
sudo systemctl status mysqld
sudo systemctl enable mysqld
默认情况下,不会对MariaDB进行加固。您可以使用mysql_secure_installation
脚本保护MariaDB 。您应该仔细阅读每个步骤,并在每个步骤下面仔细进行操作,这将设置root密码,删除匿名用户,禁止远程root登录以及删除测试数据库和对安全MariaDB的访问权限:
mysql_secure_installation
输出:
[root@idroot.us ~]# mysql_secure_installation Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: Please set the password for root here. New password: Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success. 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? (Press y|Y for Yes, any other key for No) : y Success. By default, MySQL 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? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
要登录MariaDB,请使用以下命令(请注意,该命令与登录MariaDB数据库所使用的命令相同):
mysql -u root -p
在生产服务器上运行MySQL时,最重要的事情之一就是充分利用其性能。如果您是新手,并且不知道如何调整MySQL服务器,则可以从名为MySQLTuner的程序开始。它将帮助您分析服务器并调整MySQL,以获得更好的整体性能。
恭喜你!您已经成功安装了MySQL。感谢您使用本教程在AlmaLinux 8系统上安装MySQL服务器。如需其他帮助或有用信息,建议您访问MySQL官方网站。
原创文章,作者:校长,如若转载,请注明出处:https://www.yundongfang.com/Yun47926.html