The solution of no package Mysql-server available error when installing MySQL in the most detailed CentOS7 of the whole network (graphic detail)

Source: Internet
Author: User
Tags mysql in iptables ossec

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
mysql_secure_installation
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]
New Password:
Re-enter new password:
Password Updated successfully!
Reloading privilege tables.
... success!


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
Production environment.

Remove anonymous users? [y/n]
... success!


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]
... success!


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 ...
... success!

-Removing privileges on test database ...
... success!

Reloading the privilege tables would ensure that all changes made so far
would take effect immediately.

Reload privilege tables now? [y/n]
... success!

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
success
[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

Mysql-uroot-p
show databases;
 
[root@ossec-server Desktop]# mysql -uroot -p

Enter Password:
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 [(None)]>

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.