濮阳杆衣贸易有限公司

主頁 > 知識庫 > CentOS 7下使用RPM安裝mysql5.7.13

CentOS 7下使用RPM安裝mysql5.7.13

熱門標(biāo)簽:如何選擇優(yōu)質(zhì)的外呼系統(tǒng) 谷歌地圖標(biāo)注位置圖解 東莞外呼企業(yè)管理系統(tǒng) 地圖簡圖標(biāo)注 手機外呼系統(tǒng)違法嗎 南通電銷外呼系統(tǒng)哪家強 清遠申請400電話 桂林云電銷機器人收費 沈陽智能外呼系統(tǒng)供應(yīng)商

0、環(huán)境

本文操作系統(tǒng): CentOS 7.2.1511 x86_64
MySQL 版本: 5.7.13

1、卸載系統(tǒng)自帶的 mariadb-lib

[root@centos-linux ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.44-2.el7.centos.x86_64
[root@centos-linux ~]# rpm -e mariadb-libs-5.5.44-2.el7.centos.x86_64 --nodeps

2、下載 rpm 安裝包

去官網(wǎng)找到最新的 rpm 集合包?,F(xiàn)在最新的是 mysql-5.7.13-1.el7.x86_64.rpm-bundle.tar
復(fù)制其下載地址,在服務(wù)器下載 (或者本地下載了上傳至服務(wù)器)。

復(fù)制代碼 代碼如下:
[root@centos-linux ~]# wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13-1.el7.x86_64.rpm-bundle.tar

然后解壓

[root@centos-linux ~]# ls
mysql-5.7.13-1.el7.x86_64.rpm-bundle.tar
[root@centos-linux ~]# tar xvf mysql-5.7.13-1.el7.x86_64.rpm-bundle.tar
mysql-community-test-5.7.13-1.el7.x86_64.rpm
mysql-community-embedded-5.7.13-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.13-1.el7.x86_64.rpm
mysql-community-server-5.7.13-1.el7.x86_64.rpm
mysql-community-client-5.7.13-1.el7.x86_64.rpm
mysql-community-common-5.7.13-1.el7.x86_64.rpm
mysql-community-server-minimal-5.7.13-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.13-1.el7.x86_64.rpm
mysql-community-devel-5.7.13-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.13-1.el7.x86_64.rpm
mysql-community-libs-5.7.13-1.el7.x86_64.rpm
mysql-community-minimal-debuginfo-5.7.13-1.el7.x86_64.rpm

3、安裝
依次執(zhí)行(幾個包有依賴關(guān)系,所以執(zhí)行有先后)下面命令安裝

[root@centos-linux ~]# rpm -ivh mysql-community-common-5.7.13-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh mysql-community-libs-5.7.13-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh mysql-community-client-5.7.13-1.el7.x86_64.rpm
[root@centos-linux ~]# rpm -ivh mysql-community-server-5.7.13-1.el7.x86_64.rpm

4、數(shù)據(jù)庫初始化

在 *nix 系統(tǒng)中,為了保證數(shù)據(jù)庫目錄為與文件的所有者為 mysql 登陸用戶,如果你是以 root 身份運行 mysql 服務(wù),需要執(zhí)行下面的命令初始化
mysqld --initialize --user=mysql
如果是以 mysql 身份運行,則可以去掉 --user 選項。
另外 --initialize 選項默認(rèn)以“安全”模式來初始化,則會為 root 用戶生成一個密碼并將該密碼標(biāo)記為過期,登陸后你需要設(shè)置一個新的密碼,而使用 --initialize-insecure 命令則不使用安全模式,則不會為 root 用戶生成一個密碼。
這里演示使用的 --initialize 初始化的,會生成一個 root 賬戶密碼,密碼在log文件里

上圖里的最后一行則給出了生成的密碼,現(xiàn)在就可以啟動數(shù)據(jù)庫了,然后使用上面的密碼登陸。

[root@centos-linux ~]# systemctl start mysqld
[root@centos-linux ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.13

Copyright (c) 2000, 2016, 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>


5、修改 root 密碼

該密碼被標(biāo)記為過期了,如果想正常使用還需要修改密碼

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

以前的 password()函數(shù)將會被拋棄,官方建議使用下面的命令來修改密碼

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';

同時,如果你設(shè)置的密碼過于簡單也會報錯。

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

具體關(guān)于設(shè)置密碼的規(guī)則,可以看這一篇文章。
這里我們注意設(shè)置密碼 長度要大于8,同時要有數(shù)字,大小寫,特殊字符。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

您可能感興趣的文章:
  • centos7使用rpm安裝mysql5.7的教程圖解
  • Centos7 安裝mysql 8.0.13(rpm)的教程詳解
  • centos7上mysql8.0rpm方式安裝教程圖解
  • centos6.5中rpm包安裝mysql5.7初始化出錯的解決方法
  • CentOS 7下使用rpm包安裝mysql 5.7.18
  • 阿里云 Centos7.3安裝mysql5.7.18 rpm安裝教程
  • CentOS7使用rpm包安裝mysql 5.7.18
  • Centos 7下使用RPM包安裝MySQL 5.7.9教程
  • centos7 用rpm安裝mysql詳解
  • 淺析centos 7 mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar

標(biāo)簽:臨沂 內(nèi)蒙古 常德 天津 湖州 重慶 貴州 成都

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《CentOS 7下使用RPM安裝mysql5.7.13》,本文關(guān)鍵詞  CentOS,7下,使用,RPM,安裝,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《CentOS 7下使用RPM安裝mysql5.7.13》相關(guān)的同類信息!
  • 本頁收集關(guān)于CentOS 7下使用RPM安裝mysql5.7.13的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    郎溪县| 海门市| 应用必备| 大冶市| 马山县| 博客| 汪清县| 永清县| 开阳县| 吉安市| 通榆县| 卫辉市| 乃东县| 商城县| 谢通门县| 泰州市| 兴业县| 磴口县| 晋宁县| 黄骅市| 绿春县| 日土县| 共和县| 罗城| 色达县| 东莞市| 德州市| 南汇区| 南和县| 阳东县| 崇阳县| 九寨沟县| 仁化县| 昆明市| 奉化市| 昌平区| 沙坪坝区| 溧水县| 鄄城县| 松潘县| 上虞市|