cd mysql-5.1.35
groupadd mysql
useradd -g mysql mysql
./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=utf8,gb2312,big5 --enable-thread-safe-client
make install
cp /home/soft/my.cnf /etc/my.cnf
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
scripts/mysql_install_db --user=mysql
chkconfig --add mysqld
chkconfig --level 123456 mysqld on
安装完以后要初始化数据库
cd /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql
/usr/local/mysql/bin/mysqld_safe --user=root&
/home/soft/mysql-
chown -R mysql var
chgrp -R mysql .
启动mysql
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld start
ss -ant | grep 3306
vi /etc/profile
增加
export PATH=$PATH:/usr/local/mysql/bin
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
ldconfig