1、配置selinux config文件
SELINUX=disabled
SELINUXTYPE=mls
2、安装数据库 并启动
dnf install mariadb-server
systemctl status mariadb #查看版本
systemctl start mariadb #启动服务
systemctl enable mariadb #设置开机启动
systemctl stop mariadb.service #停止MariaDB
登录到数据库用
mysql -uroot; 默认登入为空密码
设置mariadb 密码:
#mysql_secure_installation
配置MariaDB的字符集
编辑mariadb-server.cnf文件,在[mysqld]标签下添加
[mysqld]
init_connect='SET collation_connection = utf8mb4_unicode_ci'
init_connect='SET NAMES utf8mb4'
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
skip-character-set-client-handshake
查看字符集是否是utf8
mysql> show variables like "%character%";show variables like "%collation%";
设置后客户端传入的字符编码格式才是utf8mb4
#4.添加用户,设置权限
#创建用户命令
#mysql>create user username@localhost