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%";

  • 相关阅读:
    while和do while习题
    Flexigrid折行显示问题
    【Cocos2d-x游戏引擎开发笔记(25)】XML解析
    ruby简单的基本 6
    原因好消息: PSP游戏自己主动算法设计(两)
    《约会专家》拖车【约会宝典】总结
    C++在stack的deque实现
    hdu 4869
    SQL Server 2008杀数据库连接
    BestCoder-Round#33
  • 原文地址:https://www.cnblogs.com/990114-jhc/p/11661618.html
Copyright © 2011-2022 走看看