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>
  • 相关阅读:
    使用Bat自动打包并通过FTP发送到备份服务器
    IIS 注意事项
    Windows 2008 R2 IP安全策略设置
    修改远程桌面端口
    mac osx 下的apt-get,yum的代替工具 ----homebrew
    mac终端命令大全介绍
    windows 服务器设置相关
    Mac OS 下使用EXE文件
    Mybaits的运行原
    No constructor found in com.website.entity.News matching
  • 原文地址:https://www.cnblogs.com/jiangfeilong/p/10555185.html
Copyright © 2011-2022 走看看