ERROR1045 (28000): Accessdeniedforuser & #39; ODBC &

Source: Internet
Author: User
When mysql was just used by the hacker, I always encountered this problem. It was really depressing and finally found the cause .. C: ProgramFilesMySQLMySQLServer5.0binmysqlERROR1045 (28000): AccessdeniedforuserODBC @ localhost (usingpassword:

Http://blog.sina.com.cn/s/blog_586a1f3e01000b82.html just use mysql, always encounter this problem, really depressed, finally find the reason .. c: \ Program Files \ MySQL Server 5.0 \ binmysql ERROR 1045 (28000): Access denied for user 'odbc '@ 'localhost' (usingpassword:

Http://blog.sina.com.cn/s/blog_586a1f3e01000b82.html


When I was just using mysql, I always encountered this problem. It was really depressing. I finally found the reason ..
C: \ Program Files \ MySQL Server 5.0 \ bin> mysql
ERROR 1045 (28000): Access denied for user 'odbc '@ 'localhost' (usingpassword: N
O)


Solution:
Step 1:

C: \ Program Files \ MySQL Server 5.0 \ bin> mysql-u root-p
Enter password :******
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 28 to server version: 5.0.24a-community-nt

Type 'help; 'or' \ H' for help. Type '\ C' to clear thebuffer.

Step 2:
C: \ Program Files \ MySQL Server 5.0 \ bin> mysql
Mysql> status

Normal use ....

------------------------------------------------

My system is ubuntu6.06. The newly installed mysql always has an error prompt when entering the mysql tool:
# Mysql-uroot-p
Enter password:
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)

Use the methods described on the Internet to change the password of the root user:
# Mysqladmin-uroot-p password 'newpassword'
Enter password:
Mysqladmin: connect to server at 'localhost' failed
Error: 'Access denied for user' root' @ 'localhost' (using password: YES )'

Now I have found the solution as follows (Please test method 3 first, thank you !) :
Method 1:
#/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') whereUSER = 'root ';
Mysql> flush privileges;
Mysql> quit

#/Etc/init. d/mysql restart
# Mysql-uroot-p
Enter password: <输入新设的密码newpassword>

Mysql>


Method 2:
Directly use the username and password provided in the [client] section of the/etc/mysql/debian. cnf file:
# Mysql-udebian-sys-maint-p
Enter password: <输入[client]节的密码>
Mysql> UPDATE user SET Password = PASSWORD ('newpassword') whereUSER = 'root ';
Mysql> flush privileges;
Mysql> quit

# Mysql-uroot-p
Enter password: <输入新设的密码newpassword>

Mysql>


Method 3:
I have not tested this method, because the default password of my root user has been modified by me. If you have time to test it, let me know the result. Thank you !!
# Mysql-uroot-p
Enter password: <输入 etc mysql debian.cnf文件中[client]节提供的密码>

At this point, many problems have been solved!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.