MySQL 5.5.8 source code compilation and Installation

Source: Internet
Author: User

/* 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.