MySQL-5.5 Compiling and installing
First , pre-installation preparation
1.1 Download the MySQL installation package
wget Http://wwwNaNake.org/files/v2.8/cmake-2.8.10.2.tar.gzwget ftp://ftp.ntu.edu.tw/tmp/MySQL/Downloads/ Mysql-5.5/mysql-5.5.32.tar.gz
650) this.width=650; "title=" 1.png "src=" http://s1.51cto.com/wyfs02/M01/8C/69/ Wkiol1hswbjan5jxaaalbkfi1qc011.png-wh_500x0-wm_3-wmp_4-s_2967644406.png "alt=" Wkiol1hswbjan5jxaaalbkfi1qc011.png-wh_50 "/>
1.2 Install the related packages
1.2.1 CMake Software
Cd/root/tools
650) this.width=650; "Width=" 554 "height=" "title=" 2.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s1.51cto.com/ Wyfs02/m02/8c/6d/wkiom1hsv02r2fckaaaqxvrlrlq152.png-wh_500x0-wm_3-wmp_4-s_653426422.png "border=" 0 "/>
TAR-ZXVF cmake-2.8.10.2.tar.gz
CD cmake-2.8.10.2
./bootstrap
Error executing, missing dependency
---------------------------------------------
CMake 2.8.10.2, Copyright 2000-2012 Kitware, Inc.
C compiler on the This system IS:CC
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C + + compiler on the This system.
Please specify one using environment variable CXX.
See Cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors:/root/tools/cmake-2.8.10.2/bootstrapnank/cmake_bootstrap.log
Workaround: Install g++ and Ncurses-devel
Yum-y install gcc-c++ ncurses-devel cmake;
Reinstall execution
./bootstrap
Gmake && gmake Install
Ii. Start the installation of MySQL
1.1 Create users and Groups
Groupadd MySQL
Useradd mysql-s/sbin/nologin-m-G MySQL
650) this.width=650; "Width=" 554 "height=" "title=" 7.png "style=" Background:url ("/e/u261/themes/default/images/ Word.gif ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s1.51cto.com/wyfs02/M01 /8c/6d/wkiom1hswlcsumbpaaapd1tue_m658.png-wh_500x0-wm_3-wmp_4-s_324252859.png "border=" 0 "/>
1.2 Unzip compile MySQL
Cd/root/tools
Tar zxf mysql-5.5.32.tar.gz
CD mysql-5.5.32
650) this.width=650; "Width=" 554 "height=" "title=" 8.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s3.51cto.com/ Wyfs02/m01/8c/69/wkiol1hswmdagb5aaaahrroz_b8224.png-wh_500x0-wm_3-wmp_4-s_702304472.png "border=" 0 "/>
CMake. -dcmake_install_prefix=/application/mysql-5.5.32 \
-dmysql_datadir=/application/mysql-5.5.32/data \
-dmysql_unix_addr=/application/mysql-5.5.32/tmp/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-DEXTRA_CHARSETS=GBK,GB2312,UTF8,ASCII \
-denabled_local_infile=on \
-dwith_innobase_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwithout_example_storage_engine=1 \
-dwithout_partition_storage_engine=1 \
-dwith_fast_mutexes=1 \
-dwith_zlib=bundled \
-denabled_local_infile=1 \
-dwith_readline=1 \
-dwith_embedded_server=1 \
-dwith_debug=0
650) this.width=650; "Width=" 554 "height=" 134 "title=" 9.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s2.51cto.com/ Wyfs02/m02/8c/69/wkiol1hswm3dst27aaawy87vwga107.png-wh_500x0-wm_3-wmp_4-s_665003616.png "border=" 0 "/>
Make && make install
650) this.width=650; "Width=" 554 "height=" 103 "title=" 10.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s3.51cto.com/ Wyfs02/m02/8c/6d/wkiom1hswnqcw5qsaaa1xf9cdme658.png-wh_500x0-wm_3-wmp_4-s_345363468.png "border=" 0 "/>
1.3 Add link
Ln-s/application/mysql-5.5.32//application/mysql
650) this.width=650; "Width=" 554 "height=" "title=" 11.png "style=" Background:url ("/e/u261/themes/default/images/ Word.gif ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s3.51cto.com/wyfs02/M02 /8c/69/wkiol1hswobxgpmfaaaj2i9vfuo258.png-wh_500x0-wm_3-wmp_4-s_2779749028.png "border=" 0 "/>
Third, initialize the configurationPysql
1.1 View the default template configuration file
ll SUPPORT-FILES/MY*CNF
650) this.width=650; "Width=" 554 "height=" "title=" 12.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s3.51cto.com/ Wyfs02/m01/8c/6d/wkiom1hswyvjd9oraaal6swjf58951.png-wh_500x0-wm_3-wmp_4-s_511870223.png "border=" 0 "/>
2.1 Select a configuration file
/BIN/CP support-files/my-small.cnf/etc/my.cnf
Test environment selection is small, the build environment can be selected according to the hardware, for example: MY-INNODB-H-HEAVY-4G.CNF
650) this.width=650; "Width=" 554 "height=" "title=" 13.png "style=" Background:url ("/e/u261/themes/default/images/ Word.gif ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s5.51cto.com/wyfs02/M01 /8c/69/wkiol1hswzvq8bwdaaakq-exzcg808.png-wh_500x0-wm_3-wmp_4-s_3821730868.png "border=" 0 "/>
3.1 Configuring environment Variables
echo "Export path=/application/mysql/bin: $PATH" >>/etc/profile
Tail-l/etc/profile
650) this.width=650; "Width=" 554 "height=" 135 "title=" 14.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s1.51cto.com/ Wyfs02/m01/8c/69/wkiol1hswbkyfbhhaaagsjisluy847.png-wh_500x0-wm_3-wmp_4-s_3227429859.png "border=" 0 "/>
Source/etc/profile
Echo $PATH
650) this.width=650; "Width=" 554 "height=" "title=" 15.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s1.51cto.com/ Wyfs02/m02/8c/6d/wkiom1hswdbjhk87aaasypmxvug979.png-wh_500x0-wm_3-wmp_4-s_2466030964.png "border=" 0 "/>
4.1 initializing the data file
mkdir-p/application/mysql/data # build MySQL Data file directory (not created)
chown-r mysql.mysql/application/mysql/data/# authorizing MySQL users to access MySQL's installation directory
chown-r 1777/tmp/# Adjust/tmp permissions, otherwise initialization will be wrong
650) this.width=650; "Width=" 554 "height=" "title=" 16.png "style=" Background:url ("/e/u261/themes/default/images/ Word.gif ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s4.51cto.com/wyfs02/M00 /8c/6d/wkiom1hsweoxxykpaaamij8eezm099.png-wh_500x0-wm_3-wmp_4-s_3165498708.png "border=" 0 "/>
cd/application/mysql/scripts/
./mysql_install_db--basedir=/application/mysql/--datadir=/application/mysql/data/--user=mysql
650) this.width=650; "Width=" 554 "height=" 142 "title=" 17.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s5.51cto.com/ Wyfs02/m02/8c/69/wkiol1hswfozfhm-aaap5jkxqle840.png-wh_500x0-wm_3-wmp_4-s_2535017538.png "border=" 0 "/>
/BIN/CP Support-files/mysql.server/etc/init.d/mysqld
chmod +x/etc/init.d/mysqld
/etc/init.d/mysqld start
650) this.width=650; "Width=" 554 "height=" "title=" 18.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s2.51cto.com/ Wyfs02/m00/8c/69/wkiol1hswglj3vhtaaaydwtcl4w481.png-wh_500x0-wm_3-wmp_4-s_217453587.png "border=" 0 "/>
iv. Simple database optimization (delete redundant users)
1.1 entering the database
650) this.width=650; "Width=" 554 "height=" 147 "title=" 19.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s2.51cto.com/ Wyfs02/m00/8c/6d/wkiom1hswheqnspbaaaqobjsgko996.png-wh_500x0-wm_3-wmp_4-s_2541505681.png "border=" 0 "/>
1.2 removing redundant users
Mysql> select User,host from Mysql.user;
Mysql> Delete from mysel.user where user= ';
Mysql> Delete from Mysql.user where host= ':: 1 ';
mysql> Delete from Mysql.user wherehost= ' CentOS ';
650) this.width=650; "Width=" 554 "height=" "title=" 20.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s3.51cto.com/ Wyfs02/m01/8c/6d/wkiom1hswkksrj5naaaswbvldlw587.png-wh_500x0-wm_3-wmp_4-s_3433180224.png "border=" 0 "/>
650) this.width=650; "Width=" 554 "height=" "title=" 21.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s3.51cto.com/ Wyfs02/m01/8c/69/wkiol1hswl_t-idbaaam0jmijom006.png-wh_500x0-wm_3-wmp_4-s_4270233820.png "border=" 0 "/>
1.3 View databases
mysql> show databases;
mysql> drop database test;
650) this.width=650; "Width=" 554 "height=" 237 "title=" 22.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s1.51cto.com/ Wyfs02/m02/8c/6d/wkiom1hswn7ygalbaaaiz75cvng451.png-wh_500x0-wm_3-wmp_4-s_346485959.png "border=" 0 "/>
2.1 Add password
/application/mysql//bin/mysqladmin-u root password ' CentOS '
650) this.width=650; "Width=" 554 "height=" "title=" 23.png "style=" Background:url ("/e/u261/themes/default/images/ Word.gif ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s1.51cto.com/wyfs02/M02 /8c/69/wkiol1hswpksiqcvaaaldqd4dqi702.png-wh_500x0-wm_3-wmp_4-s_2707593017.png "border=" 0 "/>
3.1 set boot start
Chkconfig mysqld on
Chkconfig--list mysqld
650) this.width=650; "Width=" 554 "height=" "title=" 24.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s5.51cto.com/ Wyfs02/m00/8c/6d/wkiom1hswqoi1qh4aaarvjcb-zq756.png-wh_500x0-wm_3-wmp_4-s_152540462.png "border=" 0 "/>
4.1 Remove all, add additional admins
>delete from Mysql.user;
>grant all privileges in *.*to [email protected] ' locahost ' identified by ' CentOS ' with GRANT option;
5.1mysql Login
Mysql-uroot-p
650) this.width=650; "Width=" 554 "height=" 157 "title=" 25.png "style=" Background:url ("/e/u261/lang/zh-cn/images/ Localimage.png ") No-repeat center;border:1px solid RGB (221,221,221);" alt= "Spacer.gif" src= "http://s2.51cto.com/ Wyfs02/m01/8c/6d/wkiom1hswrlsm-okaaasd9pychk673.png-wh_500x0-wm_3-wmp_4-s_4171815188.png "border=" 0 "/>
v. Possible commands
1. View the system version
Cat/etc/redhat-release
Uname–m
650) this.width=650; "Width=" 554 "height=" "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") No-repeat center;border:1px solid RGB (221,221,221); "alt=" Spacer.gif "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "/>
2. Modify the Yum source
Select the added source
650) this.width=650; "Width=" 408 "height=" 366 "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") No-repeat center;border:1px solid RGB (221,221,221); "alt=" Spacer.gif "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "/>
Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-6.repo
650) this.width=650; "Width=" 554 "height=" "style=" Background:url ("/e/u261/themes/default/images/word.gif") No-repeat center;border:1px solid RGB (221,221,221); "alt=" Spacer.gif "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "/>
Yum Makecache
3, installation RZ,sz
Yum Install Lrzsz
650) this.width=650; "Width=" 554 "height=" 280 "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") No-repeat center;border:1px solid RGB (221,221,221); "alt=" Spacer.gif "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "/>
4. Modify the character set
vi/etc/sysconfig/i18n
650) this.width=650; "Width=" 554 "height=" "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") No-repeat center;border:1px solid RGB (221,221,221); "alt=" Spacer.gif "src="/e/u261/themes/default/images/spacer.gif "border=" 0 "/>
This article is from the "Ops Little Boss" blog, please be sure to keep this source http://solin.blog.51cto.com/11319413/1888798
MySQL-5.5 CMake Compile and install