zoukankan      html  css  js  c++  java
  • ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES

    解决方法:

    利用mysql安装时的默认用户名登录mysql后, 输入以下命令修改root密码

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass'

    2. 授予用户权限 

    GRANT ALL PRIVILEGES ON *.* TO 'jiang'@'%' IDENTIFIED BY '1';
    flush privileges;


    下面的内容没有用到

    一.有时可以直接输入命令: mysql进入数据库

    启动数据库:# mysqld_safe &

    二.查看用户命令: 

    mysql> use mysql;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> select host,user from mysql.user;//show databases;
    

    +--------------------+
    | Database |
    +--------------------+
    | information_schema |
    | mysql |
    | performance_schema |
    | sys |
    +--------------------+

    4 rows in set (0.00 sec)
    
    mysql> 

     删除用户

       

    mysql>Delete FROM user Where User='test' and Host='localhost';
    
       mysql>flush privileges;
    
       mysql>drop database testDB; //删除用户的数据库
    
    删除账户及权限:>drop user 用户名@'%';
    
            >drop user 用户名@ localhost;

    创建用户

    mysql> create user 'root'@'%' identified by '1';#  %代表所有端口
    Query OK, 0 rows affected (0.07 sec)
    
    mysql> select host,user from mysql.user;
    +-----------+------------------+
    | host      | user             |
    +-----------+------------------+
    | %         | root             |
    | %         | usrabc           |
    | localhost | mysql.infoschema |
    | localhost | mysql.session    |
    | localhost | mysql.sys        |
    +-----------+------------------+
    5 rows in set (0.00 sec)

    查看数据库列表:

    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    +--------------------+
    1 row in set (0.00 sec)
    
    mysql>
  • 相关阅读:
    C# GDI生成清晰【高质量】图片
    Myeclipse项目内容没有报错但是项目上面却有红色叉叉
    JRE System Library 与Java EE Libraries的区别
    [原创]Java导出Excel
    [原创]java获取word文档的条目化内容
    [原创]java获取word里面的文本
    各种java生成word解决方案的优缺点对比
    [原创]Java生成Word文档
    [原创]java实现word转pdf
    [原创]java调用PageOffice生成word
  • 原文地址:https://www.cnblogs.com/jiangfeilong/p/10555185.html
Copyright © 2011-2022 走看看