1)增加mariaDB的yum源

1
2
3
4
5
6
7
8
9
[root@centos6-test08 ~]# cd /etc/yum.repos.d/
[root@centos6-test08 yum.repos.d]# cp CentOS-Base.repo CentOS-Base.repo.bak
[root@centos6-test08 yum.repos.d]# vim CentOS-Base.repo
......
[mariadb]   
name = MariaDB
baseurl = http://yum.mariadb.org/10.3.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB  
gpgcheck=1

2)yum安装MariaDB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[root@centos6-test08 yum.repos.d]# yum install -y MariaDB-server MariaDB MariaDB-client
 
安装好后,启动服务
[root@centos6-test08 yum.repos.d]# /etc/init.d/mysql start
[root@centos6-test08 yum.repos.d]# ps -ef|grep mysql
[root@centos6-test08 yum.repos.d]# lsof -i:3306
 
设置开机启动
[root@centos6-test08 yum.repos.d]# chkconfig mysql on
 
[root@centos6-test08 yum.repos.d]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.5-MariaDB MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]>

3)接下来进行MariaDB的相关简单配置,设置密码,会提示先输入密码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[root@centos6-test08 yum.repos.d]# mysql_secure_installation
 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):      <–初次运行直接回车
   
设置密码
Set root password? [Y/n]                               <– 是否设置root用户密码,输入y并回车或直接回车
New password:                                          <– 设置root用户的密码,比如密码为123456
Re-enter new password:                                 <– 再输入一次你设置的密码
   
其他配置
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]                     <– 是否重新加载权限表,回车
 
[root@centos6-test08 yum.repos.d]# mysql -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 19
Server version: 10.3.5-MariaDB MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.001 sec)

4)接下来配置MariaDB的字符集

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[root@centos6-test08 yum.repos.d]# cat /etc/my.cnf
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
 
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d                              //说明在该配置文件中引入/etc/my.cnf.d 目录下的配置文件
 
[root@centos6-test08 yum.repos.d]# ls /etc/my.cnf.d/
enable_encryption.preset  mysql-clients.cnf  server.cnf
 
首先是配置文件/etc/my.cnf.d/server.cnf,在[mysqld]标签下添加
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
 
然后配置文件/etc/my.cnf.d/mysql-clients.cnf,在[mysql]中添加
default-character-set=utf8
 
最后是重启MariaDB,并登陆MariaDB查看字符集
[root@centos6-test08 yum.repos.d]# /etc/init.d/mysql restart
Shutting down MariaDB.. SUCCESS!
Starting MariaDB.180313 05:47:41 mysqld_safe Logging to '/var/lib/mysql/centos6-test08.err'.
180313 05:47:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
 SUCCESS!
 
[root@centos6-test08 yum.repos.d]# mysql -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.3.5-MariaDB MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> show variables like "%character%";show variables like "%collation%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.001 sec)
 
+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_unicode_ci |
| collation_database   | utf8_unicode_ci |
| collation_server     | utf8_unicode_ci |
+----------------------+-----------------+
3 rows in set (0.001 sec)

Centos6下使用yum安装MariaDB的更多相关文章

  1. CentOS7下使用yum安装MariaDB

    从CentOS 7开始,使用 MariaDB 替代默认的 MySQL.MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MyS ...

  2. ECS——CentOS7下使用yum安装MariaDB

    CentOS 6 或早期的版本中提供的是 MySQL 的服务器/客户端安装包,但 CentOS 7 已使用了 MariaDB 替代了默认的 MySQL.MariaDB数据库管理系统是MySQL的一个分 ...

  3. Linux下使用yum安装MariaDB

    版本:centos7 Linux下安装MariaDB官方文档参见:https://mariadb.com/kb/zh-cn/installing-mariadb-with-yum/ 1.创建Maria ...

  4. Centos6.5使用yum安装MariaDB

    系统版本:Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x8 ...

  5. centos6 下用yum 安装 nginx

    以下操作在Cento6.4 系统下实现 一.更新使用163的库 vi /etc/yum.repos.d/CentOS-Base.repo yum update [base] name=CentOS-$ ...

  6. Centos6.5 使用YUM安装MariaDB

    1,第一步 [xxxxxx]$ cd /etc/yum.repos.d [xxxxxx]$ vi MariaDB.repo # MariaDB 10.0 CentOS repository list ...

  7. centos6下yum安装mariadb数据库的解决方法

    在centos6下Yum安装mariadb数据库时老是提示无法正常安装,看错误日志才发现,是没有mariadb release源文件在/etc/yum.repos.d/中,为此,我特意在新建文件: # ...

  8. Centos7 使用yum安装MariaDB与MariaDB的简单配置与使用

    一.mariadb的安装 MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可. 开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜 ...

  9. CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置

    1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB,两条命令都可以 systemctl sta ...

随机推荐

  1. 开放源代码的设计层面框架Spring——day04

    spring第四天     一.Spirng中的JdbcTemplate         1.1JbdcTemplate概述             他是spring框架中提供的一个对象,是对原始Jd ...

  2. centos7.2下部署 python3

    安装Python3 1.环境准备 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel read ...

  3. exists,in的区别-mysql

    如说两张表一张是用户表TDefUser(userid,address,phone),一张是消费表TAccConsume(userid,time,amount),我要查消费超过5000的用户记录,那么我 ...

  4. Javamail pop3连接QQ邮箱遇到最深的坑

    在使用pop3邮箱连接QQ邮箱接受邮件的时候遇到如下错误 Login fail. A secure connection is requiered(such as ssl) 此时按照错误提示添加如下配 ...

  5. Python3:输出当前目录所有目录和文件--walk()函数

    有了前一篇文章的介绍,再输出目录,也不过是多写一个函数的事情了,我把它封装成了类~~ 发现walk()真的是一个超级方便好用的函数.这种情况下用listdir()是搞定不了的啦 import os c ...

  6. Mysql 层级、执行顺序、执行计划分析

    逻辑分层 下面是MySQL的逻辑分层图: 连接层:连接与线程处理,这一层并不是MySQL独有,一般的基于C/S架构的都有类似组件,比如连接处理.授权认证.安全等. 服务层:包括缓存查询.解析器.优化器 ...

  7. 小E浅谈丨区块链治理真的是一个设计问题吗?

    在2018年6月28日Zcon0论坛上,“区块链治理”这个话题掀起了大神们对未来区块链治理和区块链发展的一系列的畅想. (从左至右,分别为:Valkenburgh,Zooko,Jill, Vitali ...

  8. 集成方法 Bagging原理

    1.Bagging方法思路 Bagging独立的.并行的生成多个基本分类器,然后通过投票方式决定分类的类别 Bagging使用了自助法确定每个基本分类器的训练数据集,初始样本集中63.2%的数据会被采 ...

  9. 论文笔记:Fast(er) RCNN

    在 RCNN 初步试水取得成功后,研究人员又迅速跟进,针对 RCNN 中的几点不足提出改进,接连推出了 fast-rcnn 和 faster-rcnn.关于这两篇论文,网上相关的文章实在是多如牛毛,因 ...

  10. Timeline高级扩展

    转载于http://forum.china.unity3d.com/thread-32200-1-1.html通过demo讲解了timeline更加复杂的使用方式 Timeline是创建过场动画和影片 ...