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

centos 安装mysql成功后

首次使用root登录发生:Access denied for user: 'root@localhost' (Using password: YES)  

原因是mysql初始db中的mysql库user表中root密码为空

因此你需要修改root密码

首先执行:mysql -u root 

进入mysql 库命令行

然后进入mysql库:use mysql;

进入后再执行修改密码即可:update user set password=password('aaa') where user='root'

时间: 2024-08-02 20:24:55

Access denied for user: 'root@localhost' (Using password: YES)的相关文章

mysql修改密码后报错:ERROR 1045:Access denied for user:'root@localhost'(using password:YES)

  重装了mysql,修改了密码,却发现无法连接,报错:Access denied for user 'root'@'localhost' (using password:YES)       查找资料后,大概是说没有给root设置权限,修复方法如下:      1.停止mysql服务,最简单办法:打开任务管理器--服务,关闭MySql.      2.建立一个txt文件mysql-init.txt,本次放在C:\下.      3.txt文件输入:SET PASSWORD FOR 'root'

mysql-关于MySQL,Access denied for user 'root '@

问题描述 关于MySQL,Access denied for user 'root '@ 各位大神帮帮忙,Access denied for user 'root '@'192.168.1.102' (using password: YES) 这个问题怎么回事呀,网上搜的解决方法都没有作用,来个大神帮帮忙,谢谢了!我是在自己的项目中登录,然后调用里面的与数据库交互的方法时报错了 解决方案 解决方案: 1.打开MySQL目录下的my.ini文件,在文件的最后添加一行"skip-grant-tabl

(28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)

  在一台测试服务器测试Python脚本时,执行Python脚本时报如下错误:        主要错误信息为"operation the sql fail!1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)". 部分测试脚本如下所示,如下所,mysql.connector.connect的host为127.0.0.1 其它账号信息做了脱敏处理.   def record_server

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) root@mysql ~]# mysql -p -u root Enter password:  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) ERROR 1045 (28000): Access denied

mysql报错 Access denied for user 'root'@'localhost' (using password: YES)

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)at com.mysql.jdbc.MysqlIO.checkErrorPa

failed: Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/innobackupex lin

[root@t1 /]#  innobackupex --user=root --password /mydata/data /tmp/dir/ InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved. This software is published under

ERROR: Upgrade faifailed bin/mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost'

环境: centos 6.5  mysql 5.5.20 升级 5.6.25 报错: mysql升级报错: mysql.time_zone_transition_type                    OK mysql.user                                         OK Running 'mysql_fix_privilege_tables'... Running 'mysqlcheck with default connection argu

mariadb 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@localhost /]# systemctl stop mariadb.service[root@localhost /]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & [1] 46043[root@localhost /]# 150131 03:15:27 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.150131 03:15:27

JSP连接MySQL时出现--错误:Access denied for user 'root'@'localhost' (using password: YES)'解决方案

用代码进行用户验证的时候总是出现这个错误,翻译一下,应该是root用户的是权限的问题没有放开. 那就想办法解决一下吧,具体的来说可以有这样的几种方式. 解决方法,首先想到的是先重启一下MySQL服务吧,但是试了一下,发现这并没有什么用. 网上搜索了一下,相关于MySQL的权限的释放和管理问题,找到一个比较好的答案: //首先计入到mysql的客户端命令行. //然后 grant all privileges on *.* to 'root'@'localhost' identified by '