Saturday, 5 March 2016

MySQL Installation CentOS 6.5


01. Download mysql repository.

02. Install the repository.
]# rpm -ivh mysql-community-release-el6-5.noarch.rpm


03. Disable all links in the repository. So we can only enable required version.
]# sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/mysql-community.repo


04. Edit the file, Here I will install mysql version 5.6. Since I will enable=1 for the specific section only.
]# vim /etc/yum.repos.d/mysql-community.repo


05. Now install mysql packages.
]# yum install mysql-community-server mysql-community-client mysql-community-libs mysql-community-common -y


06. Start mysql service.
]# service mysqld start

]# chkconfig mysqld on


07. Install mysql with secure way.
]# mysql_secure_installation

Note: We can set here MySQL root password.


08. Restat the service to take above effects.
]# service mysqld restart


09. Login to mysql from same server. To Administer it.

]# mysql -u root -p

Create MySQL User for remote server login:

CREATE USER 'username'@'%' IDENTIFIED BY 'userpassword';
grant all on *.* to 'username'@'%' with grant option;
flush privileges;
\q
 

No comments: