跳转到主要内容

centos 5.5 mysql源码编译安装

yum install gcc gcc-c++ ncurses-devel

CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \

-felide-constructors -fno-exceptions -fno-rtti" ./configure \

--prefix=/opt/mysql \

--enable-assembler \

--with-charset=utf8 \

--with-collation=utf8_general_ci \

--with-extra-charsets=gbk,gb2312,binary \

--enable-thread-safe-client \

--with-pthread \

--with-mysqld-ldflags=-all-static \

--with-client-ldflags=-all-static
 当执行./configure后出现如下报错:
 /bin/rm: cannot remove `libtoolT': No such file or directory
 可以忽略,或先执行:
 autoreconf --force --install
make
make installl
useradd -r -s /sbin/nologin -d /opt/mysql/var mysql
/opt/mysql/bin/mysql_install_db --user=mysql
cp /opt/mysql/share/mysql/my-medium.cnf /etc/my.cnf
cp /opt/mysql/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 35 mysqld on
chkconfig --list mysqld
cd /opt/mysql/libexec
cp mysqld mysqld.old                                 备份文件

strip mysqld                                         删除调试符号,生成的二进制可以快4%

service mysqld start
cp /opt/mysql/bin/mysql /usr/bin 复制一份去命令路径,以下脚本要用到mysql

/opt/mysql/bin/mysql_secure_installation
文章分类 :  
文章标签 :  

添加新评论

此字段内容将保密,不会被其他人看见。

纯文本

  • 不允许使用HTML标签。
  • 自动断行和分段。