最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

MySql 8.0.11安裝配置教程

 更新時(shí)間:2018年05月16日 14:52:26   作者:Leohahah  
這篇文章給大家介紹了MySql 8.0.11安裝配置教程,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,感興趣的朋友一起看看吧

官網(wǎng)地址:https://dev.mysql.com/downloads/mysql/

我這里是RHEL6.5的系統(tǒng),因此選擇RedHat 6 x86,64bit操作系統(tǒng)---下載第一個(gè)RPM Bundle即可--mysql-8.0.11-1.el6.x86_64.rpm-bundle.tar。

目前MySQL8.0.11社區(qū)版提供了多種多樣的安裝方式,但是并未發(fā)現(xiàn)針對(duì)Linux Generic安裝包包含的mysql_secure_installation的安裝說明。

因此這里使用推薦的RPM安裝:

一、mysql-8.0.11-1.el6.x86_64.rpm-bundle.tar解壓后有如下7個(gè)文件:

-rw-r--r-- 1 root root 28987588 Apr 9 01:06 mysql-community-client-8.0.11-1.el6.x86_64.rpm
-rw-r--r-- 1 root root  672184 Apr 9 01:06 mysql-community-common-8.0.11-1.el6.x86_64.rpm
-rw-r--r-- 1 root root  4443296 Apr 9 01:06 mysql-community-devel-8.0.11-1.el6.x86_64.rpm
-rw-r--r-- 1 root root  2579460 Apr 9 01:06 mysql-community-libs-8.0.11-1.el6.x86_64.rpm
-rw-r--r-- 1 root root  1902676 Apr 9 01:06 mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 395918848 Apr 9 01:07 mysql-community-server-8.0.11-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 49092596 Apr 9 01:07 mysql-community-test-8.0.11-1.el6.x86_64.rpm

然后創(chuàng)建mysql用戶:

useradd mysql
passwd mysql

二、安裝順序?yàn)椋海ńㄗh裝之前先把之前的mysql相關(guān)包全部卸載,rpm -e --nodeps <包名>即可)

[root@python ~]# rpm -ivh mysql-community-common-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-common-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...        ########################################### [100%]
  1:mysql-community-common ########################################### [100%]
[root@python ~]# rpm -ivh mysql-community-libs-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-libs-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...        ########################################### [100%]
  1:mysql-community-libs  ########################################### [100%]
[root@python ~]# rpm -ivh mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...        ########################################### [100%]
  file /usr/lib64/mysql/libmysqlclient.so.16.0.0 from install of mysql-community-libs-compat-8.0.11-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-8.0.1.el6_8.x86_64
  file /usr/lib64/mysql/libmysqlclient_r.so.16.0.0 from install of mysql-community-libs-compat-8.0.11-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-8.0.1.el6_8.x86_64
[root@python ~]# rpm -e --nodeps mysql-libs-5.1.73-8.0.1.el6_8.x86_64
[root@python ~]# rpm -ivh mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-libs-compat-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...        ########################################### [100%]
  1:mysql-community-libs-co########################################### [100%]
[root@python ~]# rpm -ivh mysql-community-server-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-server-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
  mysql-community-client(x86-64) >= 8.0.0 is needed by mysql-community-server-8.0.11-1.el6.x86_64
[root@python ~]# rpm -ivh mysql-community-client-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-client-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...        ########################################### [100%]
  1:mysql-community-client ########################################### [100%]
[root@python ~]# rpm -ivh mysql-community-server-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-server-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...        ########################################### [100%]
  1:mysql-community-server ########################################### [100%]
[root@python ~]# rpm -ivh mysql-community-devel-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-devel-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...        ########################################### [100%]
  1:mysql-community-devel ########################################### [100%]
^[[A[root@python ~]# rpm -ivh mysql-community-test-8.0.11-1.el6.x86_64.rpm
warning: mysql-community-test-8.0.11-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
  perl(JSON) is needed by mysql-community-test-8.0.11-1.el6.x86_64
--懶的去裝perl了,因此測(cè)試套件就不裝了。

三、安裝完畢后相關(guān)信息如下:

[root@python ~]# mysql -V
mysql Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)
[root@python ~]# ll /etc/init.d/mysqld
-rwxr-xr-x 1 root root 7166 Apr 8 16:21 /etc/init.d/mysqld
[root@python ~]# ll /etc/my.cnf --配置文件位置
-rw-r--r-- 1 root root 1188 Apr 8 16:21 /etc/my.cnf

默認(rèn)的datadir是在/var/lib/mysql/,可以通過修改my.cnf修改,啟動(dòng)命令如下:

[root@python ~]# service mysqld start
Initializing MySQL database:                [ OK ]
Starting mysqld:  
[ OK ]

四、發(fā)現(xiàn)沒密碼不能登錄,于是添加skip-grant-tables到my.cnf,重啟進(jìn)去重置密碼

mysql> alter user root@'localhost' identified by 'mysql';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> exit
Bye

居然不能改。。。于是:

mysql> delete from mysql.user where user='root';
Query OK, 1 row affected (0.10 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> create user root@'localhost' identified by 'mysql';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

還是不能改,查看密碼復(fù)雜度要求:

mysql> show variables like '%pass%';
+----------------------------------------------+-----------------+
| Variable_name                | Value      |
+----------------------------------------------+-----------------+
| caching_sha2_password_auto_generate_rsa_keys | ON       |
| caching_sha2_password_private_key_path    | private_key.pem |
| caching_sha2_password_public_key_path    | public_key.pem |
| default_password_lifetime          | 0        |
| disconnect_on_expired_password        | ON       |
| mysql_native_password_proxy_users      | OFF       |
| password_history               | 0        |
| password_reuse_interval           | 0        |
| report_password               |         |
| sha256_password_auto_generate_rsa_keys    | ON       |
| sha256_password_private_key_path       | private_key.pem |
| sha256_password_proxy_users         | OFF       |
| sha256_password_public_key_path       | public_key.pem |
| validate_password.check_user_name      | ON       |
| validate_password.dictionary_file      |         |
| validate_password.length           | 8        |
| validate_password.mixed_case_count      | 1        |
| validate_password.number_count        | 1        |
| validate_password.policy           | MEDIUM     |
| validate_password.special_char_count     | 1        |
+----------------------------------------------+-----------------+

查看官網(wǎng)https://dev.mysql.com/doc/refman/8.0/en/validate-password-options-variables.html#sysvar_validate_password.policy

發(fā)現(xiàn)此值有3個(gè),如下所示:

于是設(shè)置為0,然后將validate_password.length設(shè)置為4,表示最少需要4字符。之所以設(shè)置為4是因?yàn)檫@個(gè)參數(shù)的值不能小于如下公式的計(jì)算結(jié)果:

validate_password.number_count
+ validate_password.special_char_count
+ (2 * validate_password.mixed_case_count)

于是繼續(xù)創(chuàng)建用戶,MySQL8.0取消了直接grant創(chuàng)建用戶的語法,只能先create user再grant,因此創(chuàng)建root如下:

mysql> create user root@'localhost' identified by 'mysql';
ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> create user root@'localhost' identified by 'mysql';
ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'localhost'

尼瑪...什么玩意兒?

于是去逛了一圈stackoverflow,都說這是一個(gè)BUG,于是操作如下:

mysql> drop user root@'localhost';  --是的沒錯(cuò),雖然沒有root@'localhost'用戶,但你還是要?jiǎng)h一遍。
Query OK, 0 rows affected (0.05 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> create user root@'localhost' identified by 'mysql';
Query OK, 0 rows affected (0.03 sec)
mysql> grant all on *.* to root@'localhost' with grant option;
Query OK, 0 rows affected (0.03 sec)

終于改完密碼了...去掉參數(shù)文件的skip-grant-tables參數(shù),service mysqld restart重啟服務(wù)。

五、終于設(shè)置好密碼了,建一個(gè)測(cè)試用戶leo,然后嘗試遠(yuǎn)程連接下吧:

$ mysql -uleo -pmysql -h192.168.1.193
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

我這5.7的mysql工具都連不上,這就尷尬了,查看認(rèn)證相關(guān)參數(shù):

mysql> show variables like '%auth%';
+-------------------------------+-----------------------+
| Variable_name         | Value         |
+-------------------------------+-----------------------+
| default_authentication_plugin | caching_sha2_password |
+-------------------------------+-----------------------+
1 row in set (0.02 sec)

查看官網(wǎng)發(fā)現(xiàn)此值的取值如下:

官網(wǎng)還說此值影響create user不顯式指定auth plugin時(shí)密碼的默認(rèn)加密算法,臥槽...那豈不是說我之前創(chuàng)建的leo用戶使用的是默認(rèn)的caching_sha2_password認(rèn)證,查看一下:

mysql> select user,host,plugin from mysql.user;
+------------------+-----------+-----------------------+
| user       | host   | plugin        |
+------------------+-----------+-----------------------+
| leo       | %     | caching_sha2_password |
| mysql.infoschema | localhost | mysql_native_password |
| mysql.session  | localhost | mysql_native_password |
| mysql.sys    | localhost | mysql_native_password |
| root       | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+

完了,全TM完了......

顯然不能直接update plugin,因?yàn)檫@可能導(dǎo)致加密的密碼無法被正確解密,你所有的密碼都會(huì)變異,因此除root@'localhost'外全部刪掉重建。

首先需要在my.cnf里添加:default_authentication_plugin=mysql_native_password,然后service mysqld restart重啟服務(wù):

mysql> drop user leo;
Query OK, 0 rows affected (0.10 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> create user leo identified by 'mysql';
Query OK, 0 rows affected (0.02 sec)
mysql> grant all on *.* to leo;
Query OK, 0 rows affected (0.08 sec)

$mysql -V
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using EditLine wrapper
$ mysql -uleo -pmysql -h192.168.1.193
mysql: [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 16
Server version: 8.0.11 MySQL Community Server - GPL
Copyright (c) 2000, 2017, 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>

至此遠(yuǎn)程連接正常。

總結(jié)

以上所述是小編給大家介紹的MySql 8.0.11安裝配置教程,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

  • 學(xué)習(xí)mysql?如何行轉(zhuǎn)列與列傳行

    學(xué)習(xí)mysql?如何行轉(zhuǎn)列與列傳行

    這篇文章主要介紹了mysql行轉(zhuǎn)列與列傳行的使用方法,幫助大家更好的理解和學(xué)習(xí)MySQL的使用,語句不難,但有一定的知識(shí)參考價(jià)值,需要的朋友可以參考一下,希望給你的學(xué)習(xí)帶來幫助
    2022-02-02
  • centos7環(huán)境下創(chuàng)建mysql5.6多實(shí)例的方法詳解

    centos7環(huán)境下創(chuàng)建mysql5.6多實(shí)例的方法詳解

    這篇文章主要介紹了centos7環(huán)境下創(chuàng)建mysql5.6多實(shí)例的方法,詳細(xì)分析了centos7創(chuàng)建mysql5.6多實(shí)例的具體步驟、實(shí)現(xiàn)方法與操作注意事項(xiàng),需要的朋友可以參考下
    2020-02-02
  • MySQL慢查日志的開啟方式與存儲(chǔ)格式詳析

    MySQL慢查日志的開啟方式與存儲(chǔ)格式詳析

    這篇文章主要給大家介紹了關(guān)于MySQL慢查日志的開啟方式與存儲(chǔ)格式的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用MySQL具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-08-08
  • LEFT JOIN條件在on后面和在where后面的區(qū)別及說明

    LEFT JOIN條件在on后面和在where后面的區(qū)別及說明

    這篇文章主要介紹了LEFT JOIN條件在on后面和在where后面的區(qū)別及說明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-09-09
  • mysql中的Load data的使用方法

    mysql中的Load data的使用方法

    mysql中的Load data的使用方法,需學(xué)習(xí)Load data使用的朋友可以參考下
    2013-01-01
  • Mysql SQL服務(wù)器模式介紹

    Mysql SQL服務(wù)器模式介紹

    這篇文章主要介紹了Mysql SQL服務(wù)器模式介紹,需要的朋友可以參考下MySQL服務(wù)器可以以不同的SQL模式來操作,并且可以為不同客戶端應(yīng)用不同模式,這樣每個(gè)應(yīng)用程序可以根據(jù)自己的需求來定制服務(wù)器的操作模式,需要的朋友可以參考下
    2014-12-12
  • MySQL表的CURD使用

    MySQL表的CURD使用

    文章主要介紹了MySQL數(shù)據(jù)庫操作的基本方法,包括創(chuàng)建表、插入數(shù)據(jù)、查詢數(shù)據(jù)、更新數(shù)據(jù)和刪除數(shù)據(jù)等,涵蓋了表結(jié)構(gòu)設(shè)計(jì)、數(shù)據(jù)插入、查詢條件、排序、分頁、更新和刪除操作,以及聚合函數(shù)和GROUP BY子句的使用
    2025-02-02
  • 史上最簡(jiǎn)單的MySQL數(shù)據(jù)備份與還原教程(中)(三十六)

    史上最簡(jiǎn)單的MySQL數(shù)據(jù)備份與還原教程(中)(三十六)

    這篇文章主要為大家詳細(xì)介紹了史上最簡(jiǎn)單的MySQL數(shù)據(jù)備份與還原教程中篇,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-10-10
  • MySQL 5.6 如何更改安全的處理密碼探討

    MySQL 5.6 如何更改安全的處理密碼探討

    MySQL 5.6將會(huì)自動(dòng)的在日志中隱藏密碼信息,接下來為你詳細(xì)介紹下MySQL 5.6 如何更安全的處理密碼,感興趣的你可以參考下哈,希望可以幫助到你
    2013-03-03
  • 使用keras做SQL注入攻擊的判斷(實(shí)例講解)

    使用keras做SQL注入攻擊的判斷(實(shí)例講解)

    下面小編就為大家分享一篇使用keras做SQL注入攻擊的判斷(實(shí)例講解),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2017-12-12

最新評(píng)論

苍梧县| 海晏县| 莱阳市| 习水县| 海晏县| 象州县| 舞钢市| 渑池县| 申扎县| 肃北| 商洛市| 射洪县| 定安县| 渑池县| 定边县| 布尔津县| 本溪| 长宁县| 盐边县| 锦州市| 吉首市| 黔西| 大田县| 佛冈县| 岚皋县| 彭山县| 蓝山县| 龙门县| 福贡县| 云龙县| 旬邑县| 疏附县| 广河县| 镇宁| 邹城市| 扎赉特旗| 泸西县| 泗洪县| 通辽市| 沁水县| 双流县|