一、在 /etc/yum.repos.d/
下創建 MariaDB.repo,內容以下:
[azureuser@mono etc]$ cd /etc/yum.repos.d
[azureuser@mono yum.repos.d]$ vi MariaDB.repophp
# 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=1html
若是是其餘的操做系統,能夠在這裏找到相關信息。mysql
二、使用YUM安裝MariaDB
[azureuser@mono yum.repos.d]$ sudo yum -y install MariaDB-client MariaDB-server MariaDB-develnginx
三、啓動數據庫
[azureuser@mono yum.repos.d]$ sudo service mysql start sql
四、修改Root的密碼 數據庫
[azureuser@mono yum.repos.d]$ mysqladmin -u root password ‘passwd’centos
五、配置遠程訪問,MariaDB爲了安全起見,默認狀況下綁定ip( 127.0.0.1)。安全
[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;
第一句中"%"表示任何主機均可以遠程登陸到該服務器上訪問。若是要限制只有某臺機器能夠訪問,將其換成相應的IP便可,如:
GRANT ALL PRIVILEGES ON *.* TO root@"172.168.193.25" IDENTIFIED BY "root";
第二句表示從mysql數據庫的grant表中從新加載權限數據。由於MySQL把權限都放在了cache中,因此在作完更改後須要從新加載。
六、若是系統的防火牆開着(or behind a hardware firewall or NAT)你必須放開mysql使用的TCP端口,一般都是3306。
七、大小寫敏感
用root賬號登陸後,在/etc/my.cnf 中的[mysqld]後添加添加lower_case_table_names=1,重啓MYSQL服務,這時已設置成功:不區分表名的大小寫;
lower_case_table_names參數詳解:
lower_case_table_names = 0
其中 0:區分大小寫,1:不區分大小寫
OSX 上安裝 MariaDB
http://www.foolegg.com/how-to-setup-a-nginx-mariadb-php-mnmp-server-on-mac-osx/
https://kb.askmonty.org/en/building-mariadb-on-mac-os-x-using-homebrew/
相關文章 :