【转载】 ERROR 1045 (28000): Access denied for user [email protected] (using password: NO)

来自:http://www.jb51.net/LINUXjishu/10981.html

错误描述: Mysql中添加用户之后可能出现登录时提示ERROR 1045 (28000): Access denied for
user的错误.删除user.user中值为NULL的,或更新NULL为test 1)delete from user where user is NULL
2)update user set user=‘test‘ where user is NULL.意外的情况:
如果上述方法没有效果,依然出现空用户,则可以利用图形化用户client删除.
在重装了CentOS后,发觉Mysql一直不好用。
#
mysqladmin create dbname 命令老是返回mysqladmin: connect to server at ’localhost’
failed
# mysql -u [email protected] 

>create database dbname;  
也同样返回错误ERROR 1045 (28000):
Access denied for user ’root’@’localhost’
(using password: NO)
# mysql -u root -p
Enter password:
ERROR 1045
(28000): Access denied for user ’root’@’localhost’
(using password: NO)
使用网上介绍的方法修改root用户的密码:
# mysqladmin -uroot -p
password ’newpassword’
Enter password:
mysqladmin: connect to server at
’localhost’ failed
error: ’Access denied for user ’root’@’localhost’
(using password: YES)’
现在终于被我找到了解决方法,如下(本人亲测,全部可行):
方法一:
#
/etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables
--skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET
Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH
PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql
-uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
方法二:

直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql
-udebian-sys-maint -p
Enter password: <输入[client]节的密码>
mysql>
UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;

mysql> FLUSH PRIVILEGES;
mysql> quit
# mysql -uroot -p

Enter password: <输入新设的密码newpassword>
mysql>
方法三:
#
mysql -uroot -p
Enter password:
<输入/etc/mysql/debian.cnf文件中[client]节提供的密码>

【转载】 ERROR 1045 (28000): Access denied for user [email protected]
(using password: NO),布布扣,bubuko.com

【转载】 ERROR 1045 (28000): Access denied for user [email protected]
(using password: NO)

时间: 2024-10-05 20:21:55

【转载】 ERROR 1045 (28000): Access denied for user [email protected] (using password: NO)的相关文章

安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user [email&#160;protected] (using password: NO)的解决方案

本机是centos 6.5  安装的mysql是5.1的版本. 在安装mysql之后,第一次启动mysql服务的时候,需要/tmp有777(rwxrwxrwx)的权限,然而楼主的/tmp是755(rwxr-xr-x)的,[其实默认的是777,我因为之前误删过tmp,然后自己建的tmp,而权限没跟着改,小白的悲伤,说多了都是泪= =]所以如果不知道这个坑的话,第一次基本会出错.这个时候再修改/tmp已经迟了, 所以只能重新安装mysql了 由于上述原因报的错误是:ERROR 1045 (28000

ERROR 1045 (28000): Access denied for user [email&#160;protected] (using password: YES)解决办法

出现1045这个问题可以通过修改密码来解决,以下是无法登录的情况下修改密码: 在dos下进入mysql的bin目录,输入mysql -uroot -p然后输入密码还是会出现1045的错误,如下图 解决办法: 1,不要-p登录 2,执行update语句修改密码 UPDATE mysql.user SET Password=PASSWORD('新密码') where USER='root' and HOST="localhost"; 3,mysql> FLUSH PRIVILEGES

解决ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES)【亲测有效】

文件转自:https://blog.csdn.net/hua1011161696/article/details/80666025 问题:(MySQL 5.6社区版windows版) 忘记密码或其他一些原因导致无法连接上MySQL服务器端,在命令行报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决方案: 步骤一:关闭数据库服务端mysqld程序 两种方式: ①快捷键 w

ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

在安装好的MySQL服务器上,配置了环境变量之后,发现用mysql无法登录,报如题的错误,实在没有办法,决定用安全模式对root用户修改密码: 首先在一个ssh窗口运行命令:mysqld_safe --user=mysql --skip-grant-tables --skip-networking& [[email protected] ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking& 运行之后新打开一个

Mac下解决mysql ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES)

Maybe updating the package the updater overwrote the root password. To restore it: Stop mysqld deamons. $ sudo service mysqld stop Go to mysql/bin directory $ cd /usr/bin Start a mysql deamon with this option: $ sudo mysqld_safe --skip-grant-tables O

ERROR 1045 (28000): Access denied for user &#39;hive&#39;@&#39;localhost&#39; (using password: YES)

[[email protected] native]# mysql -uhive -pEnter password: ERROR 1045 (28000): Access denied for user 'hive'@'localhost' (using password: YES)[[email protected] native]# mysql -uroot -pEnter password: Welcome to the MySQL monitor.  Commands end with

升级到macOS 10.12 mysqlb报错ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

系统升级到macOS 10.12后启动mysql后,在终端输入mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES/NO) 解决办法1 在系统偏好设置里关闭mySQL2 $ cd /usr/bin3 $ sudo mysqld_safe --skip-grant-tables4 再打开一个终端$ mysqlmysql> use mysql;mysql> UPDATE

MySQL使用错误解决:ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

解决方法: ⑴打开mysql中的my.ini(如果没有就将my-default.ini复制一份,并修改为my.ini): ⑵在[mysqld]下面空白行直接添加skip-grant-tables: ⑶重启mysql,在cmd页面输入mysql,按回车键即可. 注:这会使你的mysql无法设置密码,但对个人使用而言这岂不是更省了一步! MySQL使用错误解决:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using p

ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES)

To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -