View the currently installed linux version command: the data shown in the lsb_release-a shows that the installed version is CentOSrelease6.3, therefore, we need to download the mysql installation package corresponding to CentOSrelease6.3 to download the mysql installation file 1. if you only need to install mysql, you only need to install the following command to view the currently installed linux version: the data shown in lsb_release-a shows that the installed version is CentOS release 6.3. Therefore, we need to download the mysql installation package corresponding to CentOS release 6.3.
Download the mysql installation file
1. if you only need to install mysql, you only need to install the following files:
MySQL-server-5.5.25-1.rhel5
MySQL-devel-5.5.25-1.rhel5
MySQL-client-5.5.25-1.rhel5
2. if you need to build the entire Linux implementation environment (nginx, php, mysql, tomcat, jdk, and server multi-domain configuration)
Please refer to my Linux project implementation series tutorials:
CenterOS 6.3 64-bit nginx1.3 + php5.4.3 + mysql5.25 + atat7 + jdk7 installation
Install mysql5.5.20.and enter the installation file directory.
2. install mysql server
# Rpm-ivh MySQL-server-5.5.25a-1.rhel5.x86_64.rpm
Install mysql-server
The following error may occur during installation: error: Failed dependencies: libaio. so.1 () (64bit) is needed by MySQL-server
3. install the mysql client and mysql-devel
# Rpm-ivh MySQL-client-5.5.25a-1.rhel5.x86_64.rpm
# Rpm-ivh MySQL-devel-5.5.25a-1.rhel5.x86_64.rpm
Mysql-client-devel
Start mysql service
# Service mysql start
Modify the root initialization password in mysql. 1. the command is as follows:
#/Usr/bin/mysqladmin-u root password 'rootadmin'
Format: mysqladmin-u username-p old password new password
2. example
#/Usr/bin/mysqladmin-u root password 'rootadmin'
Note: Because the root account does not have a password at the beginning, the old-p password can be omitted.
3. log on with a new password, as shown in:
Restart and stop the mysql service
Method 1: service mysql start
Startup Method 2:/etc/init. d/mysql start
Stop Method 1: service mysql stop
Stop mode 2:/etc/init. d/mysql shutdown
Restart Method 1: service mysql restart
Restart Method 2:/etc/init. d/mysql restart