Centos install MariaDB using YUM

/etc/yum.repos.d/ 1.   Create MariaDB.repo under:
[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

For other operating systems, you can find relevant information here .

2、使用YUM安装MariaDB 
[azureuser@mono yum.repos.d]$ sudo yum -y install MariaDB-client MariaDB-server MariaDB-devel

3. Start the database 
[azureuser@mono yum.repos.d]$ sudo service mysql start 

4. Modify the password of Root

[azureuser@mono yum.repos.d]$ mysqladmin -u root password ‘passwd’

5. Configure remote access, MariaDB binds ip (127.0.0.1) by default for security.

[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;

The "%" in the first sentence means that any host can log in to the server remotely. If you want to restrict access to only a certain machine, you can replace it with the corresponding IP, such as:

GRANT ALL PRIVILEGES ON *.* TO root@"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服务,这时已设置成功:不区分表名的大小写;
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/

相关文章 :

Mysql初始化root密码和允许远程访问

MySQL管理工具HeidiSQL

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326688994&siteId=291194637
Recommended