Environment: Centos6.5
To view the CentOS version:
[Email protected] ~]# cat/etc/redhat-release CentOS release 6.5 (Final)
1. See if MySQL is installed
[Email protected] ~]# Rpm-qa | grep ' MySQL ' [[email protected] ~]#
The display is not installed.
2. Install the MySQL client
[Email protected] ~]# yum-y install mysql[[email protected] ~]#
3. Install the MySQL server
[[email protected] ~]# yum-y install mysql-server mysql-devel[[email protected] ~]#
4. Install the MySQL client and server
[[email protected] ~]# yum-y install MySQL mysql-server mysql-devel[[email protected] ~]#
5. Query MySQL is already installed complete
To install the MySQL client and server as an example:
[Email protected] ~]# Rpm-qa | grep ' MySQL ' mysql-libs-5.1.73-8.el6_8.x86_64mysql-devel-5.1.73-8.el6_8.x86_64mysql-5.1.73-8.el6_8.x86_ 64mysql-server-5.1.73-8.el6_8.x86_64[[email protected] ~]#
6. Start MySQL
[[Email protected] ~]# service mysqld startstarting mysqld: [OK][[email Prot Ected] ~]#
or use the following command:
[Email protected] ~]#/etc/init.d/mysqld startstarting mysqld: [OK][[email Protected] ~]#
7. View MySQL Status
[[Email protected] ~]# service mysqld statusmysqld (PID 3043) is running ... [Email protected] ~]#
8. Go to MySQL
Enter MySQL---Note: the root of MySQL after installation does not have a password by default.
Enter MySQL with the root user name:
[Email protected] ~]# Mysql-uroot-penter password:welcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 3Server version:5.1.73 Source distributioncopyright (c), +, Oracle and/or its a Ffiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql>
OK, now that the installation of MySQL is complete.
This article is from the "tommyking" blog, make sure to keep this source http://tommyking.blog.51cto.com/10481841/1934216
Installing MySQL through the Yum repository under Linux