#groupadd mysql
#useradd –g mysql mysql
#tar zxvf mysql*.tar.gz
#cd mysql*/
#CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \
-felide-constructors -fno- exceptions -fno-rtti" ./configure \
--prefix=/usr/local/mysql --with-charset=utf8 \
--with-collation=utf8_general_ci \
--with-extra-charsets=all \
--with-pthread \
--enable-shared \
--enable-static \
--enable-thread-safe-client \
--enable-assembler \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static
make
make install
make clean
#cp support-files/my-medium.cnf /etc/my.cnf //拷贝my-medium.cnf文件到/etc/目录下并重命名为my.cnf
#vim my.cnf
找到log-bin=mysql-bin,加注释
#log-bin=mysql-bin
#cd /usr/local/mysql //进入mysql目录
#bin/mysql_install_db --user=mysql /需要重启服务
#chown -R root 。//将文件的所有属性改为root用户
#chown -R mysql /usr/local/mysql/var //将数据目录的所有属性改为mysql用户
#chgrp -R mysql 。//将组属性改为mysql组
#bin/mysqld_safe --user=mysql & //启动mysql
附:网上查的
用编辑器打开/etc/rc.local文件,在exit 0前面加上,/usr/local/mysql/bin/mysqld_safe –user=mysql &
重新启动,输入mysql,如果能进入则说明启动成功!