Содержание
- Ошибка ODBC. SQLSTATE: 28000 Номер ошибки: 18456
- Ошибка ODBC. SQLSTATE: 28000 Номер ошибки: 18456
- Способы решения проблемы:
- Верная инициализация соединения:
- Настройки пользователя в управляемом приложении:
- Пример задания общих параметров:
- Login failed for [SQLSTATE 28000] (Error 18456) the step failed SQL Server
- Details of Error:
- Cause of Error:
- Resolution:
- ‘SQL error 1045 sqlstate 28000’ – Here are the steps to fix it
- ‘SQL error 1045 sqlstate 28000’ – What this means?
- ‘SQL error 1045 sqlstate 28000’ – Causes & Fixes
- 1) Typo in username and password
- Solution
- 2) Accessing from wrong host
- Solution
- 3) User doesn’t exist
- Solution
- 4) Existence of Anonymous users
- Solution
- 5) Insufficient privileges
- Solution
- Conclusion
- PREVENT YOUR SERVER FROM CRASHING!
- 1 Comment
- Sql error sqlstate 28000
- Question
- All replies
- Sql error sqlstate 28000
- Answered by:
- Question
- Answers
- All replies
Ошибка ODBC. SQLSTATE: 28000 Номер ошибки: 18456
Ошибка ODBC. SQLSTATE: 28000 Номер ошибки: 18456
При использовании внешнего источника данных в 1С 8.3 возникает сообщение с кодом 18456.
Чаще всего такое бывает при переходе на 8.3 — данный код говорит об ошибке авторизации в момент подключения.
Даже, если ранее этот код работал на 8.2, здесь он не работоспособен.
Способы решения проблемы:
- Проверка написания пользователя, пароля
- Явное указание при соединении имени и пароля, связано скорее всего с тем, что в платформе появилась возможность хранить настройки соединения для каждого пользователя
Верная инициализация соединения:
Настройки пользователя в управляемом приложении:
Все функции/ Стандартные/Управление внешними источниками данных

Далее можно задать общие настройки параметры соединения или индивидуальные для пользователя

Пример задания общих параметров:

Реклама — величайшее искусство XX века.
Источник
Login failed for [SQLSTATE 28000] (Error 18456) the step failed SQL Server

Table of Contents
Details of Error:
Executed as user: DomainLoginName. Login failed for user ‘DomainLoginName’. [SQLSTATE 28000] (Error 18456). The step failed.
or below ODBC Data Source SQL Server Connection – Login Failed For User
Connection failed:
SQLState: ‘28000’
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ‘UserName’.
Cause of Error:
This error is encountered when SQL Agent Service does not have permissions required to run the job. Or When we try ODBC Data Source SQL Server Connection Login Failed message when Login used for connection does not have permission needed.
Resolution:
First if this message is caused by SQL Agent Job connection then we will need to check the source SQL server agent service account name from Services MMC or Server manager or SQL Server Cofiguration Manager in Services-> Go to the SQL Server Agent Service –> properties –> Check the logon tab where we can find the account name.
Now check and add the login we found above or if the its caused by ODBC Data Source SQL Server Connection then add the Login used in ODBC to the SQL server instance by checking in Security tab –>logins with necessary permission on your target machine where its trying to connect or run the job on. This can be same instance or different instance on same or some other server.
Источник
‘SQL error 1045 sqlstate 28000’ – Here are the steps to fix it
Server errors are annoying, especially when they are cryptic like “sql error 1045 sqlstate 28000″.
The message contains some error codes.
But, what’s the real problem here?
At Bobcares, we help website owners resolve complex errors like “sql error 1045 sqlstate 28000“ as part of our Outsourced Hosting Support services.
Today, let’s discuss the top 5 reasons for this error and we fix them.
‘SQL error 1045 sqlstate 28000’ – What this means?
Before we move on to the reasons for this error, let’s first get an idea of this error.
Website owners face this error when querying data from the SQL server.
For instance, the complete error message looks like this:
This error shows that the MySQL server disallows the user to connect to it from localhost or 127.0.0.1.
‘SQL error 1045 sqlstate 28000’ – Causes & Fixes
In our experience managing servers, we’ll see the major causes of this error and how our Dedicated Support Engineers fix it.
1) Typo in username and password
This is the most common reason for the error “sql error 1045 sqlstate 28000″.
Users may type wrong username and password while connecting to the database.
Therefore, SQL server can’t identify the authenticity of the account.
Solution
In such cases, we help website owners reset the database user password.
For example, in cPanel servers, we reset the database user password from Databases > Mysql databases > Current Users.

Mysql databases option in cPanel
Also, for database driven websites like WordPress, Magento, etc., we update the new database username and password in the website configuration files.
For example, in the Magento application, we update the database name, username and password in the “app/etc/local.xml” file.
In some cases, website owners get errors like this:
This is because, the root session don’t know the password of mysql root user.
And, it can be probably a mis-typed password during the initial setup.
Here, our Hosting Engineers reset the admin/root password after starting the MySQL in safe mode.
For example, we use the below command to reset the root password in safe mode.
2) Accessing from wrong host
MySQL uses host based restrictions for user access to enhance security.
In other words, MySQL allows user access only from hosts defined in the MySQL user table.
So, any access from remote machines whose hostnames are not defined in this user table will bounce with the error “sql error 1045 sqlstate 28000”
Solution
First, our Hosting Engineers check whether the remote host is allowed in the MySQL user table.
If not, we add the hostname of the remote machine in the MySQL user table.
For instance, we use the below command to add a host in the MySQL user table.
Here, hostname is the hostname of the remote machine, and username is the MySQL user.
We’ve seen cases where server owners use wildcards(%) in host field which gives universal access to this user.
But, this is not a good practice as there is a security risk that user can access the database from any hosts.
In addition to that, due to security concerns, we always disable accessing root user from remote machines.
[You don’t have to be a MySQL expert to keep your websites online. We have experienced MySQL admins available 24/7.]
3) User doesn’t exist
Similarly, this error “sql error 1045 sqlstate 28000” occurs when the user trying to access the database doesn’t exist on the MySQL server.
For example, if you access MySQL using a testuser that doesn’t exist, you can see the following error.
Solution
In such cases, our Support Engineers first check whether the user exists in the MySQL user table.
If not, we check the user’s requirement to access the database and if it is valid, we create a user with that username.
4) Existence of Anonymous users
Website owners face this error when there are anonymous MySQL users like ”@localhost or ”@127.0.0.1.
That is, when a client tries to connect to the database, the MySQL server looks through the rows in the user table in a sorted order.
The server uses the first row that matches the most specific username and hostname.
So, here the anonymous user (‘ ‘@localhost) precedes any other users like ‘user’@localhost when connecting from localhost.
And, use the anonymous user password to connect to the server.
Finally, the result is “sql error 1045 sqlstate 28000“.
Solution
Our Hosting Engineers check the MySQL user table and remove the anonymous user account.
For example, we use the below command to remove the anonymous user from MySQL.
5) Insufficient privileges
Likewise, insufficient privileges for the user to access the database can also result in this error.
Solution
In such cases, we assign proper access rights for the user to access the database.
For example, in cPanel servers, we manage user privileges from:
cPanel > Mysql databases > Current databases > Privileged users > Click on the database user.

Granting user privileges in cPanel
[Struggling with database user permissions and privileges? Our MySQL Experts are here for your help.]
Conclusion
In short, “sql error 1045 sqlstate 28000” may occur due to insufficient database privileges, wrong username or password, etc. Today we’ve discussed the top 5 reasons for this error and how our Dedicated Support Engineers fix it.
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.
Excellent Article very exciting and well presented.
Источник
Sql error sqlstate 28000

Question




The common causes for login failed are wrong password or a bad database name. Check the SQL Server error log, which will provide more information about the specific cause. Details of authentication errors are not returned to the client for security reasons.
Also, don’t use a sysadmin rule member account for routine application access. Instead, use one with only the permissions needed by your app.
Dan Guzman, Data Platform MVP, http://www.dbdelta.com
- Proposed as answer by Will_Kong Microsoft contingent staff Monday, July 10, 2017 5:11 AM




Sql server error log «Login failed for user «sa» Reason: Password did not match that for the login provided»
According to the error log, you may change the password of the user «sa» in the SQL Server. Or you could do as Dan said, create a new account with some permissions for your applications. Or it is probably the problem of string password, so you may refer to https://docs.microsoft.com/en-us/sql/relational-databases/security/strong-passwords for assistance.
H ope these are helpful to you.
MSDN Community Support
Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
- Edited by Will_Kong Microsoft contingent staff Monday, July 10, 2017 5:12 AM


Sql server error log «Login failed for user «sa» Reason: Password did not match that for the login provided» i dont understant why it did not mach if i have another database on the same app working perfectly.
Maybe that database is on a different instance with a different password for sa?
In any case, you should absolutely not use sa in your application. That’s a complete no-no. You should use a login which has been granted the permissions needed, which at most is membership in db_datareader and db_datawriter. (But even better is that the application uses stored procedures, in which case permission to execute the stored procedures is all you need.)
Also, if this is a plain Windows client, the application should not use its own login, but the login would depend on the user, preferrably through Windows authenticationl.
Источник
Sql error sqlstate 28000
This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
Answered by:

Question


We have an application that connects to SQL 2005 thru ODBC with the following string:
When our administrators login on the workstation the application works well. But when ordinary users login they get the following error. (We only have 1 domain)
SQL Server Error: 18452
Login failed for user «. The user is not associated with a trusted SQL Server connection.
Then the standard SQL Server Login window pops up asking for the Login ID and Password. On the window the ‘Use Trusted Connection’ is checked and the name of the user on the workstation appears on the LoginID. What we do is uncheck the ‘Use Trusted Connection’ then login using the credentials above.
Need help on this one please. Thanks.
Answers


Try sp_adduser to make sure that the login is identified as trusted by SQL Server.




Checked the setting, it is on SQL Server ad Windows auth mode.


Try sp_adduser to make sure that the login is identified as trusted by SQL Server.




I am facing Same problem and it is as follows:-
There are two servers ‘A’ and ‘B’. At server ‘A’, there is installed Window server at server ‘B”, there
is installed Window Server2000. And both servers have SQL SERVER 2000. I have created link server from A to B. I have to insert data into table of server ‘B’ from server ‘A’. When I used directly insert command like
Insert into [server name (B)]. [Database]. [Owner] .[ table name]
Select * from [server name (A)]. [Database]. [Owner] .[ table name]
The data is inserted successfully.
But when I created trigger (for insertion) on table of server (A) (because I want as there is insertion in the table of server( A), rest
Records that are not in the table of server (B ) , are automatically inserted into the table of server(B)).
The Insertion is not complete and there is shown system message which is as follows:-
“ Server: Msg 7391, Level 16, State 1, Procedure rms_trn_con_details_insertion , Line 6
The operation could not be performed because the OLE DB provider ‘SQLOLEDB’ was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator . ] ”
I have searched in Google , I found that there are problems in heterogeneous system.
But till today, I have no solution for it. Temporary, I find solution through Job Scheduling.
Try to find out solution for this problem.
Regards,
Nikhil Chaturvedi
Источник
Ошибка 28000 80040E4D: Login failed for user ‘sa’, что делать
Данная ошибка говорит сама за себя, но это не значит, что всё может быть просто. Мне потребовалось час, чтобы выяснить реальную причину.
- Менял пароли;
- прописывал права;
- нового пользователя создавал;
- перезапускал службы;
- грешил на firewall, хотя код ошибки был бы другой.
Для многих причина может очевидна, но я каждый день новые сервера не подключаю.
Основная причина
Неверное имя пользователя или пароля для базы данных на MSSQL
Решение
- Внесите пароль в свойства базы сервера 1С повторно (если вы не давно его меняли или добавляете новую базу).
- Проверьте раскладку.
- Обратите внимание: все ли символы вводятся.
- Замените пароль на базе данных непосредственно в консоли MS SQL Management
Альтернативная причина
У вас отключена авторизация на уровне SQL сервера при установке или после, об этом он пишет в логе, но не в тексте ошибки.
В свойствах сервера необходимо включить режим «SQL Server and Windows Autentification mode»
Включите: тогда после перезапуска сервера или службы MSSQLSERVER всё должно быть отлично.
Впервые в истории планеты Земля все люди во всех странах задались единой целью: заработать столько денег, чтобы уподобиться героям рекламы.
08.12.13 — 14:06
Здравствуйте, срочно нужна помощь, я забыл пароль пользователя sa на сервере SQL 2008 и решил его поменять, для того чтобы создать новую базу 1с, но после его смены я утратил доступ к старой базе данных, как можно решить эту проблему, как теперь можно получить доступ к старой базе ? Вот само сообщение об ошибке
Ошибка при выполнении запроса POST к ресурсу /e1cib/login:
по причине:
Ошибка при выполнении операции с информационной базой
Ошибка СУБД:
Microsoft SQL Server Native Client 10.0: Ошибка входа пользователя «sa».
HRESULT=80040E4D, SQLSrvr: SQLSTATE=28000, state=1, Severity=E, native=18456, line=1
1 — 08.12.13 — 14:15
хз. может MSSQL переустановить и сделать новый пароль
2 — 08.12.13 — 14:18
(0)ищи ответ на sql.ru
3 — 08.12.13 — 14:27
Я думаю переустановка SQL не решит проблему так как сам sql я запускаю от имени sa, а вот 1с уже не запускается, потому что видимо пароль там остался в таблицах старый прописан и он не совпадает с нынешним и поэтому не заходит, как вот теперь его там поменять, вот это вопрос
4 — 08.12.13 — 14:29
грохни ссылку на базу и создай снова
5 — 08.12.13 — 14:32
Денис можно чуть поподробнее, создать из 1с чтоли с таким же именем то есть ?
6 — 08.12.13 — 14:32
Точно блин
7 — 08.12.13 — 14:32
Сейчас попробую
8 — 08.12.13 — 14:43
Нет не помогает
9 — 08.12.13 — 14:59
Если ты можешь зайти в менеджмент сдудио с правами админа, создай пользователя 1с, например, дай ему права на базы.
Удали все базы из консоли сервера предприятия и подключи заново
10 — 08.12.13 — 15:05
(8) значит не то делаешь. убей базу (это и есть ссылка) в консоле сервера 1С (не на sql-сервере!) и создай заново с новым паролем подключения к бд.
11 — 08.12.13 — 15:07
и вообще, запускать базы 1с из под sa — ламерство какое-то.
наверное еще сами файлы баз в програмфайлс лежат? хаха
12 — 08.12.13 — 15:48
Описываю свои действия. Я удаляю ссылку в 1с окне запуска, добавляю новую, все прописываю и не важно что я прописываю в поле логин и пароль, он все равно ругается на доступ пользователя SA. Я пробовал и админа туда писать, все равно ошибка входа пользователя SA
13 — 08.12.13 — 15:51
(12) воскресный тупешь? Тебе черным по-русски написали, что в консоле сервера предприятия
14 — 08.12.13 — 15:58
)))) Пардон, да, затупил малость, сейчас буду исправляться и пробовать ))
15 — 08.12.13 — 16:43
Если я в консоле сервера, то сама база не удалится же, а то он мне тут вопросы задает удалить базу данных, очистить базу данных ? Я просто первый раз с консолью работаю
16 — 08.12.13 — 16:43
Если я в консоле сервера удаляю
17 — 08.12.13 — 17:29
Поменял пароль доступа к базе в консоле, теперь удалить не получается потому что пароль почему то стал спрашивать при доступе к базе из консоли и пароль который вводил почему то не подходит, блин что делать ?
18 — 08.12.13 — 17:51
А, понял она требует пароли самих пользователей 1с
19 — 08.12.13 — 18:09
Короче проблема решена, убивать базу в консоле сервера 1с нельзя, это приводит к физическому ее удалению, я поменял там пароль пользователя БД и прописал заного путь к базе в окне запуска 1с и все подключилось. Всем огромное спасибо! )
20 — 08.12.13 — 18:25
песец
21 — 08.12.13 — 18:32
)))) Я сам в шоке )))
22 — 08.12.13 — 18:59
(19) вам за такую работу еще и деньги наверное платят?
23 — 08.12.13 — 22:11
Fyn, за что кому платят вас не касается, а вам походу платят за острый юмор, которым вы наверно только учитесь пользоваться. Если я здесь задал пару бестолковых вопросов это еще не значит что работа выполняется плохо. Умник тоже мне нашелся.
24 — 08.12.13 — 23:02
(23) дык смешно, похоже вам с самого начала надо было ввести пароль к базе, а вы тут развели…
25 — 09.12.13 — 22:32
Да, вышло конечно глуповато, и что дальше, на ошибках учатся, главное делать правильные выводы и больше их не повторять, здесь мне вообще советовали базу там грохнуть, грохнул бы я ее в консоле и похерилась бы вся инфа, пришлось бы восстанавливать. Дельный совет дали «убей базу да и все». Почему то этого «смешного» решения никто не заметил, просто я с самого начала совсем забыл про эту консоль, нужно было сразу там смотреть.
ДенисЧ
26 — 09.12.13 — 22:42
«убивать базу в консоле сервера 1с нельзя, это приводит к физическому ее удалению»
Какая чушь…. Оно же спрашивает, причём по-русски, что делать с базой…..

Details of Error:
Executed as user: DomainLoginName. Login failed for user 'DomainLoginName'. [SQLSTATE 28000] (Error 18456). The step failed.
or below ODBC Data Source SQL Server Connection – Login Failed For User
Connection failed:
SQLState: '28000'
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'UserName'.
Cause of Error:
This error is encountered when SQL Agent Service does not have permissions required to run the job. Or When we try ODBC Data Source SQL Server Connection Login Failed message when Login used for connection does not have permission needed.
Resolution:
First if this message is caused by SQL Agent Job connection then we will need to check the source SQL server agent service account name from Services MMC or Server manager or SQL Server Cofiguration Manager in Services-> Go to the SQL Server Agent Service –> properties –> Check the logon tab where we can find the account name.
Now check and add the login we found above or if the its caused by ODBC Data Source SQL Server Connection then add the Login used in ODBC to the SQL server instance by checking in Security tab –>logins with necessary permission on your target machine where its trying to connect or run the job on. This can be same instance or different instance on same or some other server.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit «Cookie Settings» to provide a controlled consent.
- Remove From My Forums
-
Question
-
The following bcp command using xp_cmdshell doesn’t work returning SQL Connection error. Looks like bcp command doesn’t take Windows-Authenticated ID.
exec master.dbo.xp_cmdshell ‘bcp [DBTest].[dbo].TableTest1 IN «\server12d$test.csv» -S»Server12isnt12″ -U»Domain1test» -P»Test$12″ -c -t»,»‘SQLState = 28000, NativeError = 18456
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ‘Domain1test’.However, the following works, which uses SQL-Authentication Login ID.
exec master.dbo.xp_cmdshell ‘bcp [DBTest].[dbo].TableTest1 IN «\server12d$test.csv» -S»Server12isnt12″ -U»test» -P»test» -c -t»,»‘Is there anyway to use Windows-Authenticated ID for bcp command? Please advise.
Answers
-
a) If using SQL Server authentication in which case you have to specify your SQL Server login and password, say your SQL Server login ID is user and password is pass then you should specify -Uuser -Ppass.
b) For using Windows authentication, then just specify -T and it will used trusted connection (do not use –U it will force BCP to sql authentication )
does the following work?
exec master.dbo.xp_cmdshell ‘bcp [DBTest].[dbo].TableTest1 IN «\server12d$test.csv» -S»Server12isnt12″ -T -c«,»‘
-
Marked as answer by
Wednesday, November 18, 2009 10:15 PM
-
Marked as answer by
Hi,
We are working on SQL Server 2008 R2 and our application is built on Sybase PowerBuilder 12.0 and this a client server application.
Whenever we are trying to connect from client machine to server machine through Windows Authentication we are getting error like below,
Cannot Connect to database SQLERRTEXT.SQLSTATE = 28000 Microsoft SQL Server Native Client error 11.0 Login Failed for user, Please contact your administrator.
We have taken maximum care in connectivity string like below for Windows Authentication,
DBParm=PROVIDER=’SQLNCLI11′,DATASOURCE=’XXXSQLEXPRESS2008′,PROVIDERSTRING=’DataBase=XXXXX’,IntegratedSecurity=’SSPI'»
We have also configured the server Authentication mode in,
Windows Authentication
Windows and SQL Server Authentication.
But our all efforts are getting failed to establish a connection through Windows Authentication whereas the connectivity is fine when we use SQL Server Authentication.
Please help us to get this error resolved ASAP. We are looking only for Windows Authentication only.
NOTE: Our client machine is Windows 8 and our Server runs on Windows 7. So whenever we are executing application from Windows 8, the above error message is coming.
-
Изменено
27 апреля 2015 г. 15:18
Server errors are annoying, especially when they are cryptic like “sql error 1045 sqlstate 28000″.
The message contains some error codes.
But, what’s the real problem here?
At Bobcares, we help website owners resolve complex errors like “sql error 1045 sqlstate 28000“ as part of our Outsourced Hosting Support services.
Today, let’s discuss the top 5 reasons for this error and we fix them.
‘SQL error 1045 sqlstate 28000’ – What this means?
Before we move on to the reasons for this error, let’s first get an idea of this error.
Website owners face this error when querying data from the SQL server.
For instance, the complete error message looks like this:
SQLSTATE[28000] [1045] Access denied for user 'user'@'localhost' (using password: YES)
This error shows that the MySQL server disallows the user to connect to it from localhost or 127.0.0.1.
‘SQL error 1045 sqlstate 28000’ – Causes & Fixes
In our experience managing servers, we’ll see the major causes of this error and how our Dedicated Support Engineers fix it.
1) Typo in username and password
This is the most common reason for the error “sql error 1045 sqlstate 28000″.
Users may type wrong username and password while connecting to the database.
Therefore, SQL server can’t identify the authenticity of the account.
Solution
In such cases, we help website owners reset the database user password.
For example, in cPanel servers, we reset the database user password from Databases > Mysql databases > Current Users.

Mysql databases option in cPanel
Also, for database driven websites like WordPress, Magento, etc., we update the new database username and password in the website configuration files.
For example, in the Magento application, we update the database name, username and password in the “app/etc/local.xml” file.
In some cases, website owners get errors like this:
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
This is because, the root session don’t know the password of mysql root user.
And, it can be probably a mis-typed password during the initial setup.
Here, our Hosting Engineers reset the admin/root password after starting the MySQL in safe mode.
For example, we use the below command to reset the root password in safe mode.
update user set password=PASSWORD("YOURPASSWORDHERE") where User='root';
2) Accessing from wrong host
MySQL uses host based restrictions for user access to enhance security.
In other words, MySQL allows user access only from hosts defined in the MySQL user table.
So, any access from remote machines whose hostnames are not defined in this user table will bounce with the error “sql error 1045 sqlstate 28000”
Solution
First, our Hosting Engineers check whether the remote host is allowed in the MySQL user table.
If not, we add the hostname of the remote machine in the MySQL user table.
For instance, we use the below command to add a host in the MySQL user table.
update user set host='hostname' where user='username';
Here, hostname is the hostname of the remote machine, and username is the MySQL user.
We’ve seen cases where server owners use wildcards(%) in host field which gives universal access to this user.
But, this is not a good practice as there is a security risk that user can access the database from any hosts.
In addition to that, due to security concerns, we always disable accessing root user from remote machines.
[You don’t have to be a MySQL expert to keep your websites online. We have experienced MySQL admins available 24/7.]
3) User doesn’t exist
Similarly, this error “sql error 1045 sqlstate 28000” occurs when the user trying to access the database doesn’t exist on the MySQL server.
For example, if you access MySQL using a testuser that doesn’t exist, you can see the following error.
# mysql -u testuser -p Enter password: ERROR 1045 (28000): Access denied for user 'testuser'@'localhost' (using password: YES)
Solution
In such cases, our Support Engineers first check whether the user exists in the MySQL user table.
If not, we check the user’s requirement to access the database and if it is valid, we create a user with that username.
4) Existence of Anonymous users
Website owners face this error when there are anonymous MySQL users like ”@localhost or ”@127.0.0.1.
That is, when a client tries to connect to the database, the MySQL server looks through the rows in the user table in a sorted order.
The server uses the first row that matches the most specific username and hostname.
So, here the anonymous user (‘ ‘@localhost) precedes any other users like ‘user’@localhost when connecting from localhost.
And, use the anonymous user password to connect to the server.
Finally, the result is “sql error 1045 sqlstate 28000“.
Solution
Our Hosting Engineers check the MySQL user table and remove the anonymous user account.
For example, we use the below command to remove the anonymous user from MySQL.
delete from user where User = ' ';
5) Insufficient privileges
Likewise, insufficient privileges for the user to access the database can also result in this error.
Solution
In such cases, we assign proper access rights for the user to access the database.
For example, in cPanel servers, we manage user privileges from:
cPanel > Mysql databases > Current databases > Privileged users > Click on the database user.

Granting user privileges in cPanel
[Struggling with database user permissions and privileges? Our MySQL Experts are here for your help.]
Conclusion
In short, “sql error 1045 sqlstate 28000” may occur due to insufficient database privileges, wrong username or password, etc. Today we’ve discussed the top 5 reasons for this error and how our Dedicated Support Engineers fix it.
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.
SEE SERVER ADMIN PLANS
var google_conversion_label = «owonCMyG5nEQ0aD71QM»;