二、Cent OS 7 下MySQL安装(安装版)
生活随笔
收集整理的這篇文章主要介紹了
二、Cent OS 7 下MySQL安装(安装版)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
- 環境:Cent OS 7
- MYSQL版本:??????
[PS:資源,鏈接:https://pan.baidu.com/s/1QyUzWjgZw8vqKibi-_53dw 提取碼:df4c ]- MySQL-client-5.5.60-1.sles11.x86_64.rpm
- MySQL-server-5.5.60-1.sles11.x86_64.rpm
1、查看 Cent OS 7 是否自帶 mariadb 及卸載步驟 # 1.1 查詢 [root@localhost ~]# rpm -qa | grep mariadb mariadb-libs-5.5.56-2.el7.x86_64 # 有返回值即代表安裝,具體版本號可不一樣# 1.2 卸載 mariadb [失敗命令] [root@localhost ~]# rpm -e mariadb-libs-5.5.56-2.el7.x86_64 #回顯如下則命令失敗: error: Failed dependencies:libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64# 1.3 強制卸載 [成功命令] [root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64# 1.4 校驗 mariadb 是否卸載成功 [無返回結果即代表成功] [root@localhost ~]# rpm -qa | grep mariadb
- 為什么要卸載mariadb?
- 原因:安裝MySQL的時候會和mariadb文件相沖突導致安裝不成功。
2、新建文件夾并復制MySQL
[root@localhost ~]# mkdir /opt/mysql# 復制MySQL-client-5.5.60-1.sles11.x86_64.rpmMySQL-server-5.5.60-1.sles11.x86_64.rpm 到 /opt/mysql 下3、安裝MySQL服務端和客戶端
# 3.1 安裝 MySQL 服務端 [失敗命令] [root@localhost mysql]# rpm -ivh MySQL-server-5.5.60-1.sles11.x86_64.rpm #回顯如下則命令失敗: warning: MySQL-server-5.5.60-1.sles11.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies:aaa_base is needed by MySQL-server-5.5.60-1.sles11.x86_64pwdutils is needed by MySQL-server-5.5.60-1.sles11.x86_64usr/bin/perl is needed by MySQL-server-5.5.60-1.sles11.x86_64# 3.2 強制安裝MySQL[root@localhost mysql]# rpm -ivh MySQL-server-5.5.60-1.sles11.x86_64.rpm --force --nodeps執行結果見下圖:
執行結果見下圖:
4、設置/修改MySQL密碼
見下圖:
見下圖:
5、測試MySQL安裝是否成功
[root@localhost mysql]# mysql -uroot -p Enter password:[輸入設置的root用戶密碼] #回顯如下,則安裝及設置密碼成功: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.5.60 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>總結
以上是生活随笔為你收集整理的二、Cent OS 7 下MySQL安装(安装版)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 练习:银行复利计算(用 for 循环解一
- 下一篇: 微信小程序生成小程序码图片-【附坑点】