[转]mysql源代码安装

本文详细介绍MySQL5.1在生产环境下的安装配置步骤,包括权限设置、编译选项及初始化数据库等关键环节。
(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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值