One. mysql Installation
1. See if MySQL is installed
[Email protected] ~]# Rpm-qa | grep MySQL
If there is an uninstallation (choose one of the following three ways):
1) RPM-E mysql-libs-5.1. 1. el6.x86_64 // Normal Delete mode 2) rpm-e--nodeps mysql-libs-5.1 . 1. el6.x86_64 // Brute Force Delete mode, if you use the above command 1) to delete, prompting for other dependent files, then use this command can be strongly removed (recommended) 3) yum remove mysql-libs-5.1. 1. el6.x86_64 //Yum Uninstall
The second command I chose to uninstall
2. Install: yum-y Install Mysql-server
[Email protected] database]# yum-y install Mysql-server
Two.initialization of MySQL database and related configuration
1. Start the MySQL service: Services mysqld start
[[Email protected] database]# service mysqld start
2. Try connecting Mysql:mysql
[[email protected] database]# MySQL
3. Stop:, \q
4. Set up MySQL boot: chkconfig mysqld on
[Email protected] database]# chkconfig mysqld on
5. Turn on port 3306 and save
/sbin/iptables-i input-p TCP--dport 3306-j accept/etc/rc.d/init.d/iptables Save
3306 -/etc/rc.d/init.d/iptables Save
Check if MySQL is Port 3306: NETSTAT-ANP
[Email protected] database]# NETSTAT-ANP
6. Set the root user, password for MySQL
[[email protected] database]# use MySQL; MySQLset for [email Protected]=password ('root'); Or: 'new-password'// set a password for the root account
7. Set MySQL remote access grant all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT option;
' Root '@'%'root' with grant option; MySQL> FLUSH privileges;
Installation is complete!!!
Centos6.5-yum installation and configuration of MySQL