zoukankan      html  css  js  c++  java
  • mysql笔记

    1 mysql常见问题

    1.1 无法连接

    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    
    单个:
    grant all privileges on *.* to root@'localhost' identified by "123456" with grant option
    允许ip段:
    grant all privileges on *.* to root@'localhost,192.168.*.*' identified by "123456" with grant option; 
    注:模糊匹配ip地址在有的mysql版本中不支持
    

    1.2 Ubuntu18.04安装MySQL后普通用户无法登录

    mysql5.7安装完成后普通用户不能进mysql,原因:root的plugin被修改成了auth_socket,用密码登陆的plugin应该是mysql_native_password,直接用root权限登录就不用密码,修改root密码和登录验证方式:

    
    mysql> select user, plugin from mysql.user;
    +------------------+-----------------------+
    | user             | plugin                |
    +------------------+-----------------------+
    | root             | auth_socket           |
    | mysql.session    | mysql_native_password |
    | mysql.sys        | mysql_native_password |
    | debian-sys-maint | mysql_native_password |
    
    
    update mysql.user set authentication_string=PASSWORD('root'), plugin='mysql_native_password' where user='root';
    flush privileges;
    exit;
    

    重启mysql 服务

     sudo service mysql restart
    
  • 相关阅读:
    mktemp -t -d用法
    使用getopts处理输入参数
    linux中$1的意思
    linux中的set -e 与set -o pipefail
    在windows 7 和linux上安装xlwt和xlrd
    nginx map使用方法
    Linux crontab下关于使用date命令和sudo命令的坑
    东哥讲义
    ldapsearch使用
    date 命令之日期和秒数转换
  • 原文地址:https://www.cnblogs.com/syzjzmh/p/14182949.html
Copyright © 2011-2022 走看看