centos7.5 安装mysql8.0的glbc2
安装包:mysql-8.0.23-linux-glibc2.12-x86_64.tar.xz
一、初始化数据库
1、groupadd mysql
2、tar -xf mysql-8.0.23-linux-glibc2.12-x86_64.tar.xz
3、mv mysql-8.0.23-linux-glibc2.12-x86_64 /usr/local/mysql8.0
4、cd /usr/local/mysql8.0
5、mkdir data
5、yum install libaio
6、/bin/mysqld --user=mysql --basedir=/usr/local/mysql8.0/ --datadir=/usr/local/mysql8.0/data/ --initialize (记住生成的密码)
二、修改my.cnf文件
1、vim /etc/my.cnf
[mysqld]
character-set-server=utf8
datadir=/usr/local/mysql8.0/data/
basedir=/usr/local/mysql8.0
socket=/tmp/mysql.sock
pid-file=/var/run/mysql/mysql.pid
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysql/mysql.log
pid-file=/var/run/mysql/mysql.pid
!includedir /etc/my.cnf.d
[mysql]
prompt="mysql [\d]>"
default-character-set=utf
2、mkdir /var/run/mysq
chown -R mysql.mysql /var/run/mysql
3、mkdir /var/log/mysql
chown -R mysql.mysql /var/log/mysqll
4、cp -a ./support-files/mysql.server /etc/init.d/mysqld
5、chmod +x /etc/rc.d/init.d/mysqld
6、chkconfig --add mysqld
7、查看mysqld: chkconfig --list
三、连接数据库
1、systemctl start mysqld
2、export PATH=$PATH:/usr/local/mysql8.0/bin (永久的话修改/etc/profile 别忘了 source /etc/profile)
3、mysql -u root -p"密码"
4、修改密码
alter user root@localhost identified by "xuehaoning";
5、查看用户密码修改情况
select user,host,authentication_string from mysql.user;