mariadb
vim /etc/yum.repos.d/mariadb.repo
#输入以下内容
[mariadb]
name = MariaDB
baseurl = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/10.5/centos7-amd64/
gpgkey = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
[mariadb]
name = MariaDB
baseurl = https://repo.huaweicloud.com/mariadb/mariadb-10.5.10/yum/centos74-amd64/rpms/
gpgkey = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
出错
MariaDB [(none)]> GRANT all ON zabbix.* TO zabbix
@%
IDENTIFIED BY 1qaz!@#$
;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘1qaz!@#$
’ at line 1
多方查找,网上各抒己见,不过我这个是命令格式不对,使用的是这个博主的方法
https://blog.csdn.net/wudinaniya/article/details/87877895?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163826038516780261975616%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=163826038516780261975616&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-1-87877895.pc_search_result_cache&utm_term=mariadb+%E5%88%9B%E5%BB%BAzabbix+%E6%95%B0%E6%8D%AE%E5%BA%93&spm=1018.2226.3001.4187
登录mariaDB数据库(也是使用mysql命令),创建数据库实例,账户,并授权账户
[root@zabbix-server ~]# mysql
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; // 创建数据库实例
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@‘localhost’ identified by ‘123456’; // 创建并授权zabbix账户并授权使用123456访问localhost主机上zabbix数据库下的所有表
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges; // 刷新权限
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> quit
Bye