mysql 8.0 ~ 安装

时间:2022-10-26 23:44:56

1 环境配置
   wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz
   tar -xJf mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz
   mv mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz /usr/local/mysql
   useradd mysql && mkdir -p /data/mysql/data && ln -s /usr/local/mysql/bin/* /usr/bin
2 初始化
  /usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data
  cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
3 启动
  service mysqld start
4 创建用户
  CREATE USER ``@`%` IDENTIFIED by '';
  GRANT ALL ON *.* TO ``@`%` WITH GRANT OPTION;
  ALTER USER ''@'%' IDENTIFIED WITH mysql_native_password BY '';