• Ubuntu 18.04 安装配置 MySQL 5.7


    1、安装MySQL5.7

    sudo apt-get install mysql-server-5.7
    

    2、安装完配置

    # 查看初始安装后的用户名和密码
    sudo cat /etc/mysql/debian.cnf 
    # Automatically generated for Debian scripts. DO NOT TOUCH!
    [client]
    host     = localhost
    user     = debian-sys-maint
    password = HP6EwIvpXY23EQ3M
    socket   = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host     = localhost
    user     = debian-sys-maint
    password = HP6EwIvpXY23EQ3M
    socket   = /var/run/mysqld/mysqld.sock
    
    # 修改密码
    mysql -h localhost -u debian-sys-maint -p
    Enter password: 
    ysql> update mysql.user set authentication_string=password('******') where user='root' and host='localhost';
    mysql> use mysql;
    mysql> update user set plugin='mysql_native_password';
    mysql> flush privileges;
    mysql> quit;
    

    3、重启mysql

    sudo service mysql restart
    
    # root用户登录
    mysql -h localhost -u root -p
    Enter password: 
    
    # 查看数据库的字符集 character_set_database character_set_server 
    mysql> show variables like 'character_set_%';
    +--------------------------+----------------------------+
    | Variable_name            | Value                      |
    +--------------------------+----------------------------+
    | character_set_client     | utf8                       |
    | character_set_connection | utf8                       |
    | character_set_database   | latin1                     |
    | character_set_filesystem | binary                     |
    | character_set_results    | utf8                       |
    | character_set_server     | latin1                     |
    | character_set_system     | utf8                       |
    | character_sets_dir       | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+
    
    # 将其改为 utf8,打开 /etc/mysql/mysql.conf.d/mysqld.cnf,在最后添加一句character-set-server=utf8
    # 重启mysql服务
    sudo service mysql restart
    

    参考:https://www.cnblogs.com/gaowengang/p/10816537.html

  • 相关阅读:
    JSP_内置对象_out
    POJ_2186_Popular Cows_强连通分量
    POJ_2411_Mondriaan's Dream_状态压缩dp
    POJ_2115_扩展欧几里德
    HDU_5690_快速幂,同余的性质
    POJ_1061_扩展欧几里德
    HDU_5833_高斯消元
    Delphi 使用 Datasnap 的几种三层应用技术总结
    BIM 开发商 --广州
    Cola Cloud 基于 Spring Boot, Spring Cloud 构建微服务架构企业级开发平台
  • 原文地址:https://www.cnblogs.com/kayj/p/12716224.html
Copyright © 2020-2023  润新知