[转]mysql源代码安装

(2011-07-21 14:24:59)
 
mysql5.1mysql生产环境下安装
cp support-files/mysql.server /etc/rc.d/init.d/mysqld
chmod 700 /etc/rc.d/init.d/mysqld 
chkconfig --add mysqld
/etc/rc.d/init.d/mysqld start

groupadd mysql
useradd -g mysql mysql
su - mysql
./configure --prefix=/usr/local/mysql --without-debug --without-bench --enable-thread-safe-client --enable-assembler --enable-profiling --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-charset=latin1 --with-extra-charset=utf8,gbk --with-innodb --with-csv-storage-engine --with-federated-storage-engine --with-mysqld-user=mysql --without-embedded-server --with-server-suffix=-community --with-unix-socket-path=/usr/local/mysql/run/mysql.sock
make -j 8  
make install
 
cd /usr/local/mysql
su - root
cp mysql/share/mysql/my-medium.cnf /etc/my.cnf
chown -R mysql:mysql /etc/my.cnf
vi /etc/my.cnf
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /usr/local/mysql/run/mysql.sock
log-error =/usr/local/mysql/log/alert.log
log_slow_queries = /usr/local/mysql/log/slow.log
 
mkdir log run data tmp
su - mysql
./bin/mysql_install_db --basedir=/usr/local/mysql  --datadir=/usr/local/mysql/data --user=mysql
 
./bin/mysqld_safe &
/usr/local/mysql/bin/mysqladmin -u root -h localhost password '123456'
./share/mysql/mysql.server stop/start
原文地址:https://www.cnblogs.com/slips/p/3585039.html