cd /use/local
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz
tar xvJf mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz
重命名文件夹
mv mysql-8.0.20-linux-glibc2.12-x86_64 mysql
创建data文件夹 存储文件
mkdir data
创建用户组以及用户和密码
groupadd mysql
useradd -g mysql mysql
授权用户
chown -R mysql.mysql /usr/local/mysql
cd bin
./mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/ --initialize
pIe1?WqTf&An
cp -a ./support-files/mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
chkconfig --add mysql
service mysql start
service mysql status
ln -s /usr/local/mysql/bin/mysql /usr/bin
mysql mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
flush privileges;
use mysql;
update user set host='%' where user='root';
flush privileges;
你知道的越多,你不知道的越多。