/* Install CMake */
/* Go To The CMake source code directory */
Cd #
/* Decompress the CMake source code */
Tar zxf cmake-2.8.3.tar.gz
/* Enter the CMake source code directory */
Cd cmake-2.8.3
/* Configure the installation parameters */
./Configure -- prefix =/usr/local/cmake
/* Compile */
Gmake
/* Install */
Make install
/* Set the soft connection */
Ln-s/usr/local/cmake/bin/cmake/usr/bin
######################################## ##########
/* Create a user group */
Groupadd mysql
/* Create a user and join the user group, and revoke the never-ending sbin permission */
Useradd-g mysql-s "/sbin/nologin" mysql
/* Go to the root directory [directory of the source file] */
Cd #
/* Decompress the mysql source code */
Tar zxf mysql-5.5.8.tar.gz
/* Enter the decompressed MYSQL source code directory */
Cd mysql-5.5.8
/* Use cmake to configure compilation options */
Cmake. -DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/home/mysql-DSYSCONFDIR =/etc-DWITH_INNOBASE_STORAGE_ENGINE = 1-runtime = 1-runtime = 1-runtime = 1-runtime = 1-DMYSQL_UNIX_ADDR =/tmp/mysqld. sock-DENABLED_LOCAL_INFILE = 1-DEXTRA_CHARSETS = all-DMYSQL_USER = mysql
/* Start compiling */
Gmake
/* Install mysql to the configured directory */
Make install
/* Enter the script directory under the mysql installation directory */
Cd/usr/local/mysql/scripts
/* Install the default mysql database */
./Mysql_install_db -- basedir =/usr/local/mysql -- datadir =/home/mysql -- user = mysql
/* Enter the support file directory under the mysql installation directory */
Cd/usr/local/mysql/support-files
/* Copy the mysql configuration file */
Cp my-medium.cnf/etc/my. cnf
/* Copy and modify the service file */
Cp mysql. server mysqld
Vi mysqld
/*
Modify:
Basedir =/usr/local/mysql
Datadir =/home/mysql
Press ESC.
Enter
: Wq
*/
Mv mysqld/etc/init. d/mysqld
/* Start the service */
Service mysqld start
/* Add a service to the auto-start item */
Chkconfig -- level 3 mysqld on
/* Set the soft connection */
Ln-s/usr/local/mysql/bin/mysql/usr/bin
Ln-s/usr/local/mysql/bin/mysqldump/usr/bin
Ln-s/usr/local/mysql/bin/mysqladmin/usr/bin
/* Set the default Character Set of mysql */
Vi/etc/my. cnf
/* Add in [mysql configuration section] */
DEFAULT-CHARACTER-SET = UTF8
/* Add in [mysqld configuration section] */
CHARACTER-SET-SERVER = UTF8