CentOS信息:
[root@bogon ~]# cat /etc/centos-release
CentOS Linux release 7.3.1611 (Core)
[root@bogon ~]# uname -a
Linux bogon 3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
MariaDB信息:
MariaDB [(none)]> select version();
+—————-+
| version() |
+—————-+
| 5.5.52-MariaDB |
+—————-+
1 row in set (0.00 sec)
设置方法:(示例为IP172.16.99网段的电脑都可以用root用户/密码123456连接到MariaDB)
[root@bogon ~]# mysql -u root -p
MariaDB [(none)]> grant all privileges on *.* to ‘root’@’172.16.99.%’ identified by ‘123456’with grant option;
Query OK, 0 rows affected (0.00 sec)
注:关闭firewall ,禁用SELinux,不需要编辑 my.cnf 文件。