日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
CentOS7.2下安裝MySQL

一、系統(tǒng)環(huán)境

 [root@localhost home]# cat /etc/RedHat-release

 CentOS Linux release 7.2.1511 (Core)

二、mysql安裝

 安裝mysql和mysql-devel都成功,但是安裝mysql-server失敗,如下:

[root@localhost home]# yum install mysql-server
    已加載插件:fastestmirror, langpacks
    Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
    base                                                                    | 3.6 kB  00:00:00     
    extras                                                                  | 3.4 kB  00:00:00     
    updates                                                                 | 3.4 kB  00:00:00     
   (1/4): base/7/x86_64/group_gz                                           | 155 kB  00:00:01     
   (2/4): extras/7/x86_64/primary_db                                       | 139 kB  00:00:01     
   (3/4): base/7/x86_64/primary_db                                         | 5.6 MB  00:00:38     
   (4/4): updates/7/x86_64/primary_db                                      | 4.7 MB  00:00:39     
 Loading mirror speeds from cached hostfile
  * base: mirrors.163.com
  * extras: mirrors.163.com
  * updates: mirrors.163.com
 沒(méi)有可用軟件包 mysql-server。
 錯(cuò)誤:無(wú)須任何處理

出現(xiàn)這樣問(wèn)題是CentOS 7 版本將MySQL數(shù)據(jù)庫(kù)軟件從默認(rèn)的程序列表中移除,用mariadb代替了

有兩種解決辦法:

 1、方法一:安裝mariadb

MariaDB數(shù)據(jù)庫(kù)管理系統(tǒng)是MySQL的一個(gè)分支,采用GPL授權(quán)許可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能輕松成為MySQL的代替品。MariaDB由MySQL的創(chuàng)始人Michael Widenius(英語(yǔ):Michael Widenius)主導(dǎo)開發(fā),他早前將自己創(chuàng)建的公司MySQL AB賣給了SUN,此后,隨著SUN被甲骨文收購(gòu),MySQL的所有權(quán)也落入Oracle的手中。MariaDB名稱來(lái)自Michael Widenius的女兒Maria的名字。

安裝mariadb,輸入安裝命令

[root@localhost home]# yum install mariadb-server mariadb

mariadb數(shù)據(jù)庫(kù)的相關(guān)命令是:

   systemctl start mariadb  #啟動(dòng)MariaDB

   systemctl stop mariadb  #停止MariaDB

   systemctl restart mariadb  #重啟MariaDB

   systemctl enable mariadb  #設(shè)置開機(jī)啟動(dòng)

先啟動(dòng)數(shù)據(jù)庫(kù)

  [root@yl-web yl]# systemctl start mariadb

  默認(rèn)無(wú)密碼

[root@localhost lzh]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

   

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.01 sec)

2、方法二:官網(wǎng)下載安裝mysql-server

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server

安裝成功后重啟mysql服務(wù)

    # service mysqld restart

初次安裝mysql,root賬戶沒(méi)有密碼

[root@localhost lzh]# mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.26 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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               |
+--------------------+
4 rows in set (0.01 sec)

設(shè)置密碼

mysql> set password for 'root'@'localhost' =password('password');
Query OK, 0 rows affected (0.00 sec)

安裝完以后mariadb自動(dòng)就被替換了,將不再生效。

[root@localhost lzh]# rpm -qa |grep mariadb

網(wǎng)頁(yè)標(biāo)題:CentOS7.2下安裝MySQL
網(wǎng)站路徑:http://m.5511xx.com/article/dhejjho.html