2. 数据库的安全初始化
systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation
#Enter current password for root (enter for none):
#Change the root password? [Y/n]
#以下2步是让你输入密码,其它地方回车就可以了
#New password:
#Re-enter new password:
#Remove anonymous users? [Y/n]
#Disallow root login remotely? [Y/n]
#Remove test database and access to it? [Y/n]
#Reload privilege tables now? [Y/n]
3. 创建数据库用户并授权
yum -y install rsyslog-mysql
mysql -uroot -p < /usr/share/doc/rsyslog-7.4.7/mysql-createDB.sql
mysql -uroot -p
grant all on Syslog.* to rsysloguser@127.0.0.1 identified by 'rsyslogpwd';
grant all on Syslog.* to rsysloguser@localhost identified by 'rsyslogpwd';
flush privileges;
quit