99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

centos7mysql數據庫安裝和配置的方法

這篇文章主要介紹“centos7 MySQL數據庫安裝和配置的方法”的相關知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“centos7 mysql數據庫安裝和配置的方法”文章能幫助大家解決問題。

公司主營業務:網站設計制作、網站設計、移動網站開發等業務。幫助企業客戶真正實現互聯網宣傳,提高企業的競爭能力。成都創新互聯是一支青春激揚、勤奮敬業、活力青春激揚、勤奮敬業、活力澎湃、和諧高效的團隊。公司秉承以“開放、自由、嚴謹、自律”為核心的企業文化,感謝他們對我們的高要求,感謝他們從不同領域給我們帶來的挑戰,讓我們激情的團隊有機會用頭腦與智慧不斷的給客戶帶來驚喜。成都創新互聯推出通遼免費做網站回饋大家。

一、系統環境

yum update升級以后的系統版本為

[root@yl-web yl]# cat /etc/redhat-release 
centos linux release 7.1.1503 (core)

二、mysql安裝

一般網上給出的資料都是

#yum install mysql
#yum install mysql-server
#yum install mysql-devel

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

[root@yl-web yl]# yum install mysql-server
loaded plugins: fastestmirror
loading mirror speeds from cached hostfile
 * base: mirrors.sina.cn
 * extras: mirrors.sina.cn
 * updates: mirrors.sina.cn
no package mysql-server available.
error: nothing to do

查資料發現是centos 7 版本將mysql數據庫軟件從默認的程序列表中移除,用mariadb代替了。

有兩種解決辦法:

1、方法一:安裝mariadb

mariadb數據庫管理系統是mysql的一個分支,主要由開源社區在維護,采用gpl授權許可。開發這個分支的原因之一是:甲骨文公司收購了mysql后,有將mysql閉源的潛在風險,因此社區采用分支的方式來避開這個風險。mariadb的目的是完全兼容mysql,包括api和命令行,使之能輕松成為mysql的代替品。

安裝mariadb,大小59 m。

[root@yl-web yl]# yum install mariadb-server mariadb

mariadb數據庫的相關命令是:

systemctl start mariadb #啟動mariadb

systemctl stop mariadb #停止mariadb

systemctl restart mariadb #重啟mariadb

systemctl enable mariadb #設置開機啟動

所以先啟動數據庫

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

然后就可以正常使用mysql了 

[root@yl-web yl]# mysql -u root -p
enter password: 
welcome to the mariadb monitor. commands end with ; or \g.
your mariadb connection id is 3
server version: 5.5.41-mariadb mariadb server

copyright (c) 2000, 2014, 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.00 sec)

mariadb [(none)]>

安裝mariadb后顯示的也是 mariadb [(none)]> ,可能看起來有點不習慣。下面是第二種方法。

2、方法二:官網下載安裝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服務。

# service mysqld restart

初次安裝mysql,root賬戶沒有密碼。 

[root@yl-web yl]# 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)

mysql>

 設置密碼

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

mysql>

不需要重啟數據庫即可生效。

在mysql安裝過程中如下內容: 

installed:
 mysql-community-client.x86_64 0:5.6.26-2.el7  mysql-community-devel.x86_64 0:5.6.26-2.el7  
 mysql-community-libs.x86_64 0:5.6.26-2.el7   mysql-community-server.x86_64 0:5.6.26-2.el7  

dependency installed:
 mysql-community-common.x86_64 0:5.6.26-2.el7          

replaced:
 mariadb.x86_64 1:5.5.41-2.el7_0  mariadb-devel.x86_64 1:5.5.41-2.el7_0 mariadb-libs.x86_64 1:5.5.41-2.el7_0 
 mariadb-server.x86_64 1:5.5.41-2.el7_0

所以安裝完以后mariadb自動就被替換了,將不再生效。

[root@yl-web yl]# rpm -qa |grep mariadb
[root@yl-web yl]#

三、配置mysql

1、編碼

mysql配置文件為/etc/my.cnf

最后加上編碼配置

[mysql]
default-character-set =utf8

這里的字符編碼必須和/usr/share/mysql/charsets/index.xml中一致。

centos7 mysql數據庫安裝和配置的方法

2、遠程連接設置

把在所有數據庫的所有表的所有權限賦值給位于所有ip地址的root用戶。

mysql> grant all privileges on *.* to root@'%'identified by 'password';

如果是新用戶而不是root,則要先新建用戶

mysql>create user 'username'@'%' identified by 'password';

此時就可以進行遠程連接了。

關于“centos7 mysql數據庫安裝和配置的方法”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識,可以關注創新互聯行業資訊頻道,小編每天都會為大家更新不同的知識點。

本文標題:centos7mysql數據庫安裝和配置的方法
地址分享:http://www.yijiale78.com/article12/gsopgc.html

成都網站建設公司_創新互聯,為您提供手機網站建設網站導航網站營銷電子商務網站收錄網站維護

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

成都做網站