First, the experimental environment
CentOs 6.6
[Email protected] ~]# Uname-rs
Linux 2.6.32-504.el6.i686
[Email protected] ~]#
Second, the experimental steps
1. Download the appropriate version from the Internet, this article uses mysql-5.5.48-linux2.6-i686, as follows:
Wget/home/chen/tools http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.48-linux2.6-i686.tar.gz
2. Unzip and create the soft-connect file (the build && make install that is equivalent to the compiled installation is finished)
Tar XF mysql-5.5.48-linux2.6-i686
Mkdir-p/application/mysql
MV mysql-5.5.48-linux2.6-i686/application/mysql-5.5.48
Ln-s/application/mysql-5.5.48//application/mysql
3. Create MySQL user, do not create home directory and cannot log in.
Useradd mysql-s/sbin/nologin/-M
4. Switch to/application/mysql to initialize the database.
/application/mysql/scripts/mysql_install_db--basedir=/application/mysql--datadir=/application/mysql/data/-- User=mysql
5. Authorizing MySQL Management database files
Chown-r mysql.mysql/application/mysql/
6. Generate MySQL configuration file
Cp/application/mysql/support-files/mysql-small.cnf/etc/my.cnf
7. Configure Start MySQL
Sed-i ' S#/usr/local/mysql#/application/mysql#g '/application/mysql/bin/mysqld_safe
8. Configure environment variables (there are two ways to choose one)
Vi/etc/profile
Path= "/application/mysql/bin: $PATH"
Source/etc/profile
Or: cp/application/mysql/bin/*/usr/local/sbin/appears as follows:
[[email protected] application]# which MySQL
/usr/local/sbin/mysql
9. Log in to MySQL
[[email protected] application]# MySQL
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 2
Server version:5.5.48 MySQL Community Server (GPL)
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>
10. Set Login password and change password
/application/mysql//bin/mysqladmin-u Root-password ' New-password '
/application/mysql//bin/mysqladmin-u root-h lnmp02 password ' new-password '
Mysqladmin-uroot password "password"---set password
Mysqladmin-uroot-pchen password "password"---change password
11. Scientific start-up method realization
CP Support-files/mysql.server/etc/init.d/mysqld
Sed-i ' S#/usr/local/mysql#/application/mysql#g '/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld
Chkconfig mysqld on
Chkconfig--list mysqld
Complete the appeal step to implement the binary installation MySQL ^.^
Iii. Summary of the experiment
In fact, it is not difficult, as long as willing to heart, to all the learning of the small partners, refueling!!!
This article is from "Wake up your not alarm clock but dream" blog, please be sure to keep this source http://purify.blog.51cto.com/10572011/1771783
Binary installation MySQL method and its configuration