ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: Y
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)
windows下,以上两个错误的解决方法
打开后,搜索mysqld关键字
找到后,在mysqld下面添加skip-grant-tables,保存退出。
PS:若提示不让保存时,可以将该文件剪切到桌面,更改保存后再复制到mySQL目录下


保存后重启mySQL


然后运行cmd
输入mysql -u root -p就可以不用密码登录了,出现password:的时候直接回车可以进入。

1.进入mysql数据库:
mysql> use mysql;Database changed
2.给root用户设置新密码,蓝色部分自己输入:mysql> update user set password=password("123456") where user="root";Query OK, 1 rows affected (0.04 sec)Rows matched: 1 Changed: 1 Warnings: 0
3.刷新数据库mysql> flush privileges;Query OK, 0 rows affected (0.01 sec)
4.退出mysql:mysql> quitBye
PS:123456为新密码,用户可根据自己需要修改成自己的密码

改好之后,再修改一下my.ini这个文件,把我们刚才加入的"skip-grant-tables"这行删除,保存退出再重启mysql服务就可以了。