1、前言
框框博客在線報時:2018-11-07 19:31:06
當前MySQL最新版本:8.0.13 (聽說比5.7快2倍)
官方之前表示:MySQL 8.0 正式版 8.0.11 已發布,MySQL 8 要比 MySQL 5.7 快 2 倍,還帶來了大量的改進和更快的性能!
開源中國介紹文檔:MySQL 8.0 正式版 8.0.11 發布:比 MySQL 5.7 快 2 倍
2、開始
1、我的設備介紹
服務器:2018-11-06 新購置 的 阿里雲CentOS7 服務器;
系統鏡像采用阿里雲自家默認的CentOS7鏡像;
2、准備
首先你得登陸到自己的服務器。
3、獲取MySQL最新版 rpm包 集合 的下載地址(獲取最新版MySQL下載地址方法)
MySQL下載頁面:https://dev.mysql.com/downloads/mysql/8.0.html

我是CentOS系統 所以 我選擇了 Red Hat。

第一個為一個 tar歸檔包,里面是 后面所有 rpm 的打包(仔細看后面都是rpm 結尾的)
點擊右邊Download

這就是最新版 MySQL資源鏈接 :https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar
4、wget下載到服務器

我下載到 /tmp 目錄下了。回車開始下載。

5、解壓MySQL歸檔包
tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar

6、開始安裝
1、當中會遇到的問題
1、mysql-community-libs .... 這兩個包安裝不上。
原因:我們在Linux系統中,如果要使用關系型數據庫的話,基本都是用的mysql。
而且以往7以下版本的centos系統都是默認的集成有mysql。
然而對於現在最新的centos7系統來說,已經不支持mysql數據庫,它默認內部集成了mariaDB。
如果我們想要使用 mysql 的話,就要先將原來的mariaDB卸載掉,不然會引起沖突。
解決方案:卸載maridb (rpm 不會卸載軟件的 自行百度)
查看安裝的 mariaDB:rpm -qa | grep mariadb
卸載:rpm -e ***(*** 為軟件名)
如果不能卸載則即可:rpm -e --nodeps ***(*** 為軟件名)
2、缺少依賴包 libaio
libaio.so.1()(64bit) is needed by MySQL-server 問題
直接實用yum包管理工具安裝即可:yum install libaio
2、使用 rpm -vih XXXXXX(XXXXXX 為 rpm包全名)
按照依賴順序依次安裝(能安裝的安裝就行,像test這個不方便安裝就算了。)
mysql-community-common-8.0.13-1.el7.x86_64
mysql-community-libs-8.0.13-1.el7.x86_64
mysql-community-libs-compat-8.0.13-1.el7.x86_64
mysql-community-client-8.0.13-1.el7.x86_64
mysql-community-embedded-compat-8.0.13-1.el7.x86_64
mysql-community-server-8.0.13-1.el7.x86_64
7、啟動MySQL服務,並設置root密碼
1、啟動mysql服務
service mysqld restart
2、初次安裝mysql,root賬戶沒有密碼。
[root@izuf6 tmp]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 8.0.13 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 | | test | +--------------------+ rows in set (0.01 sec) mysql>
設置密碼:
mysql> set password for 'root'@'localhost' =password('password'); Query OK, 0 rows affected (0.00 sec) mysql>
不需要重啟數據庫即可生效。
3、使用樣例

6、MySQL一些騷炒作
-- 登錄sys數據庫 mysql -u root -proot sys -- 查看所有的數據庫 select database() -- 查看數據庫 show databases; -- 模糊查詢包含y的數據庫 show databases like '%y%'; -- 查看表 show tables; --模糊查詢包含user的表 show tables like '%user%'; -- 查看列, 查看user表信息 desc user;
-- 查看username用戶被賦予的權限
show grants for username;
3、后言
1、安裝過程中有兩個依賴需要注意的地方,之后就很好做了。
途中還學習到了,Mysql5、8的密碼重置問題,有點意思。
4、修改時間記錄
2018-11-07 20:28:05 -> 2018-11-09 16:16:18 -> 2018-11-09 20:32:42
