Centos6.5-yum installation and configuration of MySQL

Source: Internet
Author: User

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

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.