zoukankan      html  css  js  c++  java
  • Centos7中mariadb数据库的安装

    1.安装MariaDB数据库

    yum -y install mariadb mariadb-server

    2.启动MariaDB数据库

    systemctl start mariadb

    3.设置开机启动

    systemctl enable mariadb

    4.MariaDB的创建过程

    mysql_secure_installation

    Set root password? [Y/n] yes   #是否设置密码
    New password:         #输入要设置的密码
    Re-enter new password:     #确认密码
    Password updated successfully!
    Reloading privilege tables..
     ... Success!           #提示创建成功

    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]   #是否重新加载权限表,回车

    5.初始化完成后测试登录

    mysql -uroot -p'设置的密码'

    6.配置MariaDB的字符集

    vim /etc/my.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/client.cnf

    vi /etc/my.cnf.d/client.cnf

    在[client]中添加

    default-character-set=utf8

    文件/etc/my.cnf.d/mysql-clients.cnf

    vi /etc/my.cnf.d/mysql-clients.cnf

    在[mysql]中添加

    default-character-set=utf8

     全部配置完成,重启mariadb

    systemctl restart mariadb

    7.进入MariaDB查看字符集

    mysql -uroot -p'设置的密码'

    show variables like "%character%";show variables like "%collation%";

  • 相关阅读:
    CentOS 6.3下Samba服务器的安装与配置(转)
    利用香蕉派自制电视盒子
    利用arduino制作瓦力万年历-1.0
    arduino:int & double 转string 适合12864下使用
    centos 6.X下建立arduino开发环境
    树莓派学习笔记(7):利用bypy实现树莓派NAS同步百度云
    直接插入排序
    直接选择排序
    快速排序算法
    git 分支管理 推送本地分支到远程分支等
  • 原文地址:https://www.cnblogs.com/990114-jhc/p/11661618.html
Copyright © 2011-2022 走看看