CentOS版本:CentOS-7-x86_64-Minimal-1511
1、安装Mariadb
[root@localhost~]# yum -y install mariadb-server
2、启动服务并设置开机启动
[root@localhost~]# systemctl start mariadb
[root@localhost~]# systemctl enable mariadb
3、配置MariaDB
[root@localhost~]# MysqL_secure_installation
#输入当前root密码
Entercurrent password for root (enter for none):
#设置root密码?
Changethe root password?[Y/n]
#
Removeanonymous users?[Y/n]
#root
Disallowroot login remotely?[Y/n]
#test
Removetest database and access to it? [Y/n]
#重新加载权限表?
Reloadprivilege tables now? [Y/n]
4、配置MariaDB字符编码(以utf8mb4为例)
[root@localhost~]# vi /etc/f
#在[MysqLd]标签下添加
character-set-server=utf8mb4
[root@localhost~]# vi /etc/f.d/f
#在[client]标签下添加
default-character-set=utf8mb4
5、重启启动MariaDB服务
[root@localhost~]# systemctl restart mariadb
6、查看MariaDB字符编码
MariaDB[(none)]show variables like ‘%character%’;
7、卸载MariaDB
[root@localhost~]# rpm -aq|grep mariadb
mariadb-libs-5.5.50-1.e17_2.x86_64
mariadb-5.5.50-1.e17_2.x86_64
mariadb-server-5.5.50-1.e17_2.x86_64
[root@localhost~]# yum -y remove mariadb*
总结
如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
小编个人微信号 jb51ccc
喜欢与人分享编程技术与工作经验,欢迎加入编程之家官方交流群!