您的位置:首页 > 数据库 > MySQL

mysql  源码 安装

2013-11-28 12:47 399 查看
编译 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 

#cp
share/mysql/mysql.server /etc/init.d/mysqld

#chmod
755  /etc/init.d/mysqld 

安装数据库文件 
#
./bin/mysqld_install_db 
# chown -R
root:root .  //root:root 可以换成已存在的用户如已有用户lxc,
可以写成chown -R lxc:lxc .
#
./bin/mysqld_safe --user=root &

运行:mysqld

#/etc/init.d/mysqld start

改root密码

#mysqladmin -u root password
'####' //####为那你的密码
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: