阿里云ESC CentOS 7.2 安装MySQL 8.0 笔记
2018-07-27 17:04
726 查看
最近公司服务器由某数码迁移至阿里云,之前用的是mysql 5.6在迁移,查了下新版本的MySQL的新特性。发现mysql 8针对InnoDB 引擎做了性能提升,而且号称比5.7快2倍。所以决定直接跳过5.7,升级至8.0。以下是安装过程记录。
- 服务器下载mysql 8.0
[code][root@izbp1es7c0 soft]# wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar
- 解压得到安装文件
[code][root@izbp1es7c0 soft]# tar -xvf mysql-8.0.11-1.el7.x86_64.rpm-bundle.tar mysql-community-libs-8.0.11-1.el7.x86_64.rpm mysql-community-common-8.0.11-1.el7.x86_64.rpm mysql-community-minimal-debuginfo-8.0.11-1.el7.x86_64.rpm mysql-community-devel-8.0.11-1.el7.x86_64.rpm mysql-community-server-8.0.11-1.el7.x86_64.rpm mysql-community-client-8.0.11-1.el7.x86_64.rpm mysql-community-server-minimal-8.0.11-1.el7.x86_64.rpm mysql-community-embedded-compat-8.0.11-1.el7.x86_64.rpm mysql-community-libs-compat-8.0.11-1.el7.x86_64.rpm mysql-community-test-8.0.11-1.el7.x86_64.rpm
- 逐个安装以下文件
[code][root@izbp1es7c0 soft]# rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpm warning: mysql-community-common-8.0.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-common-8.0.11-1.e################################# [100%]
[code][root@izbp1es7c0 soft]# rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm warning: mysql-community-libs-8.0.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-libs-8.0.11-1.el7################################# [100%]
[code][root@izbp1es7c0 soft]# rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm warning: mysql-community-client-8.0.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-client-8.0.11-1.e################################# [100%]
[code][root@izbp1es7c0 soft]# rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm warning: mysql-community-server-8.0.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies: libaio.so.1()(64bit) is needed by mysql-community-server-8.0.11-1.el7.x86_64 libaio.so.1(LIBAIO_0.1)(64bit) is needed by mysql-community-server-8.0.11-1.el7.x86_64 libaio.so.1(LIBAIO_0.4)(64bit) is needed by mysql-community-server-8.0.11-1.el7.x86_64
此时提升错误,需要安装libaio.so
[code][root@izbp1es7c0 soft]# yum install libaio
再次安装 mysql-community-server-8.0.11-1.el7.x86_64.rpm
[code][root@izbp1es7c0bwaldjl2dzb0z soft]# rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm warning: mysql-community-server-8.0.11-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-server-8.0.11-1.e################################# [100%]
至此mysql 安装完成,接下来进行对mysql 进行配置。
- 初始化
[code][root@izbp1es7c0 soft]# mysqld --initialize
此命令会在/var/log/mysqld.log生成一个随机密码,找到这个密码后面要用到
- 修改mysql用户组
[code][root@izbp1es7c0 soft]# chown mysql:mysql /var/lib/mysql -R
- 启动msyql 服务
[code][root@izbp1es7c0 soft]# systemctl start mysqld.service
- 安全设置,修改root 密码,需要用到/var/log/mysqld.log 中生成的随机密码。
[code][root@izbp1es7c0 soft]# mysql_secure_installation
- 根据提示输入密码和新密码,后面的会有一些配置步骤,根据提示和实际需要输入y或者n即可。
[code]Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password:
- 配置完成之后,登录就可以登录Mysql了。
[code][root@izbp1es7c0 soft]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 8.0.11 MySQL Community Server - GPL Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.00 sec) mysql>
相关文章推荐
- 阿里云CentOS-7.2安装mysql
- centos 7.2阿里云镜像rpm安装MySQL5.6
- 阿里云使用笔记-MySQL安装-centos7
- 阿里云centos7.2安装mysql-5.7.20
- 阿里云centos7.2 安装mysql 6.5
- 阿里云Centos7.2安装MySQL
- LNMP= CentOS+Nginx+MySQL+PHP 安装配置及简易建站笔记(持续更新中)
- [转]阿里云CentOS 7.1使用yum安装MySql5.6.24
- 阿里云CentOS 6.5安装Mysql 5.6
- 阿里云centos安装mysql的心痛历程
- 阿里云centos--安装tomcat8.0
- 阿里云CentOS 7.1使用yum安装MySql5.6.24
- 阿里云服务器CentOS 5.7(64位)安装配置LAMP服务器(Apache+PHP5+MySQL)
- Centos 6.2 安装Mysql笔记
- centos 安装mysql 笔记
- CentOS 7.2 上编译安装MySQL 5.7.13
- linux系统(阿里云机CentOs 6.3验证)mysql5.5安装及可能遇到问题
- CentOS-7.2安装mysql 命令记录
- CentOS 6.5 64 安装多个mysql 服务 -阿里云服务器ECS
- centos7.2安装cobbler 并安装系统---学习笔记