mysql环境安装步骤

https://dev.mysql.com/downloads/mysql/8.0.html

1、下载mysql的二进制包
wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.42-linux-glibc2.12-x86_64.tar.gz

2、解压
tar -zxvf mysql-5.6.42-linux-glibc2.12-x86_64.tar.gz

3、添加mysql用户和mysql用户组
groupadd mysql
useradd -r -g mysql -s /bin/false mysql

4、安装mysql需要的类库
yum install libaio

5、指定一个目录
cd /usr/local
mkdir mysql

6\源码拷贝到mysql目录
cp -r /home/likang/home/likang/mysql-5.6.42-linux-glibc2.12-x86_64/* /usr/local/mysql

7、使用mysql_install_db安装mysql
scripts/mysql_install_db --user=mysql --defaults-file=/usr/local/mysql/my.cnf

8、启动mysql
/usr/local/mysql/bin/mysqld_safe &

9、杀死进程
killall mysqld

10、修改%用户
update mysql.user set host = ‘%’ where host = ‘localhost’;

11、查看用户表
select user,host from user;

12、刷新数据库权限
flush privileges;

你可能感兴趣的:(mysql)