1. 解压安装包,后改文件夹名为mysql
tar -xvzf mysql-5.6.38-linux-glibc2.12-i686.tar.gz
2.进入mysql目录,添加系统mysql组和mysql用户,修改目录权限
groupadd mysql useradd -r -g mysql mysql
chown -R mysql:mysql ./
3.创建配置文件所配置的文件夹并修改权限(文件夹即可)
datadir socket log-error(需要创建文件) pid-file
4.安装必要模块:
yum -y install numactl.x86_64 yum -y install autoconf yum install -y libaio
./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
5.修改权限
chown -R root:root .
chown -R mysql:mysql data
6.添加并启动服务
cp support-files/mysql.server /etc/init.d/mysql
service mysql start
7.创建软连接
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
ln -s /usr/local/mysql/bin/mysql /usr/bin
8.修改初始密码
./bin/mysqladmin -u root password '123456'
9.开启远程连接权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;