安装mariadb报错: Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

卸载和删除都使用过了,没有起到效果,然后用了如下的方案,进行解决:

 

CentOS Yum 源安装配置 Mariadb

2017.03.01 WangYan 学习笔记  热度 7℃ 

一、安装 MariaDB

1.添加 MariaDB Yum

cat >/etc/yum.repos.d/MariaDB.repo<<‘EOF‘

[mariadb]

name = MariaDB

baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/10.2/centos7-amd64/

gpgkey= http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB

gpgcheck=1

EOF

2.安装 MariaDB

sudo yum install -y MariaDB-server MariaDB-client

3.启动 MariaDB

sudo systemctl start mariadb

sudo systemctl enable mariadb

二、设置 MariaDB

mysql_secure_installation

 

  1. 初始密码为空,直接回车。
  2. 设置 root 密码
  3. 是否移除匿名用户
  4. 是否禁止 root 远程登录
  5. 是否删除 ‘test’ 测试数据库

三、测试 MariaDB

mysqladmin -u root -p version

 

四、解决 MariaDB 中文乱码

https://mariadb.com/kb/en/mariadb/setting-character-sets-and-collations/

[client]

...

default-character-set=utf8

...

[mysql]

...

default-character-set=utf8

...

[mysqld]

...

character-set-server  = utf8

collation-server      = utf8_general_ci

character_set_server  = utf8

collation_server      = utf8_general_ci

...

测试

mysql -u root -p

SHOW VARIABLES WHERE Variable_name LIKE ‘character\_set\_%‘ OR Variable_name LIKE ‘collation%‘;

 

文章来自:https://www.cnblogs.com/lingluo2017/p/8718311.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3