Ошибка 1045 phpmyadmin

Дата: 25.11.2013

Автор: Василий Лукьянчиков , vl (at) sqlinfo (dot) ru

Статистика форума SQLinfo показывает, что одной из наиболее популярных проблем является ошибка mysql №1045 (ошибка доступа).
Текст ошибки содержит имя пользователя, которому отказано в доступе, компьютер, с которого производилось подключение, а также ключевое слово YES или NO, которые показывают использовался ли при этом пароль или была попытка выполнить подключение с пустым паролем.

Типичные примеры:

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES) — сервер MySQL
— сообщает, что была неудачная попытка подключения с локальной машины пользователя с именем root и
— не пустым паролем.

ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO) — отказано в
— доступе с локальной машины пользователю с именем root при попытке подключения с пустым паролем.

ERROR 1045 (28000): Access denied for user ‘ODBC’@‘localhost’ (using password: NO) — отказано в
— доступе с локальной машины пользователю с именем ODBC при попытке подключения с пустым паролем.

Причина возникновения ошибки 1045

Как ни банально, но единственная причина это неправильная комбинация пользователя и пароля. Обратите внимание, речь идет о комбинации пользователь и пароль, а не имя пользователя и пароль. Это очень важный момент, так как в MySQL пользователь характеризуется двумя параметрами: именем и хостом, с которого он может обращаться. Синтаксически записывается как ‘имя пользователя’@’имя хоста’.

Таким образом, причина возникновения MySQL error 1045 — неправильная комбинация трех параметров: имени пользователя, хоста и пароля.

В качестве имени хоста могут выступать ip адреса, доменные имена, ключевые слова (например, localhost для обозначения локальной машины) и групповые символы (например, % для обозначения любого компьютера кроме локального). Подробный синтаксис смотрите в документации

Замечание: Важно понимать, что в базе не существует просто пользователя с заданным именем (например, root), а существует или пользователь с именем root, имеющий право подключаться с заданного хоста (например, root@localhost) или даже несколько разных пользователей с именем root (root@127.0.0.1, root@webew.ru, root@’мой домашний ip’ и т.д.) каждый со своим паролем и правами.

Примеры.
1) Если вы не указали в явном виде имя хоста

GRANT ALL ON publications.* TO ‘ODBC’ IDENTIFIED BY ‘newpass’;

то у вас будет создан пользователь ‘ODBC’@’%’ и при попытке подключения с локальной машины вы получите ошибку:

ERROR 1045 (28000): Access denied for user ‘ODBC’@‘localhost’ (using password: YES)

так как пользователя ‘ODBC’@’localhost’ у вас не существует.

2) Другой первопричиной ошибки mysql 1045 может быть неправильное использование кавычек.

CREATE USER ‘new_user@localhost’ IDENTIFIED BY ‘mypass’; — будет создан пользователь ‘new_user@localhost’@’%’

Правильно имя пользователя и хоста нужно заключать в кавычки отдельно, т.е. ‘имя пользователя’@’имя хоста’

3) Неочевидный вариант. IP адрес 127.0.0.1 в имени хоста соответствует ключевому слову localhost. С одной стороны, root@localhost и ‘root’@’127.0.0.1’ это синонимы, с другой, можно создать двух пользователей с разными паролями. И при подключении будет выбран тот, который распологается в таблице привелегий (mysql.user) раньше.

4) Аккаунт с пустым именем пользователя трактуется сервером MySQL как анонимный, т.е. позволяет подключаться пользователю с произвольным именем или без указания имени.
Например, вы создали пользователя »@localhost с пустым паролем, чтобы каждый мог подключиться к базе. Однако, если при подключении вы укажите пароль отличный от пустого, то получите ошибку 1045. Как говорилось ранее, нужно совпадение трех параметров: имени пользователя, хоста и пароля, а пароль в данном случае не совпадает с тем, что в базе.

Что делать?

Во-первых, нужно убедиться, что вы используете правильные имя пользователя и пароль. Для этого нужно подключиться к MySQL с правами администратора (если ошибка 1045 не дает такой возможности, то нужно перезапустить сервер MySQL в режиме —skip-grant-tables), посмотреть содержимое таблицы user служебной базы mysql, в которой хранится информация о пользователях, и при необходимости отредактировать её.

Пример.

SELECT user,host,password FROM mysql.user;
+—————+——————+——————————————-+
| user          | host            | password                                  |
+—————+——————+——————————————-+
| root          | house-f26710394 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| aa            | localhost       | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 |
| test          | localhost       |                                           |
| new_user      | %               |                                           |
|               | %               | *D7D6F58029EDE62070BA204436DE23AC54D8BD8A |
| new@localhost | %               | *ADD102DFD6933E93BCAD95E311360EC45494AA6E |
| root          | localhost       | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+—————+——————+——————————————-+

Если изначально была ошибка:

  • ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

    значит вы указывали при подключении неверный пароль, так как пользователь root@localhost существует. Сам пароль храниться в зашифрованном виде и его нельзя узнать, можно лишь задать новый

    SET PASSWORD FOR root@localhost=PASSWORD(‘новый пароль’);

  • ERROR 1045 (28000): Access denied for user ‘ODBC’@‘localhost’ (using password: YES)

    в данном случае в таблице привилегий отсутствует пользователь ‘ODBC’@’localhost’. Его нужно создать, используя команды GRANT, CREATE USER и SET PASSWORD.

Экзотический пример. Устанавливаете новый пароль для root@localhost в режиме —skip-grant-tables, однако после перезагрузки сервера по прежнему возникает ошибка при подключении через консольный клиент:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
Оказалось, что было установлено два сервера MySQL, настроенных на один порт.

phpmyadmin

При открытии в браузере phpmyadmin получаете сообщение:

Error
MySQL said:

#1045 — Access denied for user ‘root’@’localhost’ (using password: NO)
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

Ни логина, ни пароля вы не вводили, да и пхпадмин их нигде требовал, сразу выдавая сообщение об ошибке. Причина в том, что данные для авторизации берутся из конфигурационного файла config.inc.php Необходимо заменить в нем строчки

$cfg[‘Servers’][$i][‘user’] = ‘root’;      // MySQL user
$cfg[‘Servers’][$i][‘password’] = »;      // MySQL password (only needed

на

$cfg[‘Servers’][$i][‘user’] = ‘ЛОГИН’;      
$cfg[‘Servers’][$i][‘password’] = ‘ПАРОЛЬ’

Установка новой версии

Устанавливаете новую версию MySQL, но в конце при завершении конфигурации выпадает ошибка:

ERROR Nr. 1045
Access denied for user ‘root’@‘localhost’ (using password: NO)

Это происходит потому, что ранее у вас стоял MySQL, который вы удалили без сноса самих баз. Если вы не помните старый пароль и вам нужны эти данные, то выполните установку новой версии без смены пароля, а потом смените пароль вручную через режим —skip-grant-tables.

P.S. Статья написана по материалам форума SQLinfo, т.е. в ней описаны не все потенциально возможные случаи возникновения ошибки mysql №1045, а только те, что обсуждались на форуме. Если ваш случай не рассмотрен в статье, то задавайте вопрос на форуме SQLinfo
Вам ответят, а статья будет расширена.

Дата публикации: 25.11.2013

© Все права на данную статью принадлежат порталу SQLInfo.ru. Перепечатка в интернет-изданиях разрешается только с указанием автора и прямой ссылки на оригинальную статью. Перепечатка в бумажных изданиях допускается только с разрешения редакции.

This might seem redundant but I was unable to find a correct solution.

I was unable to login to mysql using the mysql console.It is asking for a password and I have no clue what I actually entered.(Is there a way to get the password or change it?)
This is how my config.inc look.

When I try to open phpmyadmin I get this error(#1045 — Access denied for user ‘root’@’localhost’ (using password: YES))

<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
 $cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'prakash123';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';


/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';


?>

I have tried to uninstall( Plus Deleted all the related files) WAMP and reinstall.It didn’t help either.
While reinstalling WAMP server it is not asking for any username password stuff I don’t know why.
Any help is highly appreciated.

asked May 30, 2013 at 20:54

Prakash's user avatar

4

I first changed the root password running mysql at a prompt with

mysql -u root -p

Update password:

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';

Edited line in the file config.inc.php with the new root password:

$cfg['Servers'][$i]['password'] = 'MyNewPass'

Stop and re-start mysql service (in Windows: mysql_stop.bat/mysql_start.bat)

and got phpMyAdmin to work!

EDIT 2017: for MySQL≥5.7 use authentication_string in place of Password (see this answer):

`UPDATE mysql.user SET authentication_string=PASSWORD('MyNewPass') WHERE User='root';

`

Ritesh's user avatar

Ritesh

4,6446 gold badges27 silver badges40 bronze badges

answered Oct 15, 2013 at 11:16

user2314737's user avatar

user2314737user2314737

26.6k18 gold badges102 silver badges113 bronze badges

3

The problem was I have 2 instances of Mysql installed and I didn’t know the password for both instances.Just check if port 80 is used by any of the programs.
This is what I did

1.Quit Skype because it was using port 80.(Please check if port 80 is used by any other program).

2.Search for Mysql services in task manager and stop it.

3.Now delete all the related mysql files.Make sure you delete all the files.

4.Reinstall

radbyx's user avatar

radbyx

9,27221 gold badges84 silver badges127 bronze badges

answered Aug 8, 2013 at 20:19

Prakash's user avatar

PrakashPrakash

7,7364 gold badges47 silver badges44 bronze badges

Well, there are many solutions already given above. If there are none of them works, maybe you should just try to reset your password again to ‘root’ as described here, and then reopen http://localhost/phpMyAdmin/ in other browser. At least this solution works for me.

answered Oct 27, 2013 at 20:18

yunhasnawa's user avatar

yunhasnawayunhasnawa

8151 gold badge14 silver badges30 bronze badges

This worked for me.
In your config file

$cfg['Servers']['$i']['password'] = 'yourpassword';

In your mysql shell, login as root

mysql -u root

change your password or update if you’ve forgotten the old one

UPDATE mysql.user SET Password=PASSWORD('yourpassword') WHERE User='root';

stop and restart your mysql server from the xampp control panel. phpmyadmin can login to see your databases

answered Jul 1, 2018 at 23:43

Timi Jegede's user avatar

mysql.exe->Run as administrator or go to following path C:wampbinmysqlmysql5.5.24bin and than right click on mysql.exe go to properties and than select tab as Compatibility and see the bottom of dialog box in privilege level and just check the Run this program as an administrator and then click apply ok.finished now you open success phpMyadmin. bye

answered Aug 5, 2013 at 15:40

arokiya's user avatar

  1. mysql -u root -p
  2. UPDATE mysql.user SET Password=PASSWORD('mypass') WHERE User='root';
  3. Flush the privileges: FLUSH PRIVILEGES;
  4. Exit by typing: Exit
  5. Edited line in the file config.inc.php with the new root password: $cfg['Servers'][$i]['password'] = 'mypass'

  6. be succss

answered Dec 29, 2014 at 9:08

ramin rostami's user avatar

1

Go to ‘config.inc.php’. Write your password over here — $cfg['Servers'][$i]['password'] =''

answered Jan 21, 2015 at 17:42

halkujabra's user avatar

halkujabrahalkujabra

2,8443 gold badges25 silver badges35 bronze badges

This process is quite simple in correcting the the error. What is happening is a failure to connect to phpMyAdmin. In order to fix the problem you simply need to provide the correct password to the system phpMyAdmin configuration file located in appsphpMyadminconfig.ini.php
1. the root should already be set as user
2. Insert the password between ‘ ‘ and that it.

If you still have problems then this means that the user name and /or the password need to be updated or inserted into the DB. to do this use the command line tool and do an update.

UPDATE mysql.user SET Password=PASSWORD(‘Johnny59 or whatever you want to use’) WHERE User=’root’;

answered Jan 26, 2015 at 2:52

Saturminus Combie's user avatar

Go to config.inc.php, find $cfg['Servers'][$i]['password'] and remove any password provided, i.e change $cfg['Servers'][$i]['password'] = 'password'; with $cfg['Servers'][$i]['password'] = '';

Now you can launch phpMyAdmin

Selecting Users menu from phpMyAdmin, select the root user and click Edit previlidges.
Now scroll down to Change Password area, switch between No Password and Password to provide your new password.
that’s it.

answered Jun 20, 2015 at 8:52

Hussain Rahimi's user avatar

I had the same error today. I had installed Djangostack and when I checked my task manager there were two instances of mysqld running. I checked one was for wamp server and the other was for django stack. I ended the one for django stack, restarted all services in wamp server and I was able to access phpmyadmin

answered Jun 22, 2015 at 9:15

Ngeno's user avatar

NgenoNgeno

213 bronze badges

after installation i started wamp and i was asked for user and pass which were already set on default (user:admin pass: dots), and that was wrong with a message from your topic. Than, i just entered:

Username: root 
Password: (leave it empty)

and it worked for me!!

answered Aug 2, 2016 at 11:39

fantja's user avatar

0

  1. Go to C:xamppphpMyAdmin

  2. Edit the config.inc.php file

  3. Replace $cfg['Servers'][$i]['auth_type'] = 'config'; by
    $cfg['Servers'][$i]['auth_type'] = 'cookie';

For now on the PHPMyAdmin will ask you for your password, no more error.

ata's user avatar

ata

3,3205 gold badges20 silver badges31 bronze badges

answered Feb 20, 2018 at 20:35

Jean Duclos's user avatar

Try the following code:

$cfg['Servers'][$i]['password'] = '';

if you see Password column field as ‘No’ for the ‘root’ user in Users Overview page of phpMyAdmin.

рüффп's user avatar

рüффп

5,13534 gold badges67 silver badges113 bronze badges

answered Oct 24, 2013 at 9:17

Peris's user avatar

PerisPeris

293 bronze badges

with MariaDb, above solutions doesn’t works.

Use (exemple below with ubuntu 16.04 and mariadb-server Distrib 10.0.28):

    sudo mysql_secure_installation
    …
    Change the root password? [Y/n] 
    New password: 

answered Jan 26, 2017 at 10:45

bcag2's user avatar

bcag2bcag2

1,9081 gold badge15 silver badges31 bronze badges

I have encountered similar mistakes, and later found that my password is wrong.

answered Aug 14, 2017 at 1:28

管浩浩's user avatar

管浩浩管浩浩

631 silver badge4 bronze badges

For UNIX, try this. It worked for me:

  1. connect MySQL use Navicat Premium with inital root/»password»
  2. UPDATE mysql.user
    SET authentication_string = PASSWORD('MyNewPass'), password_expired = 'N'
    WHERE User = 'root' AND Host = 'localhost';
    FLUSH PRIVILEGES;
  3. restart MySQL

Sebastian Brosch's user avatar

answered Feb 17, 2017 at 2:37

Aaron's user avatar

AaronAaron

191 bronze badge

1

First you have to go config.inc.php file then change the following instruction

$cfg['Servers'][$i]['user'] ='';
$cfg['Servers'][$i]['password'] =''; 

or

enter image description here

answered Aug 23, 2017 at 15:30

Mahedi Hasan Durjoy's user avatar

1

If you arrived here because you can’t log into your phpMyAdmin, then try the root password from your Mysql instead of the password you put during phpMyAdmin installation.

answered Oct 10, 2017 at 11:38

Kaizoku Gambare's user avatar

Kaizoku GambareKaizoku Gambare

3,0533 gold badges29 silver badges41 bronze badges

Just now I have this situation and I have tried this way which is very easy.

First stop your mysql service using this command:

service mysql stop

and then just again start your mysql service using this command

service mysql start

I hope it may help others… :)

STiLeTT's user avatar

STiLeTT

1,02310 silver badges23 bronze badges

answered Dec 1, 2017 at 10:51

Sachin Shah's user avatar

Sachin ShahSachin Shah

4,4543 gold badges23 silver badges50 bronze badges

After I updated my MySql, I was getting the same error message.
It turned out that after installing a different version on MySql, inside the my.ini, the port was different. Previous MySql version had port 3306 but the new one have port 3308.
Check your MySql my.ini, if it is different use the port from .ini in your connection.

answered Jan 9, 2020 at 23:52

Guntar's user avatar

GuntarGuntar

4598 silver badges23 bronze badges

php artisan serve 

this command get the env contents for the first time and if you update .env file need to restart it.

in my case my username and dbname is valid and php artisan migrate worked

but need to cntrl+c , to cancel php artisan serve , and run it again

php artisan serve

answered Feb 19, 2020 at 17:51

saber tabatabaee yazdi's user avatar

Check the name of Environment Variable

Case with me:

  • I was using sqlalchemy in a python-flask project and got this issue.
  • IDE used: PyCharm
  • In my config.py file I had setup SQLALCHEMY_DATABASE_URI as:
SQLALCHEMY_DATABASE_URI = os.getenv("DATABASE_URI")

Mistake I did (it was a silly mistake 😅)

  • While setting evironment_variables in PyCharm, I did:
SQLALCHEMY_DATABASE_URI=<my_db_uri>

Solution

  • I changed the above to:
DATABASE_URI=<my_db_uri>

Namaste 🙏

answered Apr 6, 2021 at 6:34

Deepam Gupta's user avatar

Deepam GuptaDeepam Gupta

2,2581 gold badge28 silver badges33 bronze badges

In the my.ini file in C:xamppmysqlbin, add the following line after the [mysqld] command under #Mysql Server:

skip-grant-tables

This should remove the error 1045.

Nander Speerstra's user avatar

answered Dec 20, 2017 at 7:23

Abhikarsh's user avatar

1

if multiple myslq running on same port no
enter image description here

Right click on wamp and test port 3306
if its wampmysqld64 its correct else change port no and restart server

radbyx's user avatar

radbyx

9,27221 gold badges84 silver badges127 bronze badges

answered Jun 16, 2018 at 12:00

Sachins's user avatar

SachinsSachins

311 silver badge7 bronze badges

Страницы 1

Чтобы отправить ответ, вы должны войти или зарегистрироваться

1 2011-06-22 17:39:18

  • silmin85
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-06-22
  • Сообщений: 23

Тема: Проблема при запуске PhpMyAdmin, ошибка #1045

Здравствуйте!!! Не могу разобраться  почему http://localhost/Tools/phpMyAdmin/ не пускает в PhpMyAdmin, ошибка #1045 Невозможно подключиться к серверу MySQL.(#1045 — Access denied for user ‘root’@’localhost’ (using password: NO)) ………(((((((
На самом сайте выходит надпись ^: 

Сайт автономно
Сайт в данный момент недоступен из-за технических проблем. Пожалуйста, повторите попытку позже. Спасибо за ваше понимание.

Если вы являетесь сопровождающим этого сайта, пожалуйста, проверьте настройки базы данных в settings.php файла и убедиться, что сервер базы данных вашего хостинг-провайдера работает. Дополнительную информацию см. в руководстве , или свяжитесь с вашим хостинг-провайдера.

MySQLi ошибка: Доступ закрыт для ‘сайт «пользователь @» локальный «(был использован пароль: ДА) .
——————————

2 Ответ от Hanut 2011-06-22 20:43:47

  • Hanut
  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

silmin85 сказал:

Access denied for user ‘root’@’localhost’ (using password: NO)

Если вы не меняли пароль пользователя root, то даже не знаю в чем причина. Если все-таки меняли, то поправьте конфигурационный файл phpMyAdmin (config.inc.php) прописав в нем пароль root.

Обратите внимание, что для сайта у вас задан пароль для учетной записи MySQL.

3 Ответ от silmin85 2011-06-23 01:47:33

  • silmin85
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-06-22
  • Сообщений: 23

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

Hanut сказал:

silmin85 сказал:

Access denied for user ‘root’@’localhost’ (using password: NO)

Если вы не меняли пароль пользователя root, то даже не знаю в чем причина. Если все-таки меняли, то поправьте конфигурационный файл phpMyAdmin (config.inc.php) прописав в нем пароль root.

Обратите внимание, что для сайта у вас задан пароль для учетной записи MySQL.

Где-то неделю назад я в phpmyadmin добавил нового пользователя , вот и поэтому у меня эта ошибка ,но это мои предположение ! Я использую сервер Денвер ….на вашем форуме вижу подобные темы с этой ошибкой 1045 sad  Но до сих пор не могу толком разобраться и решить проблему! Первоначально думал что проблема в config.inc.php и решил изменить строку:
$cfg[‘Servers’][$i][‘auth_type’] = ‘config’;
на строку:
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
и добавил строку:
$cfg[‘blowfish_secret’] = ‘42387482ytytuytT887687’;

После изменение на http://localhost/Tools/phpMyAdmin/ ошибка 1045 исчезла и появился вход в phpMyAdmin ЛОГИН(username) и ПАРОЛЬ!!! Начал водить свои ЛОГИН и ПАРОЛЬ пишет ошибка .  sad  В чем же причина может быть?

4 Ответ от silmin85 2011-06-23 02:13:54

  • silmin85
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-06-22
  • Сообщений: 23

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

Пробовал использовать установку логин и пароль заново по предложенному методу которое описано http://forum.php-myadmin.ru/viewtopic.p … 803#p16803 !!! Появляется вот такая странная ОШИБКА:
Error
SQL query: Edit
SHOW PLUGINS
MySQL said: Documentation
#1 — Can’t create/write to file ‘tmp#sql1dfc_4_0.MYI’ (Errcode: 2)
Connection for controluser as defined in your configuration failed. 

Опять таки ломаю голову над выяснением и устроением ошибок на своем локальном сервере  sad
Hanut ПОДСКАЖИТЕ ПОЖАЛУЙСТА ?  Что же можно предпринять ?

5 Ответ от Hanut 2011-06-23 12:22:20

  • Hanut
  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

silmin85 сказал:

Что же можно предпринять ?

Отписал в теме забытого пароля о способе, которым можно заново установить пароль root.

6 Ответ от silmin85 2011-06-23 13:03:44

  • silmin85
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-06-22
  • Сообщений: 23

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

После перезагрузки ПК всё таки я с мог зайти в phpmyadmin через новый Логин и Пароль !!! Но тут всё таки ОШИБКА в нижней части красная рамка  :
«Connection for controluser as defined in your configuration failed.» !!!!!!!!!!!!

Захожу на сайт ВСЁ по прежнему та же  ошибка :

Site off-line

The site is currently not available due to technical problems. Please try again later. Thank you for your understanding.

If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider’s database server is running. For more help, see the handbook, or contact your hosting provider.

The mysqli error was: Access denied for user ‘silmin85’@’localhost’ (using password: YES)
————————————————
ПЕРЕВОД:
Сайт автономно
Сайт в данный момент недоступен из-за технических проблем. Пожалуйста, повторите попытку позже. Спасибо за ваше понимание.

Если вы являетесь сопровождающим этого сайта, пожалуйста, проверьте настройки базы данных в settings.php файла и убедиться, что сервер базы данных вашего хостинг-провайдера работает. Дополнительную информацию см. в руководстве , или свяжитесь с вашим хостинг-провайдера.

MySQLi ошибка: Доступ закрыт для ‘silmin85 «пользователь @» локальный «(был использован пароль: ДА) .
———————————————————————

Даже боюсь что либо менять на settings.php потому что на локалке 2 месячный труд не завершенный сайт ! Кстати сайт я создаю на DRUPAL и в качестве сервера выбрал ДЕНВЕР !

Может при замене Логина и Пароля MySQL не может связать с базой данных ?
Подскажите как работать с настройками базы данных в settings.php?

7 Ответ от Hanut 2011-06-23 14:35:06

  • Hanut
  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

В конфигурационном файле phpMyAdmin (config.inc.php) посмотрите данные пользователя pma:
$cfg[‘Servers’][$i][‘controluser’] = ‘pma’;
$cfg[‘Servers’][$i][‘controlpass’] = ‘pma_password’;
В случае необходимости, отредактируйте их, либо проверьте права пользователя pma на странице привилегий в phpMyAdmin.

Зайдите в phpMyAdmin, перейдите на страницу привилегий и найдите пользователя silmin85, установите для него новый пароль, либо пропишите старый пароль еще раз. Обязательно проверьте есть ли у пользователя silmin85 доступ к базе данных в которой развернуты таблицы сайта.

Если для silmin85 будете устанавливать новый пароль, то поменяйте его и в конфигурационном файле Drupal.

8 Ответ от silmin85 2011-06-23 15:13:18

  • silmin85
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-06-22
  • Сообщений: 23

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

В phpMyAdmin,  на странице привилегий что-то нет пользователя silmin85 … neutral sad  есть только пользователя demo1 я его создал неделю назад и он без пароля ,и есть пользователь root , я вчера сменил логин(root) и пароль (pass) .  Задаюсь вопросом где же silmin85 … ?

Открыл файл settings.php по drupal-mysitesitesdefaultsettings.php
и обнаружил что:
*
* Database URL format:
*   $db_url = ‘mysql://username:password@localhost/databasename’;
*   $db_url = ‘mysqli://username:password@localhost/databasename’;
*   $db_url = ‘pgsql://username:password@localhost/databasename’;
*/
$db_url = ‘mysqli://silmin85:123456@localhost/project’;
$db_prefix = »;

/**

А ПОТОМ В ЭТОЙ ЖЕ ПАПКЕ ПЕРЕШЕЛ В ПАПКУ files:

drupal-mysitesitesdefaultfilessettings.php

* Database URL format:
*   $db_url = ‘mysql://username:password@localhost/databasename’;
*   $db_url = ‘mysqli://username:password@localhost/databasename’;
*   $db_url = ‘pgsql://username:password@localhost/databasename’;
*/
$db_url = ‘mysql://username:password@localhost/databasename’;
$db_prefix = »;

/**
——————————————————————
теперь ведь у меня другой логин и пароль (root) и (pass)

а почему не сменились логин:silmin85 и пароль:123456???

$db_url = ‘mysqli://silmin85:123456@localhost/project’;
$db_prefix = »;

9 Ответ от Hanut 2011-06-23 15:21:13

  • Hanut
  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

drupal-mysitesitesdefaultsettings.php — Это конфигурационный файл Drupal, его необходимо отредактировать.

Поменяйте эту строку:
$db_url = ‘mysqli://silmin85:123456@localhost/project’;
На новую:
$db_url = ‘mysqli://root:pass@localhost/project’;

Либо в phpMyAdmin, на странице привилегий, создайте пользователя silmin85, что я бы рекомендовал, так как под root лучше скрипты не запускать.

silmin85 сказал:

а почему не сменились логин:silmin85 и пароль:123456?

Эти данные должны меняться вами вручную и соответствовать пользователю MySQL.

10 Ответ от silmin85 2011-06-23 16:14:43

  • silmin85
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-06-22
  • Сообщений: 23

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

Пробую поменять строку: $db_url = ‘mysqli://silmin85:123456@localhost/project’; через Notepad++  не редактируется  neutral  ? Может защита стоит ,но совсем даже удалить и вставить ничего нельзя только вот можно копировать текст и всё?

Hanut если я ещё раз создам пользователя silmin85 с паролем: 123456 не выйдет ли опять такая же ошибка 1045 (как и в прошлый раз) ? Может дадите по шаговую инструкцию «Как правильно создать нового пользователя»?

11 Ответ от Hanut 2011-06-23 17:05:52

  • Hanut
  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

silmin85 сказал:

Пробую поменять строку: $db_url = ‘mysqli://silmin85:123456@localhost/project’; через Notepad++  не редактируется

Это я не могу объяснить. Посмотрите права файла.

silmin85 сказал:

если я ещё раз создам пользователя silmin85 с паролем: 123456 не выйдет ли опять такая же ошибка 1045

Нет, ошибки не будет никакой, важно только root не трогать.
1) В phpMyAdmin открываем страницу Привилегий.
2) Жмем «Добавить нового пользователя».
3) Заполняем поля:
Имя пользователя: silmin85
Хост: localhost
Пароль: 123456
4) В глобальных привилегиях отмечаем все галочки, кроме тех, что находятся в блоке «Администрирование».

12 Ответ от silmin85 2011-06-23 17:19:16

  • silmin85
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-06-22
  • Сообщений: 23

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

Всё спасибо !!! БЛАГОДАРЮ Hanut!!! Получилось ! smile

13 Ответ от rafhat 2011-10-23 16:02:39 (изменено: rafhat, 2011-10-23 17:21:46)

  • rafhat
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-10-22
  • Сообщений: 12

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

Здравствуйте Hanut!
Благодарю за предыдущую помощь, но мы двигаемся дальше и опять возникают вопросы. Заранее благодарен за ответ.
У меня таже Проблема при запуске PhpMyAdmin, ошибка #1045 Невозможно подключиться к серверу MySQL.
Перепробовал делать то что описано выше, результат тотже, прошу помочь.

<?php
   $i = 0;
   $i++;
   $cfg['Servers'][$i]['host'] = 'localhost';
   $cfg['Servers'][$i]['extension'] = 'mysqli';
   $cfg['Servers'][$i]['connect_type'] = 'tcp';
   $cfg['Servers'][$i]['compress'] = false;
   $cfg['Servers'][$i]['auth_type'] = 'config';
   $cfg['Servers'][$i]['user'] = 'root';
   $cfg['Servers'][$i]['password'] = 'randonneur'; 
    ?>

14 Ответ от Hanut 2011-10-23 17:21:28

  • Hanut
  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

rafhat сказал:

У меня таже Проблема при запуске PhpMyAdmin, ошибка #1045 Невозможно подключиться к серверу MySQL.

Для начала удостоверьтесь, что запущен сервис MySQL (Control panel -> Administrative Tools -> Services).

Если сервис запущен, то попробуйте подключиться к MySQL из командной строки (CMD) введя:

Вместо pass поставьте пароль пользователя root, прямо вплотную к ключу -p.

15 Ответ от rafhat 2011-10-23 17:37:25

  • rafhat
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-10-22
  • Сообщений: 12

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

сервис запущен.

Командная строка выдает:
ERROR 1045 <28000>: Access denied for user `root`@`localhost` <using password:YES>

16 Ответ от Hanut 2011-10-23 18:15:30

  • Hanut
  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,726

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

rafhat сказал:

Access denied for user `root`@`localhost`

Значит либо неверен пароль, либо вы меняли какие-то настройки привилегий учетной записи root.

Для решения проблемы и сброса пароля root есть описанный здесь способ — http://forum.php-myadmin.ru/viewtopic.p … 807#p16807

17 Ответ от rafhat 2011-10-23 21:12:17

  • rafhat
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2011-10-22
  • Сообщений: 12

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

Hanut сказал:

rafhat сказал:

Access denied for user `root`@`localhost`

Значит либо неверен пароль, либо вы меняли какие-то настройки привилегий учетной записи root.

Для решения проблемы и сброса пароля root есть описанный здесь способ — http://forum.php-myadmin.ru/viewtopic.p … 807#p16807

Большущее спасибо! Все заработало!

18 Ответ от bizon 2013-04-28 14:20:07

  • bizon
  • Новичок
  • Неактивен
  • Зарегистрирован: 2013-04-28
  • Сообщений: 1

Re: Проблема при запуске PhpMyAdmin, ошибка #1045

Такая же проблема была облазил все форумы…решение пришло как то само собой,вспомнил что на кампе установлена MySQL 5.5 удалил MySQL и перезагрузил комп и все заработало

Страницы 1

Чтобы отправить ответ, вы должны войти или зарегистрироваться

I see this question has been asked many times, but I don’t find a solution for my problem. Tried all possible combinations in config.inc.php

$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapass';

I installed XAMPP. In PhpMyAdmin I modified the password of root@localhost. I am able to login to PhpMyAdmin using the new password.

But when I Add a new user Drupal as per drupal installation steps, I get this error:

Error 1045, "Access denied for user 'root'@'localhost' (Password: YES)

But still the drupal user gets created but the drupal database in mysql doesnt get created.

When I try to create drupal database separately I am able to do it.

Apart from this I tried MySQL.exe -u root -p. It works fine there, so I am not sure.

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:wampappsphpmyadminx.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»;

Понравилась статья? Поделить с друзьями:
  • Ошибка 1044 эур на калине
  • Ошибка 1044 шкода октавия а5
  • Ошибка 1044 фольксваген тигуан
  • Ошибка 1044 фольксваген пассат б6
  • Ошибка 1044 туарег