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 ...
随机推荐
- as3自定义事件
package EventPackage { import flash.events.Event; /** * * @author tqr <br /> * 创建时间:2015-2-6 下 ...
- MongoDB学习:(二)MongoDB简单使用
MongoDB学习:(二)MongoDB简单使用 MongoDB使用: 执行mongodb的操作之前,我们需要运行命令,来进入操作命令界面 >mongo 提示该错误,说明我们系统缺少一个补丁,该 ...
- Python:进程
由于GIL的存在,python一个进程同时只能执行一个线程.因此在python开发时,计算密集型的程序常用多进程,IO密集型的使用多线程 1.多进程创建: #创建方法1:将要执行的方法作为参数传给Pr ...
- dictionaryWithContentsOfFile:方法
dictionaryWithContentsOfFile:方法的功能是创建一个字典,将字典中的内容设置为指定文件中的所有内容, 语法:(id)dictionaryWithContentsOffilE. ...
- 隐藏weibview里面的部分h5
private void initWebView(String url) { twoCode.loadUrl(url); WebSettings settings = twoCode.getSetti ...
- 二 Java利用等待/通知机制实现一个线程池
接着上一篇博客的 一Java线程的等待/通知模型 ,没有看过的建议先看一下.下面我们用等待通知机制来实现一个线程池 线程的任务就以打印一行文本来模拟耗时的任务.主要代码如下: 1 定义一个任务的接口 ...
- kiosk-mode,免密码登陆, sideload Windows Store apps 等
MVVM带来的性能问题及其解决方案 MVVM 和语言性能提示:https://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/mt628050. ...
- DBNull 与 求和方法
public int CountMoney() { if (!DBNull.Value.Equals(Eval("LawyerMoney")) && !DBNull ...
- 安装双系统window +ubuntu
在网上,试过很多种方法,有U盘制作安装,感觉好复杂,这边有一个简便的方法就是使用Ubuntu 的 wubi安装. 一直想安装双Ubuntu 系统很久了,可是以前在大学时期的时候一直努力,好像都不行,这 ...
- IIS出现 分析器错误消息: 在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的节是错误的
这是因为发布的时候按了“生成部署包”