Installing MySQL Server in CentOS 7
As a part of some latest R&D, I wanted to replicate some data from SQL Server to MySQL. Since there is no native way to do this, I am preparing my own framework which suits my requirement. To work on the project, I have purchased, recently, cloud space with one of the hosting company where I was having CentOS 7 in the VM I have received.
CentOS 7 is coming with MariaDB by default in its repository. I needed MySQL not MariaDB for my project so without further discussing about which RDBMS is good between these two, let us see how to install MySQL Server in CentOS 7.
Before doing anything, login to your CentOS 7 server administrative/root privilege.
1.) Check the YUM repository whether you already have MySQL in your CentOS 7 or not. By default it won’t be there for sure.
#yum search mysql
2.) Download the desired MySQL Server in your CentOS 7.
#wget http://repo.mysql.com/mysql-community-release-el7-11.noarch.rpm<br /> #sudo rpm -ivh mysql-community-release-el7-11.noarch.rpm
You can decide the desired MySQL server version from the official repository list given here.
3.) Now, update your “yum” repository in your CentOS 7
4.) Now you are all set to install MySQL Server in your CentOS 7 by executing following command.
#sudo yum install mysql-server #sudo systemctl start mysqld
5.) Now try login to MySQL server we have just installed.
#mysql -u root -p
Once you will hit “enter” button, you will be prompted with password. If you have not setup MySQL password, hit enter again or/else enter the password and hit enter.