国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

詳解Centos 使用YUM安裝MariaDB

瀏覽:161日期:2023-03-30 13:21:20

1、在 /etc/yum.repos.d/ 下建立 MariaDB.repo,內(nèi)容如下:

復(fù)制代碼 代碼如下:
[azureuser@mono etc]$ cd /etc/yum.repos.d
[azureuser@mono yum.repos.d]$ vi MariaDB.repo
# MariaDB 10.0 CentOS repository list - created 2013-08-23 13:08 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

如果是其他的操作系統(tǒng),可以在這里找到相關(guān)信息。

2、使用YUM安裝MariaDB

復(fù)制代碼 代碼如下:
[azureuser@mono yum.repos.d]$ sudo yum -y install MariaDB-client MariaDB-server MariaDB-devel

3、啟動(dòng)數(shù)據(jù)庫

復(fù)制代碼 代碼如下:
[azureuser@mono yum.repos.d]$ sudo service mysql start

4、修改Root的密碼

復(fù)制代碼 代碼如下:
[azureuser@mono yum.repos.d]$ mysqladmin -u root password ‘passwd"

5、配置遠(yuǎn)程訪問,MariaDB為了安全起見,默認(rèn)情況下綁定ip( 127.0.0.1)。

復(fù)制代碼 代碼如下:
[azureuser@mono yum.repos.d]$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.0.4-MariaDB MariaDB Server
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type "help;" or "\h" for help. Type "\c" to clear the current input statement.
MariaDB [(none)]>GRANT ALL PRIVILEGES ON *.* TO "root"@"%" IDENTIFIED BY ‘passwd" WITH GRANT OPTION;
MariaDB [(none)]> flush privileges;

第一句中"%"表示任何主機(jī)都可以遠(yuǎn)程登錄到該服務(wù)器上訪問。如果要限制只有某臺(tái)機(jī)器可以訪問,將其換成相應(yīng)的IP即可,如:

GRANT ALL PRIVILEGES ON *.* TO root@"172.168.193.25" IDENTIFIED BY "root";

第二句表示從mysql數(shù)據(jù)庫的grant表中重新加載權(quán)限數(shù)據(jù)。因?yàn)镸ySQL把權(quán)限都放在了cache中,所以在做完更改后需要重新加載。

6、如果系統(tǒng)的防火墻開著(or behind a hardware firewall or NAT)你必須放開mysql使用的TCP端口,通常都是3306。

7、大小寫敏感

用root帳號(hào)登錄后,在/etc/my.cnf 中的[mysqld]后添加添加lower_case_table_names=1,重啟MYSQL服務(wù),這時(shí)已設(shè)置成功:不區(qū)分表名的大小寫;

lower_case_table_names參數(shù)詳解:

lower_case_table_names = 0

其中 0:區(qū)分大小寫,1:不區(qū)分大小寫

標(biāo)簽: MariaDB
主站蜘蛛池模板: 南漳县| 美姑县| 松潘县| 沛县| 永顺县| 桑植县| 靖远县| 连云港市| 尚志市| 华亭县| 沙坪坝区| 额敏县| 江陵县| 扶沟县| 奉贤区| 焦作市| 呼图壁县| 扶绥县| 阿合奇县| 集安市| 泰兴市| 雷山县| 噶尔县| 乳山市| 木兰县| 海门市| 张家口市| 德阳市| 朝阳县| 清河县| 宜兰县| 牟定县| 慈溪市| 五峰| 石城县| 连城县| 兴安县| 开原市| 陆河县| 和平区| 平遥县|