Preparation environment: Centos6.5 (6 Series operating system)
[Email protected] ~]# yum-y install gcc gcc-c++ ncurses-devel libxml2-devel zlib-devel pcre-devel
[Email protected] ~]# tar zxvf bison-2.5.tar.gz
[Email protected] ~]# CD bison-2.5
[[email protected] ~]#./configure &&make &&make Install
[Email protected] ~]# tar zxvf cmake-2.8.7.tar.gz
[Email protected] ~]# CD cmake-2.8.7
[[email protected] ~]#./bootstrap &&gmake &&gmake Install
[Email protected] ~]# tar zxvf mysql-5.5.22.tar.gz
[Email protected] ~]# CD mysql-5.5.22
[[email protected] ~]# useradd MySQL
[Email protected] ~]# Cmake-dcmake_install_prefix=/usr/local/mysql-ddefault_charset=utf8-ddefault_collation=utf8 _general_ci-dwith_extra_charsets=all-dsysconfdir=/etc/&&make &&make Install
Parameter comments: Install directory, default encoding, check character set, install all extended character sets, profile directory
[Email protected] ~]# chown-r: mysql/usr/local/mysql
[Email protected] ~]# Cd/usr/local/mysql/support-files
[email protected] ~]# CP my-medium.cnf/etc/my.cnf
[email protected] ~]# CP mysql.server/etc/init.d/mysqld
[Email protected] ~]# CD. /scripts/
The following operations will initialize MySQL, specify the base directory, store the data directory, and run the user
[Email protected] ~]#/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql
[[email protected] ~]#/etc/init.d/mysqld start
[Email protected] ~]# echo "path= $PATH:/usr/local/mysql/bin" >>/etc/profile
[Email protected] ~]# Source/etc/profile
[[email protected] ~]# mysqladmin-u root password ' redhat ' set the MySQL run account and password, this root is not the root of the system user Oh!
[[email protected] ~]# mysql-u root-p
Enter Password:
OK, Installation complete
This article is from the "11000174" blog, please be sure to keep this source http://11010174.blog.51cto.com/11000174/1901834
Compiling and installing Mysql5.5 database software