centos5.6 源码安装 mysql5.5.

引用

我的操作系统为64位Centos5.6纯净版.


引用

说来很搞笑,我在mysql官网上找了好久才找到了怎么下载mysql源码包
http://www.mysql.com/downloads/mysql/5.5.html
一开始我在 Oracle & Red Had Linux 4 & 5 这里面找,很久没找到
然后我在 Linux - Generic 中找,也没找到
郁闷之中偶然发现最下面有个 Source Code ..
.O(∩_∩)O哈哈~ 很白痴吧 幸福之中带着一丝郁闷^_^


  • 安装cmake工具,编译mysql源代码用
  • yum install ncurses-devel,没有这个,cmake的时候会报错
  • yum install bison, 没有这个,cmake的时候会有一个警告
  • http://dev.mysql.com/doc/refman/5.5/en/installing-source-distribution.html
  • scripts/mysql_install_db --user=mysql 出错,下面一句可以解决
  • ./scripts/mysql_install_db --user=mysql --collation-server=utf8_general_ci


  • /usr/local/mysql/bin/mysqld_safe --user=mysql &
  • bin/mysql
  • delete from mysql.user where host!='localhost';
  • delete from mysql.user where user='';
  • flush privileges;
  • set password for 'root'@'localhost'=password('123456');
  • exit;
  • bin/mysql -u root -h localhost -p
  • /usr/local/mysql/bin/mysqladmin -u root -p shutdown


  • echo "/usr/local/apache2/bin/apachectl start" >> /etc/rc.local
  • echo "/usr/local/mysql/bin/mysqld_safe --user=mysql &" >> /etc/rc.local


引用

编译mysql时的一些可选参数
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/data/mysqld.sock \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \#这句原来没有,但是我觉得我应该写上
-DEXTRA_CHARSETS=all \
-DMYSQL_TCP_PORT=3306 \
-DWITH_DEBUG=0

你可能感兴趣的:(mysql,centos)