MySQL 8 测试

栏目: 数据库 · 发布时间: 5年前

内容简介:说 MySQL 8 的性能比 MySQL 5.7 性能提高了 2 倍,又,自己很久没用过 MySQL 了,于是想着试试首先需要解决 CentOS 6 上安装的问题,看到这个文章,这里介绍的是通过 yum 源的方式来安装的,但是这个方式不太行,内网的网络限制了,于是只能走预先下载 rpm 包的方式来了

MySQL 8 的性能比 MySQL 5.7 性能提高了 2 倍,又,自己很久没用过 MySQL 了,于是想着试试

首先需要解决 CentOS 6 上安装的问题,看到这个文章, https://www.tecmint.com/instal…

这里介绍的是通过 yum 源的方式来安装的,但是这个方式不太行,内网的网络限制了,于是只能走预先下载 rpm 包的方式来了

一共需要这几个包:

mysql-community-server-8.0.13-1.el6.x86_64.rpm

mysql-community-client-8.0.13-1.el6.x86_64.rpm

mysql-community-common-8.0.13-1.el6.x86_64.rpm

mysql-community-libs-8.0.13-1.el6.x86_64.rpm

通过 rpm -ivh 来安装

rpm -ivh mysql-community-common-8.0.13-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.13-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-8.0.13-1.el6.x86_64.rpm

安装到 client 的时候报错,说

Preparing...                ########################################### [100%]
	file /usr/bin/mysql from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/bin/mysqladmin from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/bin/mysqlbinlog from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/bin/mysqlcheck from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/bin/mysqldump from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/bin/mysqlimport from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/bin/mysqlshow from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/bin/mysqlslap from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysql.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysqladmin.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysqldump.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysqlshow.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysqlslap.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysqlbinlog.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-server-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysqlcheck.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-server-5.1.71-1.el6.x86_64
	file /usr/share/man/man1/mysqlimport.1.gz from install of mysql-community-client-8.0.13-1.el6.x86_64 conflicts with file from package mysql-server-5.1.71-1.el6.x86_64

感觉是要卸载掉机上旧的 MySQL 版本才行

yum -y remove mysql-5.1.71*
yum -y remove mysql-server-5.1.71*
yum -y remove mysql-libs-5.1.71*

又,每次执行 yum 总是试着连 aliyun 的源,但是又 Timeout,于是得把这个源干掉才行

[root@localhost etc]# mkdir yum-bak
[root@localhost etc]# mv yum.repos.d/* yum-bak/

最后安装 server

rpm -ivh mysql-community-server-8.0.13-1.el6.x86_64.rpm

装好了,就得启动起来

[root@localhost ~]# service mysqld start
Initializing MySQL database:                               [FAILED]

发现挂了。。。但是再试一次,就好了。。

[root@localhost ~]# service mysqld start
Starting mysqld:                                           [  OK  ]

然后要看下自动生成的临时密码

[root@localhost ~]# grep 'temporary password' /var/log/mysqld.log
2018-12-28T12:51:28.990464Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: drC&dCOp0tep

然后用 mysql_secure_installation 来进行一些安全的初始化,在这个过程中会要求你重置自己的 MySQL 密码

最终,终于能连上了

[root@localhost ~]#  mysql -u root -p
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.13    |
+-----------+
1 row in set (0.00 sec)

然后新建用户

CREATE USER 'testuser'@'%' IDENTIFIED BY '123456@Test';
GRANT ALL ON *.* TO 'testuser'@'%';

但是连接的时候报错,需要重新指定一个简单的密码加密方式:

ALTER USER 'testuser'@'%' IDENTIFIED WITH mysql_native_password BY '123456@Test';

压测使用的是 sysbench-1.0.9-2.el6.x86_64.rpm


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

代码

代码

劳伦斯・莱斯格 / 李旭 / 中信出版社 / 2004-10-1 / 30.00元

劳伦斯·莱斯格的著作《代码》 问世便震动了学界和业界,被人称为“也许是迄今为止互联网领域最重要的书籍”,也被一些学者称为“网络空间法律的圣经”。 《代码》挑战了早期人们对互联网的认识,即技术已经创造了一个自由的环境,因而网络空间无法被规制——也就是说,网络的特性使它押脱了政府的控制。莱斯格提出,事实恰恰相反。 代码的存在证明,网络并不是本制拷贝 ,不可规制的,它并没有什......一起来看看 《代码》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具