Mysql创建新用户后无法登录,提示 Access denied for user 'username'@'localhost' (using password: YES)
MySQL创建新用户后无法登录,提示 Access denied for user 'username'@'localhost' (using password: YES) ,多半是因为存在匿名用户,要解决这个问题只要删除数据库中的匿名用户即可。
MySQL新建用户后无法登录,提示 Access denied for user 'username'@'localhost' (using password: YES) 的解决方法:
请使用root账户通过命令行或PHP程序运行以下代码
- MySQL 创建一个新用户,用户名为username,密码为password,将localhost改为%可允许该用户登录所有主机
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; - 为该用户授权,本例将所有权限全部授予给该用户,可以将ALL PRIVILEGES改为具体的权限选项,
*.*代表所有数据库下的所有数据表,也可以指定为具体的数据库表
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION - 删除数据库中的空白账户(匿名账户),依次执行以下两条指命,这一步是解决这个问题的核心步骤
DELETE FROM `mysql`.`user` WHERE `user`='';
FLUSH PRIVILEGES;
Mysql创建新用户后无法登录,提示 Access denied for user 'username'@'localhost' (using password: YES)的更多相关文章
- MySQL密码正确却无法本地登录-1045 Access denied for user 'root'@'localhost' (using password:YES
MySQL密码正确却无法本地登录 报错如下: ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password ...
- mySQL 5.7版 解决密码登录失败Access denied for user 'root'@'localhost' (us
mySQL 5.7版 解决密码登录失败Access denied for user 'root'@'localhost' (us 2016-03-05 ...
- Linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) "
前言 作者在2021-07-21时遇到 linux下登陆MySQL时遇到报错"RROR 1045 (28000): Access denied for user 'root'@'localh ...
- 本地MySQL的root所创建用户登录发生[Access denied for user 'root1'@'localhost' (using password: YES)]错误的解决方案
1.问题描述: 当在SQLyog中执行以下脚本: CREATE DATABASE IF NOT EXISTS sys; USE sys; CREATE USER root1 IDENTIFIED BY ...
- Mysql忘记密码:关于ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)的问题
命令行登录mysql时,出现ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)的提示. ...
- MySQL在登陆时出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)错误
错误显示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决方案: 1.找到配 ...
- phpMyAdmin提示“Access denied for user 'root'@'localhost' (using password: NO)”的解决办法
一.错误内容 在用thinkPHP登陆phpMyAdmin时遇到以下错误 #1045 - Access denied for user 'root'@'localhost' (using passwo ...
- centos 安装mysql 登录进提示 Access denied for user 'root'@'localhost' (using password: NO)
# service mysqld stop # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & # mysql ...
- CentOS命令登录MySQL时,报错ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)错误解决方法
1.停用mysql服务:# /etc/rc.d/init.d/mysqld stop 2.输入命令:# mysqld_safe --user=mysql --skip-grant-tables --s ...
随机推荐
- ZT 螨虫知识2
病情分析:过敏是治不好的,只能做到避免接触.指导意见:螨虫的话就不要跟狗多接触,狗的寄生虫很多,还有草地,尤其是狗经常去的地方,草地就是螨虫的传播介质.你是过敏性体质除了被免过敏性源外,还要增强体质, ...
- Eclipse之Git提交项目
一.使用eclipse自带插件提交项目 1.自带git插件进行配置我们的用户名和密码,即是自己github注册的用户. windows-perferences-Team-Git-configurati ...
- svn的安装配置
之前找了一些svn的资料,一直配置不成功.然后找到了这个链接,配置成功了.还可以. http://www.cnblogs.com/zhoulf/archive/2013/02/02/2889949.h ...
- 快速排序 - C语言
看了这本<数据结构与算法分析>中的快速排序. 写下自己理解后的代码,以备后用. #include "stdio.h" void insertSort(int arr[] ...
- 复制mueclipse项目到eclipse
本文适用于将MyEclipse上的项目projectA检出后重命名为projectB的情况,如果只是检出projectA到Eclipse,也可以部分参考 1.从svn上检出Myeclipse项目到Ec ...
- mac iterm2配置
iterm2的配置分为如下几个部分: 1. 字体大小的配置: iTerm->Preferences->Profiles->Text->Regular Font: 我在这里设置成 ...
- survey on Time Series Analysis Lib
(1)I spent my 4th year Computing project on implementing time series forecasting for Java heap usage ...
- 交换机的link-dependency链路依赖功能
在生产环境中,如果各主机连接到交换机的1-16端口,交换机的18端口上联到外部网络,如果此时交换机的18端口断掉,在主机端网卡仍然有连接,对于一些网络的配置可能就感知不到外部连接的消失,会有问题(如E ...
- [04]APUE:文件与目录
[a] stat / lstat / fstat #include <sys/stat.h> int stat(const char *restrict pathname, struct ...
- 给JavaScript初学者的24条最佳实践
.fluid-width-video-wrapper { width: 100%; position: relative; padding: 0 } .fluid-width-video-wrapp ...