zoukankan      html  css  js  c++  java
  • 安装mariadb

     安装mariadb有两个源,一个是阿里云的yum源,可能版本较低,软件包很小,功能很少

    二个是mariadb官方的yum源,配置方式

    在/etc/yum.repos.d目录下,建立一个repo文件就是yum仓库

    #创建一个mariadb.repo文件,写入以下内容
    [mariadb]
    name = MariaDB
    baseurl = http://yum.mariadb.org/10.1/centos7-amd64
    gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    gpgcheck=1

    2安装mariadb,查看官方的版本号和软件包信息

     yum install MariaDB-server MariaDB-client -y

    3在安装好MySQL后,进行初始化

     mysql_secure_installation

    4进行mysql数据库编码统一,修改/etc/my.cnf配置如下

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    character-set-server=utf8
    collation-server=utf8_general_ci
    log-error=/var/log/mysqld.log
    # Disabling symbolic-links is recommended to prevent assorted security risks
    symbolic-links=0
    # Settings user and group are ignored when systemd is used.
    # If you need to run mysqld under a different user or group,
    # customize your systemd unit file for mariadb according to the
    # instructions in http://fedoraproject.org/wiki/Systemd
    
    [mysqld_safe]
    log-error=/var/log/mariadb/mariadb.log
    pid-file=/var/run/mariadb/mariadb.pid
    
    [client]
    default-character-set=utf8
    [mysql]
    default-character-set=utf8
    
    #
    # include all files from the config directory
    #
    !includedir /etc/my.cnf.d

    5授权mysql进行远程登录

    grant all privileges on *.* to root@'%' identified by '0000';
    flush privileges;
  • 相关阅读:
    2019 Multi-University Training Contest 4
    AC自动机
    trie
    Contest1802
    蓝桥杯-某电视台举办了低碳生活大奖赛
    蓝桥杯-有一群海盗(不多于20人),在船上比拼酒量
    蓝桥杯-福尔摩斯到某古堡探险
    蓝桥杯-标题:字符串比较
    蓝桥杯-题目:猜算式
    蓝桥杯-标题:算年龄
  • 原文地址:https://www.cnblogs.com/xuqidong/p/11186445.html
Copyright © 2011-2022 走看看