本文共 3004 字,大约阅读时间需要 10 分钟。
操作系统:Centos 7.4
mysql数据库版本:mysql8.0.11
mysql官方网站:
[bigdata@eric011 software-package]$ rpm -qa|grep mariadbmariadb-libs-5.5.56-2.el7.x86_64[bigdata@eric011 software-package]$ sudo rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
[bigdata@eric011 mysql]$ lsmysql-community-client-8.0.11-1.el7.x86_64.rpm mysql-community-libs-8.0.11-1.el7.x86_64.rpm mysql-community-server-minimal-8.0.11-1.el7.x86_64.rpmmysql-community-common-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.rpmmysql-community-devel-8.0.11-1.el7.x86_64.rpm mysql-community-minimal-debuginfo-8.0.11-1.el7.x86_64.rpmmysql-community-embedded-compat-8.0.11-1.el7.x86_64.rpm mysql-community-server-8.0.11-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpmsudo rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm --(依赖于common)sudo rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm --(依赖于libs)sudo rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm --(依赖于client、common)
注意:这一步可能遇到报错
[bigdata@eric011 mysql]$ sudo rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm 警告:mysql-community-server-8.0.11-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY错误:依赖检测失败: libaio.so.1()(64bit) 被 mysql-community-server-8.0.11-1.el7.x86_64 需要 libaio.so.1(LIBAIO_0.1)(64bit) 被 mysql-community-server-8.0.11-1.el7.x86_64 需要 libaio.so.1(LIBAIO_0.4)(64bit) 被 mysql-community-server-8.0.11-1.el7.x86_64 需要
解决方法:yum install libaio
[bigdata@eric011 mysql]$ sudo mysqld --initialize //该命令会在/var/log/mysqld.log生成随机密码
[bigdata@eric011 lib]$ sudo chown mysql:mysql /var/lib/mysql -R[bigdata@eric011 lib]$ systemctl start mysqld.service
[bigdata@eric011 lib]$ mysql_secure_installation //根据提示修改root用户密码
[bigdata@eric011 lib]$ mysql -uroot -pxxxxmysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 13Server version: 8.0.11 MySQL Community Server - GPLCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.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.01 sec)mysql> exit版权声明:本文为博主原创文章,转载请注明出处!