1. 下载安装包:
2. 解压
tar vxzf mysql-5.5.40-linux2.6-x86_64.tar.gz
#cd mysql-5.5.40-linux2.6-x86_64
mv mysql-5.5.40-linux2.6-x86_64 /usr/local/webserver/
cd /usr/local/webserver
mv mysql-5.5.40-linux2.6-x86_64 mysql
3. 修改 mysql.server 中的参数
basedir=/usr/local/webserver/mysql
datadir=/usr/local/webserver/mysql/data
4. 安装
cd scripts
./mysql_install_db --user=mysql --basedir=/usr/local/webserver/mysql --datadir=/usr/local/webserver/mysql/data &
5. 配置启动脚本
cd /usr/local/webserver/mysql
cp support-files/mysql.server /etc/init.d/mysql
6. 启动
service mysql start
7. 配置环境变量
export PATH="/usr/local/webserver/mysql/bin:$PATH"
(关闭文件,运行下面的命令,让配置立即生效)
source /etc/profile