ITPub博客

首页 > 数据库 > MySQL > mysql 5.5.12版本源码安装

mysql 5.5.12版本源码安装

MySQL 作者:jhx_zxl 时间:2013-12-31 11:14:00 0 删除 编辑

对mysql的源码包进行编译,选择安装路径

安装之前要安装如下依赖性

yum install -y gcc gcc-c++ make ncurses-devel bison openssl-devel zlib-devel cmake

tar zxvf mysql-5.5.12.tar.gzcd mysql-5.5.12cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql                       //#安装目录-DMYSQL_DATADIR=/usr/local/lnmp/mysql/data                                         //#数据库存放目录-DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock               // #Unix socket 文件路径-DWITH_MYISAM_STORAGE_ENGINE=1                                         //#安装 myisam 存储引擎-DWITH_INNOBASE_STORAGE_ENGINE=1                                  //#安装 innodb 存储引擎-DWITH_ARCHIVE_STORAGE_ENGINE=1                                   //#安装 archive 存储引擎-DWITH_BLACKHOLE_STORAGE_ENGINE=1                            //#安装 blackhole 存储引擎-DWITH_PARTITION_STORAGE_ENGINE=1                               //#安装数据库分区-DENABLED_LOCAL_INFILE=1                                                        //#允许从本地导入数据-DWITH_READLINE=1                                                                           //#快捷键功能-DWITH_SSL=yes                                                                                   //#支持 SSL-DDEFAULT_CHARSET=utf8                                                             //#使用 utf8 字符-DDEFAULT_COLLATION=utf8_general_ci                                       //#校验字符-DEXTRA_CHARSETS=all                                                                 //#安装所有扩展字符集

-DMYSQL_TCP_PORT=3306                                                             //#MySQL 监听端口

make && make install

重新编译时,需要清除旧的对象文件和缓存信息make clean

rm -f CmakeCache.txt

useradd -M -s /sbin/nologin mysql

cd /usr/local/mysql

cp support-files/my-large.cnf    /etc/my.cnf                        //#根据你的主机内存复制 mysql 配置文件

chown -R mysql.mysql .

scripts/mysql_install_db --user=mysql --basedir=/usr/local/lnmp/mysql --datadir=/usr/local/lnmp/mysql/data

chown -R root .chown -R mysql data

cp support-files/mysql.server /etc/init.d/mysqld

service mysqld start

chkconfig mysqld on

vi ~/.bash_profile

PATH=$PATH:/usr/local/mysql/bin

source ~/.bash_profile                                                             //#使之生效

mysql_secure_installation                                                   //#按提示完成 mysql 安全设置,生产环境推荐使用

ln -s /usr/local/mysql/lib /usr/local/mysql/lib64                         //#不然 php 编译的时候找不到 mysql 的库文件

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22506308/viewspace-1109015/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2009-09-09