Access denied for user 'root'@'localhost' (using password: YES)"

    xiaoxiao2021-03-26  28

    连接MySQL数据库,出现问题:Access denied for user 'root'@'localhost' (using password:YES)。

     经查找资料发现是root帐户默认不开放远程访问权限,所以需要修改一下相关权限。

    添加新用户即可

    新建用户: CREATE USER  'dog' @ 'localhost'   IDENTIFIED BY  '123456' ;  为用户授权: 格式: grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码"; 示例: grant all privileges on testDB.* to test@localhost identified by '1234'; 然后需要执行刷新权限的命令: flush privileges;

    开发环境随意啦啦

    转载请注明原文地址: https://ju.6miu.com/read-662858.html

    最新回复(0)