日常随笔

CentOS 6.6 MySQL 8.0详细安装步骤

2018-08-01  本文已影响58人  Surpassme
[root@localhost ] # mysqldump -h localhost -u root -proot --databases Surpass --routines > /home/SQLBackup/Surpassme_20180801.sql
[root@localhost ] # du -sh /home/SQLBackup/Surpassme_20180801.sql
200M Surpassme_20180801.sql
[root@localhost ] # rpm -qa | grep -i mysql
  MySQL-client-5.6.38-1.el6.x86_64
  MySQL-server-5.6.38-1.el6.x86_64
  MySQL-devel-5.6.38-1.el6.x86_64
[root@localhost ] # service mysql stop
[root@localhost ] # yum -y remove MySQL-*
[root@localhost ] # find / -name mysql
/var/lib/mysql
/usr/lib64/mysql
[root@localhost ] # mv /var/lib/mysql /var/lib/mysql20180801
[root@localhost ] # rm -rf /usr/lib64/mysql
[root@localhost ] # mv /etc/my.cnf /etc/my.cnf.bak20180801
[root@localhost ] # mkdir -p /home/MySQL8.0
[root@localhost ] # tar -xf mysql-8.0.11-1.el6.x86_x64.rpm-bundle.tar -C /home/MySQL8.0
[root@localhost ] # rpm -ivh mysql-community-{server,client,common,libs}-8.0.11-1.el6.x86_64.rpm
[root@localhost ] # vim /etc/my.cnf

这一步非常重要,在MySQL 8.0中有部分配置参数只能在初始化数据库前进行配置和更改,不支持初始化之后再更改,如忽略大小写配置就是如此,lower_case_table_names

[root@localhost ] # mysqld --initialize
[root@localhost ] # chown -R mysql:mysql /var/lib/mysql
[root@localhost ] # service mysqld start
[root@localhost ] # grep 'temporary password' /var/log/mysqld.log
[root@localhost ] #  mysql -h localhost -u root -p
[root@localhost ] # mysql -h localhost -u root -p < /home/SQLBackup/Surpassme_20180801.sql
上一篇下一篇

猜你喜欢

热点阅读