zoukankan      html  css  js  c++  java
  • CentOS 7 yum 安装与配置MySQL5.7

    1.下载mysql源安装包

    wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

    2.安装mysql源

    yum localinstall mysql57-community-release-el7-8.noarch.rpm
    检查mysql源是否安装成功
    yum repolist enabled | grep "mysql.*-community.*"

    3.安装MySQL
    yum install mysql-community-server

    4.启动MySQL
    systemctl start mysqld

    查看MySQL的启动状态
    systemctl status mysqld

    5.开机启动

    systemctl enable mysqld
    systemctl daemon-reload

    6.禁用密码策略

    vim /etc/my.cnf
    validate_password = off

    7.修改root本地登录密码

    查看默认密码
    grep 'temporary password' /var/log/mysqld.log
    mysql -uroot -p
    set password for 'root'@'localhost'=password('root123!@#');

    8.配置默认编码为utf8

    [mysqld]
    character_set_server=utf8
    [client]
    default-character-set=utf8

    查看编码

    show variables like '%character%';

    9.默认配置文件路径

    配置文件:/etc/my.cnf
    日志文件:/var/log//var/log/mysqld.log
    服务启动脚本:/usr/lib/systemd/system/mysqld.service
    socket文件:/var/run/mysqld/mysqld.pid

  • 相关阅读:
    fedora 安装open office
    git rebase(转)
    javascript typeof
    正则表达式入门
    XML格式
    zz 通用线程:Awk 实例,第 3部分
    ELF BIN HEX
    i2c总线(iic总线/ I square C)
    grep
    把Nginx注册成Windows 系统服务(转载)
  • 原文地址:https://www.cnblogs.com/taohaijun/p/7157792.html
Copyright © 2011-2022 走看看