標籤:http java 使用 os io 資料 for art
1、在 /etc/yum.repos.d/ 下建立 MariaDB.repo,內容如下:
[[email protected] etc]$ cd /etc/yum.repos.d [[email protected] 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
如果是其他的作業系統,可以在這裡找到相關資訊。
2、使用YUM安裝MariaDB
[[email protected] yum.repos.d]$ sudo yum -y install MariaDB-client MariaDB-server MariaDB-devel
3、啟動資料庫
[[email protected] yum.repos.d]$ sudo service mysql start
4、修改Root的密碼
[[email protected] yum.repos.d]$ mysqladmin -u root password ‘passwd’
5、配置遠端存取,MariaDB為了安全起見,預設情況下綁定ip( 127.0.0.1)。
[[email protected] 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 ServerCopyright (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 [email protected]"172.168.193.25" IDENTIFIED BY "root";
第二句表示從mysql資料庫的grant表中重新載入許可權資料。因為MySQL把許可權都放在了cache中,所以在做完更改後需要重新載入。
6、如果系統的防火牆開著(or behind a hardware firewall or NAT)你必須放開mysql使用的TCP連接埠,通常都是3306。 7、大小寫敏感
用root帳號登入後,在/etc/my.cnf 中的[mysqld]後添加添加lower_case_table_names=1,重啟MYSQL服務,這時已設定成功:不區分表名的大小寫;
其中 0:區分大小寫,1:不區分大小寫