mysql 安装

1. 下载

wegt https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz

2. 解压

3. 建用户

groupadd mysql

useradd -g mysql mysql

 

4. 安装

cp -r mysql-5.7.20-linux-glibc2.12-x86_64 /usr/local/mysql

cd /usr/local/mysql

 chown -R mysql:mysql ./
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql  --datadir=/usr/local/mysql/data

cp support-files/mysql.server /etc/init.d/mysqld

  

 vim /etc/init.d/mysqld

basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/mysql

  

5. 启动

service mysqld start

posted @ 2017-12-26 19:11  Jenkin.K  阅读(143)  评论(0编辑  收藏  举报