Not much to say, directly on the topic!
The direct yum install MySQL will error, because there is no directly available installation package in the Yum installation library, this time needs to use the MariaDB , MariaDB is the MySQL Community Development Branch, is also an enhanced alternative.
When installing ossec, you need to use the Mysql-server to install the error directly:
[root@ossec-server ~]# yum install mysql-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package mysql-server available.
Error: Nothing to do
The reason is that there is no directly available installation package in the Yum installation library, this is the time to use MARIADB, MARIADB is a branch of the MySQL community development, but also an enhanced alternative.
1. Installing MARIADB
yum -y install MariaDB-server MariaDB MariaDB-devel
systemctl start mariadb
systemctl enable mariadb
firewall-cmd --permanent --add-service mysql
systemctl restart firewalld.service
iptables -L -n|grep 3306
[root@ossec-server Desktop]# yum -y install mariadb-server mariadb mariadb-devel
Loaded Plugins:fastestmirror, LangPacks
Loading mirror speeds from cached hostfile
Package 1:mariadb-server-5.5.47-1.el7_2.x86_64 already installed and latest version
Package 1:mariadb-5.5.47-1.el7_2.x86_64 already installed and latest version
Package 1:mariadb-devel-5.5.47-1.el7_2.x86_64 already installed and latest version
Nothing to do
[Email protected] desktop]# systemctl start mariadb[root@ossec-server Desktop]# systemctl start mariadb
[root@ossec-server Desktop]# systemctl start mariadb
[root@ossec-server Desktop]# systemctl enable mariadb
[root@ossec-server Desktop]# mysql_secure_installation
/usr/bin/mysql_secure_installation:line 379:find_mysql_client:command not found
Note:running all PARTS of this SCRIPT are RECOMMENDED for all MariaDB
SERVERS in PRODUCTION use! Please READ each STEP carefully!
In order to log into MariaDB to secure it, we'll need the current
Password for the root user. If you ' ve just installed MariaDB, and
You haven ' t set the root password yet, the password would be blank,
So, should just press ENTER here.
Enter current password to root (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]
Re-enter new password:
Password Updated successfully!
Reloading privilege tables.
By default, a MariaDB installation have an anonymous user, allowing anyone
To log into MariaDB without has to has a user account created for
them. This was intended only for testing, and the installation
Go a bit smoother. You should remove them before moving into a
Remove anonymous users? [y/n]
Normally, Root should only is allowed to connect from ' localhost '. This
Ensures that someone cannot guess at the root of password from the network.
Disallow Root login remotely? [y/n]
By default, MariaDB comes with a database named ' test ' that anyone can
Access. This was also intended only for testing, and should be removed
Before moving into a production environment.
Remove test database and access to it? [y/n]
-Dropping test database ...
-Removing privileges on test database ...
Reloading the privilege tables would ensure that all changes made so far
would take effect immediately.
Reload privilege tables now? [y/n]
Cleaning up ...
All done! If you ' ve completed all of the above steps, your MariaDB
Installation should now is secure.
Thanks for using mariadb!
[root@ossec-server Desktop]# firewall-cmd --permanent --add-service mysql
[root@ossec-server Desktop]# systemctl restart firewalld.service
[root@ossec-server Desktop]# iptables -L -n|grep 3306
ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 TCP dpt:3306 ctstate NEW
[Email protected] desktop]#[root@ossec-server Desktop]#
2. Log in to the database to see if the settings are successful
[root@ossec-server Desktop]# mysql -uroot -p
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MariaDB Connection ID is 13
Server VERSION:5.5.47-MARIADB MariaDB Server
Copyright (c), Oracle, MariaDB Corporation Ab and others.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
MariaDB [(None)]> show databases;
| Database |
| Information_schema |
| MySQL |
| Performance_schema |
3 Rows in Set (0.00 sec)
MARIADB Related commands:
Systemctl start mariadb #Start MariaDB
Systemctl stop mariadb #stop MariaDB
Systemctl restart mariadb #restart MariaDB
Systemctl enable mariadb #Set boot
The solution of no package Mysql-server available error when installing MySQL in the most detailed CentOS7 of the whole network (graphic detail)