mysql  源码 安装

来源:互联网 发布:淘宝卖家生意参谋 编辑:程序博客网 时间:2024/05/29 09:06

编译 MySQL5.0 
# ./configure --prefix=/usr/local/mysql--localstatedir=/usr/local/mysql/data --enable-thread-safe-client--enable-local-infile --enable-assembler--enable-community-features --enable-profiling--with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static--with-charset=utf8 --with-collation=utf8_general_ci--with-extra-charsets=all --with-mysqld-user=mysql--without-embedded-server  --with-big-tables--with-server-suffix=-community--with-unix-socket-path=/usr/local/mysql/etc/mysql.sock--without-debug --without-man --without-docs --without-bench--with-csv-storage-engine --with-blackhole-storage-engine--with-federated-storage-engine

编译完成后的配置(其它版本的操作类似) 
# cd /usr/local/mysql 
# cp share/mysql/my-medium.cnf /etc/my.cnf 
# mkdir etc 

#cpshare/mysql/mysql.server /etc/init.d/mysqld

#chmod755  /etc/init.d/mysqld 
安装数据库文件 

#./bin/mysqld_install_db 
# chown -Rroot:root .  //root:root 可以换成已存在的用户如已有用户lxc,可以写成chown -R lxc:lxc .
#./bin/mysqld_safe --user=root &

运行:mysqld

#/etc/init.d/mysqld start

改root密码

#mysqladmin -u root password'####' //####为那你的密码