1045-access denied for user ' xxx@localhost '

Source: Internet
Author: User
Tags exception handling


The exception handling

1045-access denied for user ' [email protected] '



The tool used here is MySQL, Navicat for MySQL. After the connection is created, an exception is generated when the connection is opened.

1045-access denied for user ' [email protected] '. There are usually two types of this situation.

solution, divide it into the following two scenarios:

First, if the user knows his username and password.

1.1045-access denied for user ' [email protected] ' (using Password:yes)

Cause: A user password has been entered to create a connection user name, a user password error, or a missing user name.

Workaround: Modify the user name/user password. the user password here is set to the user password for msql installation, and the user name is used by default .


2.1045-access denied for user ' [email protected] ' (using Password:no)

Cause: The connection created does not have a user password.

Workaround: Add the user password. User Password is the user password that you set when you install MySQL. The user name uses the default user name .


Second, if users do not know their user name and user password.

1, first uninstall MySQL, completely uninstall the following steps (recommended to restart the computer after the uninstall):


I> Open Control Panel----programs and features-->mysql server uninstall;


Ii> under the installation path, locate the remaining files after uninstallation and delete them. such as: C:\Program Files\mysql, this time the MySQL folder is deleted.


iii> Delete the data files generated when MySQL is installed, usually by default in C:\ProgramData\MySQL, the MySQL folder is deleted. Note: Often people forget to delete this folder, causing the second installation to fail.


iv> The most important uninstall, check the registry for any remaining MySQL related files. Use the DOS command regedit to open the registry or go to the C:\Windows folder to find the Regedit.exe, find and delete the file:

Hkey_local_machine/system/controlset001/services/eventlog/application/mysql

Hkey_local_machine/system/controlset002/services/eventlog/application/mysql
Hkey_local_machine/system/currentcontrolset/services/eventlog/application/mysql


2, install MySQL (recommended to complete the uninstall after the restart of the computer after installation):

I> installation of the detailed tutorial, http://www.jb51.net/article/23876.htm;

ii> at this time to get the installation process, 650) this.width=650; "Src=" http://s5.51cto.com/wyfs02/M02/8C/7A/wKiom1htvQ_ Hu5voaafjtuth7s0602.png "title=" qq picture 20170105112636.png "alt=" Wkiom1htvq_hu5voaafjtuth7s0602.png "/>.


3. In the connection created in Navicat for MySQL, connect properties-user name (default)-User password (the user password set in step 2).


This article is from the "in the Eyes of the Sun" blog, please be sure to keep this source http://wang963825.blog.51cto.com/8695943/1889225

1045-access denied for user ' [email  protected] '

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.