Source code to install MySQL, according to the document to execute once
Download the source Package
Tar zxf Entry Directory
./configure--prefix=/usr/local/mysql--enable-assembler &&make && make install
Create a MySQL user, chown-r mysql.mysql/usr/local/mysql/
Then database initialization
/usr/local/ mysql/bin/mysql_install_db--user=mysql--datadir=./var--basedir=/usr/local/mysql/
Re -
And then start
/usr/local/mysql/bin/mysqld_safe--user=mysql&
Configure the source MySQL for the system service:
Cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my.cnf
Cp/usr/local/mysql/share/mysql/mysql.server/etc/rc.d/init.d/mysqld
Chkconfig--add mysqld
Chkconfig--level mysqld on
Service mysqld Restart
mysql5.5
CMake. -DCMAKE_INSTALL_PREFIX=/USR/LOCAL/MYSQL55/\
-dmysql_unix_addr=/tmp/mysql.sock \
-dmysql_datadir=/data/mysql \
-DSYSCONFDIR=/ETC \
-dmysql_user=mysql \
-dmysql_tcp_port=3306 \
-dwith_xtradb_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_partition_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_myisam_storage_engine=1 \
-dwith_readline=1 \
-denabled_local_infile=1 \
-dwith_extra_charsets=1 \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dextra_charsets=all \
-dwith_big_tables=1 \
-dwith_debug=0
Make && make install
Create a MySQL user, chown-r mysql.mysql/usr/local/mysql/
/usr/local/mysql/scripts/mysql_install_db--user=mysql--datadir=./var--basedir=/usr/local/mysql/
This step initializes the database system, initializes the data directory and the root directory
Nohup/usr/local/mysql55/bin/mysqld_safe--user=mysql & server background start MySQL
Ps-ef |grep MySQL look at the success
Not yet, to the host name in the Hosts file, to ensure that the host name can ping through
And then we can MySQL.
MySQL compilation installation