英文:
Java MariaDB connection error: Access denied for user 'root'@'localhost'
问题
我无法启动我的程序,因为每当我尝试使用我的MariaDB打开数据库连接时,我会收到以下错误。
java.sql.SQLException: 无法连接:访问被拒绝,用户'root'@'localhost'(使用密码:是) 原因:org.mariadb.jdbc.internal.common.QueryException: 无法连接:访问被拒绝,用户'root'@'localhost'(使用密码:是)
我尝试重新启动计算机,重启MariaDB,甚至重新安装MariaDB,但它们都没有起作用。有趣的是,我可以通过HeidiSQL以某种方式连接到数据库。真是有趣,因为上次我也遇到了同样的问题,我也无法通过HeidiSQL连接。解决方案很简单,我需要重新启动MariaDB,但现在它不起作用。
我使用的是Windows 10,Java 14,MariaDB 10.4。
这似乎很重要,因为我已经在所有相关问题上进行了检查,但仍然无法解决这个问题。
有人之前遇到过这个问题吗?
英文:
I can't start my program, because whenever I try to open the datebase connection
with my MariaDB I get this error.
java.sql.SQLException: Could not connect: Access denied for user 'root'@'localhost' (using password: YES)
Caused by: org.mariadb.jdbc.internal.common.QueryException: Could not connect: Access denied for user 'root'@'localhost' (using password: YES)
I tried to reboot my computer, restart MariaDB, even reinstalling MariaDB, but none of them worked.
Interestingly I can somehow connect to the database with HeidiSQL.
It's funny, because last time I had the same problem and I couldn't connect with HeidiSQL either. The solution was simple, I had to restart MariaDB, but now it doesn't work.
I'm using Windows 10, Java 14, MariaDB 10.4.
This seems important as I've checked on all related issues and I still couldn't solve the problem.
Has anyone faced with this this issue before?
专注分享java语言的经验与见解,让所有开发者获益!
评论