Bobcares

Here are the top 2 causes of phpMyAdmin error 1045 & it’s solutions

by | Mar 2, 2019

Everyone wants to make database changes in just one click.

That’s why, phpMyAdmin becomes an inevitable tool for website owners.

However, phpMyAdmin can sometimes show weird errors which are difficult to tackle. One such problem is “Error 1045 in phpMyAdmin“.

At Bobcares, we help server owners resolve these errors as part of our Dedicated Support Services.

Today, let’s discuss the top 2 reasons for this error and how we fix them.

 

phpMyAdmin error 1045 – A Brief Explanation

Before we move on to the reasons, let’s first get a brief idea of this error.

Customer’s usually see this error when they try to access phpMyAdmin to manage the databases. For instance, users see the following error in the phpMyAdmin interface.

phpmyadmin error 1045

phpMyAdmin error #1045

 

This means that phpMyAdmin tried to connect to the MySQL server, but the server rejected the connection.

 

phpMyAdmin error 1045 – Causes & Solutions

Now, let’s see the common reasons for this error and how our Support Engineers fix them.

1) Incorrect password

This is the one of the most common reasons for the phpMyAdmin error 1045. A typo in the username or password while accessing the phpMyAdmin panel results in this error.

Similarly, we’ve seen instances where customers reset the MySQL root password or MySQL user password, but forget to update the changes in the phpMyAdmin configuration. This can also create problems.

 

Solution

Firstly, our Support Engineers get the MySQL username and password from the customer. We then use the below command to access the MySQL server from console.

mysql -u user -ppassword

 

Replace user with MySQL username and password with MySQL password.

If the logins work, the next step is to check whether these logins are working for phpMyAdmin. If not, we can make sure that these logins are not updated in the phpMyAdmin configuration.

So, our Database Experts access the phpMyAdmin configuration file and add the correct username and password in the config.inc.php file.

For example, on a local WAMP server, the location of config.inc.php will be C:\wamp\apps\phpmyadminx.x.x. Similarly, on Plesk servers, this location will be /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php.

Here, our Support Experts modify the following parameters and ensure that correct username and password is used.

$cfg['Servers'][$i]['user'] = 'root'; //MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password

 

In some cases, we change auth_type parameter for the logins to work.

$cfg['Servers'][$i]['auth_type'] = 'cookie'

 

Finally, we clear the browser cookies to refresh the data.

On the other hand, if the MySQL logins doesn’t work, we reset the MySQL user password and update the new one in the phpMyAdmin configuration.

For example, in cPanel servers, we reset the user password from Databases > MySQL Databases > Current Users. Similarly, we reset the MySQL root password after starting the MySQL in safe mode.

UPDATE mysql.user SET Password=PASSWORD("EnterYourPasswordHere") WHERE User="root";
FLUSH PRIVILEGES;

 

2) Insufficient privileges

Similarly, another common reason for this error is the insufficient privileges for the database user that’s trying to connect to the database. For example, customers receive an error like below.

#1045 - Access denied for user 'user'@'localhost' (using password: YES)

 

This means that the database user ‘user‘ is not permitted to access the database.

Solution

Now, let’s see what our Support Engineers do in these cases.

Here, we make sure that proper privileges are given for the user to access the database. For example, we assign proper privileges to the database user using the below command.

GRANT ALL PRIVILEGES ON *.* TO user@'localhost' IDENTIFIED BY 'password' with grant option;

 

This will grant all privileges to the database user ‘user‘ on the selected database. Later, we save these privileges using the below command.

FLUSH PRIVILEGES;

 

Likewise on cPanel servers, we change the privileges of the user from cPanel > Mysql databases > Current databases > Privileged users > Click on the database user.

[Need an Expert to fix this MySQL error on your server? Click here and get one of our Database Experts to fix it for you.]

Conclusion

In short, phpMyAdmin error 1045 occurs mainly due to typo errors in MySQL username or password, insufficient privileges of the database user and so on. Today, we’ve discussed the top 2 reasons for this error and how our Dedicated Support Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF