二进制包安装MysQL

时间:2022-04-28 21:01:34

                    二进制包安装MysQL 

 下载最新的 mysql-5.5.30-linux2.6-x86_64.tar.gz

tar zxvf   mysql-5.5.30-linux2.6-x86_64.tar.gz  -C /usr/local

cd /usr/local

ln -s mysql-5.5.30-linux2.6-x86_64/       mysql

添加用户组
$groupadd mysql
给用户组添加用户
$useradd -r -g mysql mysql
scripts/mysql_install_db --user=mysql
chown -R root.mysql /usr/local/mysql
chown -R mysql.mysql /usr/local/mysql/data
cp support-files/mysql.server /etc/init.d/mysqld
cp support-files/my-medium.cnf /etc/my.cnf
chmod u+x /etc/init.d/mysqld

将mysql服务加入环境变量

vi /etc/profile

PATH=$PATH:/usr/local/mysql/bin

export PATH

source /etc/profile

 

本文出自 “Focus on the database” 博客,请务必保留此出处http://lgdvsehome.blog.51cto.com/3360656/1178864