centos 5.9安装mysql 5.5.31(二)
ost scripts]# ./
mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
cp配置文件
cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf
启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
修改环境变量
[root@localhost ~]# vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin/
export PATH
unset USERNAME
如上面类似添加mysql路径
总结 centos 下安装很方便,因为yum已经给安装上了,缺依赖的时候会自动下载安装。