mysql编译安装步骤
时间:2008-05-20 来源:cocolala
最简单的安装步骤:
o
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
如果不用安装包带的my.cnf, 则可以从一个已经安装好的mysql机器上cp一份my.cnf到/etc, 作必需的修改.
比如数据目录如果是/usr/local/mysql/data,由需要修改datadir,另外还有bind-address及与innodb相关的项等等
o
如果编译器较新,下面据称是较优的编译选项, 具体参见manual
CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
-fno-exceptions -fno-rtti" ./configure \
--prefix=/usr/local/mysql --enable-assembler \
--with-mysqld-ldflags=-all-static
http://doc.mysql.cn/mysql5/refman-5.1-zh.html-chapter/installing.html#installing-source
相关阅读 更多 +