Description of the error problem:
ERROR 1045 (28000): Access denied for user ' ODBC ' @ ' localhost ' (using Password:no)
ERROR 1045 (28000): Access denied for user ' ODBC ' @ ' localhost ' (using Password:yes)
Workaround for the above two errors under Windows
Workaround:
1, find the configuration file My.ini, and then open it, you can choose to open with notepadd++
2. After opening, search mysqld keyword
When found, add skip-grant-tablesbelow mysqld to save the exit.
PS: If prompted not to save, you can cut the file to the desktop, change the save and then copy to the MySQL directory
# for advice The change settings
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# * * * Don't EDIT this FILE. It ' s a template which'll be copied to the
# * * * default location during install, and would be replaced if you
# * * * * Upgrade to a newer version of MySQL.
[Mysqld]
Skip-grant-tables
# Remove Leading # and set to the amount of RAM for the most important data
# Cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove Leading # to turn on a very important data integrity option:logging
# Changes to the binary log between backups.
# Log_bin
# These is commonly set, remove the # and set as required.
Basedir = D:\SoftWare\MySQL\mysql-5.7.11-winx64
DataDir = D:\SoftWare\MySQL\mysql-5.7.11-winx64\Data
Port = 3306
# server_id = ...
# Remove Leading # To set options mainly useful for reporting servers.
# The server defaults is faster for transactions and fast selects.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
Sql_mode=no_engine_substitution,strict_trans_tables
This is used to skip the password problem, but it's not going to be solved completely!
3. Restart MySQL Service
In any path directory, you can shut down/restart the MySQL service. (because, before, the global environment variable has been configured)
net stop MySQL
net start MySQL
4. Enter the database and reset the password.
Mysql-u root-p Enter
No tube password Enter
mysql> use MySQL; Enter
mysql> Update Mysql.user Set Authtntication_string=password (' rootroot ') where user=' root '; (Password set yourself)
mysql> flush Privileges; Refreshing the database
Mysql> quit;
5, password reset success, modified, and then modify the My.ini this file, we just joined the "Skip-grant-tables" this line to delete, save and restart the MySQL service will be OK.
6, restart the MySQL service, and login to the MySQL user, the user is root, password is rootroot.
d:\software\mysql\mysql-5.7.11-winx64\bin> net stop MySQL
d:\software\mysql\mysql-5.7.11-winx64\bin> net start MySQL
D:\software\mysql\mysql-5.7.11-winx64\bin>mysql-u root-p
Enter Password:rootroot
Thanks to the following bloggers:
Http://www.ithao123.cn/content-10746582.html
When MySQL logs on, error 1045 (28000): Incorrect resolution