How to install mysql in RHEL 7


#1

root@dd ~]#
[root@dd ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.3 (Maipo)
[root@dd ~]#
[root@dd~]#
[root@dd~]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id repo name status
sunht sunht repo 4,751
repolist: 4,751

i have --below rpm

ls -la
total 145940
drwxr-xr-x 3 root root 4096 Apr 6 17:35 .
dr-xr-x—. 16 root root 4096 Apr 6 19:26 …
-rw-r–r-- 1 root root 74023963 Apr 6 15:31 mysql-5.5.tar.gz
drwxr-xr-x 2 root root 4096 Apr 6 18:00 mysql-bundle
-rw-r–r-- 1 root root 18235430 Apr 6 15:32 MySQL-client-5.5.30-1.rhel5.x86_64.rpm
-rw-r–r-- 1 root root 55074410 Apr 6 15:32 MySQL-server-5.5.30-1.rhel5.x86_64.rpm
-rw-r–r-- 1 root root 2087280 Apr 6 15:32 MySQL-shared-5.5.30-1.rhel5.x86_64.rpm

mysql]#
[root@dd mysql]# rpm -qa | grep -i "mysql"

Note: no Db package install but failed to installed.

[root@dd mysql]# rpm -ivh MySQL-server-5.5.30-1.rhel5.x86_64.rpm
Preparing… ################################# [100%]
file /usr/share/mysql/charsets/README from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.5.30-1.rhel5.x86_64 conflicts with file from package mariadb-libs-1:5.5.52-1.el7.x86_64
file /usr/share/mysql/charsets/cp850.xml from install


#2

remove mariadb and try to install again …
yum remove mariadb*


#3

I have a server with Plesk 12.5 and Centos 7 that installed the default MariaDB. I need to use the native Mysql 5.6. So my question is how do I replace mariadb with mysql 5.6 or if I follow the steps above, how does plesk see the mysql database server as localhost/default.

I do not want to do a complete reinstall of Plesk and the server.


#4

Hello Ritesh,
Here is how to do this:
#######################################

~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
~]# sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
~]# yum update

~]# sudo yum install mysql-server
~]# sudo systemctl start mysqld

Harden MySQL Server:

Run the mysql_secure_installation script to address several security concerns in a default MySQL installation.

~]# sudo mysql_secure_installation


Root Login:

To log in to MySQL as the root user:

~]# mysql -u root -p

auto run:

~]# chkconfig --level 345 mysqld on

etc…

Best Regards


#5

For autorun better to use:
systemctl enable mysqld