1、安装MariaDB:yum -y install mariadb mariadb-server 2、设置开机启动:systemctl enable mariadb 3、启动MariaDB:systemctl start mariadb 4、初始化配置:mysql_secure_installation        4.1、设置密码,会提示先输入密码 Enter current password for root (enter for none):<–初次运行直接回车 Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车              New password: <– 设置root用户的密码              Re-enter new password: <– 再输入一次你设置的密码        4.2、其他配置 Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车 Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车, Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车 Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车 初始化MariaDB完成,接下来测试登录 mysql -uroot -p你的密码 完成。 ==5、设置远程登录:==       ==使用mysql -uroot -p密码登录后,执行命令:==       ==GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你的密码的明文' WITH GRANT OPTION;==       ==FLUSH PRIVILEGES;== ==6、如果远程访问,并且数据量很大,则需要进行如下配置,否则会出现==**MySQL server has gone away** ==的==  ==错误     :==    ==set global max_allowed_packet=1024*1024*16;== > 来自 <[https://blog.csdn.net/lianshaohua/article/details/88380898](https://blog.csdn.net/lianshaohua/article/details/88380898)>