We have installed PHPMyAdmin on a windows machine running IIS 7.0.
We are able to connect to MySQL using command-line, But we are not able to connect using PHPMyAdmin.
The error displayed is: Error #1045 Cannot log in to the MySQL server.
Can somebody please help?
PHP Version 5.4.0
mysqlnd 5.0.10 - 20111026 - $Revision: 323634 $
phpMyAdmin-3.5.4-rc1-all-languages.7z
EDIT :
I followed the link below with no success, mean i changed that password but phpmyadmin still has that error…
C.5.4.1.1. Resetting the Root Password: Windows Systems
Also there is thread like below in stack with no help :
Random error: #1045 Cannot log in to the MySQL server
but that error is not random -> i always have that error…
And this is config.inc.php file in phpmyadmin folder:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Config file view and save screen
*
* @package PhpMyAdmin-setup
*/
if (!defined('PHPMYADMIN')) {
exit;
}
/**
* Core libraries.
*/
require_once './libraries/config/FormDisplay.class.php';
require_once './setup/lib/index.lib.php';
require_once './setup/lib/ConfigGenerator.class.php';
$config_readable = false;
$config_writable = false;
$config_exists = false;
check_config_rw($config_readable, $config_writable, $config_exists);
?>
<h2><?php echo __('Configuration file') ?></h2>
<?php display_form_top('config.php'); ?>
<input type="hidden" name="eol" value="<?php echo htmlspecialchars(PMA_ifSetOr($_GET['eol'], 'unix')) ?>" />
<?php display_fieldset_top('', '', null, array('class' => 'simple')); ?>
<tr>
<td>
<textarea cols="50" rows="20" name="textconfig" id="textconfig" spellcheck="false"><?php
echo htmlspecialchars(ConfigGenerator::getConfigFile())
?></textarea>
</td>
</tr>
<tr>
<td class="lastrow" style="text-align: left">
<input type="submit" name="submit_download" value="<?php echo __('Download') ?>" class="green" />
<input type="submit" name="submit_save" value="<?php echo __('Save') ?>"<?php if (!$config_writable) echo ' disabled="disabled"' ?> />
</td>
</tr>
<?php
display_fieldset_bottom_simple();
display_form_bottom();
?>
where part of these codes should i change?
Thanks.
asked Nov 13, 2012 at 8:30
![]()
SilverLightSilverLight
19.3k64 gold badges185 silver badges294 bronze badges
In Linux I resolve this problem by going to the root command prompt type:
# mysqladmin -u root password 'Secret Phrase Here'
Then go back and login. Works every time!
answered Jun 26, 2013 at 9:44
1
You need to do two additional things after following the link that you have mentioned in your post:
One have to map the changed login cridentials in phpmyadmin’s config.inc.php
and second, you need to restart your web and mysql servers..
php version is not the issue here..you need to go to phpmyadmin installation directory and find file config.inc.php and in that file put your current mysql password at line
$cfg['Servers'][$i]['user'] = 'root'; //mysql username here
$cfg['Servers'][$i]['password'] = 'password'; //mysql password here
answered Nov 13, 2012 at 9:01
000000
3,9564 gold badges25 silver badges39 bronze badges
8
If you are installing first time then please try login with username and password as root
answered Nov 3, 2013 at 9:23
AkeelAkeel
511 silver badge3 bronze badges
another thing that worked for me after everything didn’t — change «localhost» in config.inc.php to 127.0.0.1
answered Aug 13, 2015 at 18:47
ItamarBeItamarBe
4721 gold badge5 silver badges12 bronze badges
In mysql 5.7 the auth mechanism changed, documentation can be found in the official manual here.
Using the system root user (or sudo) you can connect to the mysql database with the mysql ‘root’ user via CLI.
All other users will work, too.
In phpmyadmin however, all mysql users will work, but not the mysql ‘root’ user.
This comes from here:
$ mysql -Ne "select Host,User,plugin from mysql.user where user='root';"
+-----------+------+-----------------------+
| localhost | root | auth_socket |
| hostname | root | mysql_native_password |
+-----------+------+-----------------------+
To ‘fix’ this security feature, do:
mysql -Ne "update mysql.user set plugin='mysql_native_password' where User='root' and Host='localhost'; flush privileges;"
More on this can also be found here in the manual.
answered Jun 7, 2016 at 18:25
sjassjas
18.1k12 gold badges85 silver badges91 bronze badges
For ubuntu users, your config.inc.php file should be like this
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'password';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
/**
* phpMyAdmin configuration storage settings.
*/
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = '';
answered Feb 3, 2017 at 7:33
![]()
MeVimalkumarMeVimalkumar
3,0972 gold badges15 silver badges25 bronze badges
When you change your passwords in the security tab, there are two sections, one above and one below. I think the common mistake here is that others try to log-in with the account they have set «below» the one used for htaccess, whereas they should log in to the password they set on the above section. That’s how I fixed mine.
answered Aug 3, 2015 at 14:42
a number of answers; check out this one also; make sure that no instance of mysql is running, always brought by not ending your sessions well. get the super user rights with
sudo su
and type your password when prompted to (remember nothing appears when you type your password, so, don’t worry just type it and press enter). Next go to your terminal and stop all mysql instances:
/etc/init.d/mysql stop
after that, go and restart the mysql services (or restart xampp as a whole). This solved my problem. All the best.
answered Mar 20, 2019 at 10:21
![]()
alanalan
736 bronze badges
0
If you logged into «phpmyadmin», then logged out, you might have trouble attempting to log back in on the same browser window. The logout sends the browser to a URL that looks like this:
http://localhost/phpmyadmin/index.php?db=&token=354a350abed02588e4b59f44217826fd&old_usr=tester
But for me, on Mac OS X in Safari browser, that URL just doesn’t want to work. Therefore, I have to put in the clean URL:
http://localhost/phpmyadmin
Don’t know why, but as of today, Oct 20, 2015, that is what I am experiencing.
answered Oct 20, 2015 at 17:26
IAM_AL_XIAM_AL_X
1,17110 silver badges12 bronze badges
sudo service mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
Change MYSECRET with your new root password
UPDATE user SET Password=PASSWORD('MYSECRET') WHERE User='root'; FLUSH PRIVILEGES; exit;
sjas
18.1k12 gold badges85 silver badges91 bronze badges
answered Apr 4, 2016 at 6:36
Страницы 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
- Модератор
- Неактивен
- Откуда: Рига, Латвия
- Зарегистрирован: 2006-07-02
- Сообщений: 9,722
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
Но до сих пор не могу толком разобраться и решить проблему! Первоначально думал что проблема в 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) и ПАРОЛЬ!!! Начал водить свои ЛОГИН и ПАРОЛЬ пишет ошибка .
В чем же причина может быть?
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.
Опять таки ломаю голову над выяснением и устроением ошибок на своем локальном сервере
Hanut ПОДСКАЖИТЕ ПОЖАЛУЙСТА ? Что же можно предпринять ?
5 Ответ от Hanut 2011-06-23 12:22:20

- Hanut
- Модератор
- Неактивен
- Откуда: Рига, Латвия
- Зарегистрирован: 2006-07-02
- Сообщений: 9,722
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
- Модератор
- Неактивен
- Откуда: Рига, Латвия
- Зарегистрирован: 2006-07-02
- Сообщений: 9,722
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 …
есть только пользователя 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
- Модератор
- Неактивен
- Откуда: Рига, Латвия
- Зарегистрирован: 2006-07-02
- Сообщений: 9,722
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++ не редактируется
? Может защита стоит ,но совсем даже удалить и вставить ничего нельзя только вот можно копировать текст и всё?
Hanut если я ещё раз создам пользователя silmin85 с паролем: 123456 не выйдет ли опять такая же ошибка 1045 (как и в прошлый раз) ? Может дадите по шаговую инструкцию «Как правильно создать нового пользователя»?
11 Ответ от Hanut 2011-06-23 17:05:52

- Hanut
- Модератор
- Неактивен
- Откуда: Рига, Латвия
- Зарегистрирован: 2006-07-02
- Сообщений: 9,722
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!!! Получилось ! ![]()
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
- Модератор
- Неактивен
- Откуда: Рига, Латвия
- Зарегистрирован: 2006-07-02
- Сообщений: 9,722
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
- Модератор
- Неактивен
- Откуда: Рига, Латвия
- Зарегистрирован: 2006-07-02
- Сообщений: 9,722
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
Чтобы отправить ответ, вы должны войти или зарегистрироваться
- Печать
Страницы: [1] 2 Все Вниз
Тема: PhpMyAdmin #1045 Невозможно подключиться к серверу MySQL (Прочитано 144726 раз)
0 Пользователей и 1 Гость просматривают эту тему.

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

gregory5
« Последнее редактирование: 24 Февраля 2011, 14:25:15 от gregory5 »

Bling-Bling
ЭЭэээ…. дело в том что гуглил и это читал.
После ввода пароля проваливаюсь в пустую страничку 
а если пароль ввести не верно, то получаю ошибку #1045 Невозможно подключиться к серверу MySQL
через консоль в mysql пускает
« Последнее редактирование: 24 Февраля 2011, 17:24:12 от Bling-Bling »
10.10

geka_ubuntu
После установки mysql — подключитесь к серверу:
mysql -u root
в терминале отобразится сообщение:
Welcome…
установите пароль на root (например — 000000):
set password for root@localhost=password(‘000000’);
после загрузите PhpMyAdmin и введите соответствующие логин и пароль…
дело в том что PhpMyAdmin — не разрешает вход без пароля
« Последнее редактирование: 05 Марта 2011, 16:07:35 от geka_ubuntu »

pashulka
***@***:~$ sudo mysql -u root
Вывод:
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)
А в таком случае что делать?

drako

AnrDaemon
mysql -u root -p
Топик читать пробовал?
ЭЭэээ…. дело в том что гуглил и это читал.
После ввода пароля проваливаюсь в пустую страничкуа если пароль ввести не верно, то получаю ошибку #1045 Невозможно подключиться к серверу MySQL
через консоль в mysql пускает
Была такая проблема… версия PMA какая?
Хотите получить помощь? Потрудитесь представить запрошенную информацию в полном объёме.
Прежде чем [Отправить], нажми [Просмотр] и прочти собственное сообщение. Сам-то понял, что написал?…

VinnyPooh
Давайте культурнее к друг другу обращаться, AnrDaemon хоть и резок на язык бывает, но прав, отвечающие, читайте внимательно тему.

sssats
Возможно пригодится кому-то в будущем. Такая-же проблема была. Оказалось что когда вводил пароль в консоли ввел на русском, на консоль восприняла как «
?» поэтому в web-морду не могло зайти ни русскими не английскими. Через консоль вошел ввоодя на русском и сменил пароль.

bumctik
mysql -u root -p
что делать если даже после того как пароль вводишь и жмешь Enter
все равно терминал возвращает
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
===========================================================
Пользователи убунты не знают о существовании других дистров.
Они считают, что Ubuntu — это и есть линукс, единственный и неповторимый.

fisher74
Вспоминать правильный пароль мускульного root-а. Если не вспоминается — «сбрасывать».

bumctik
Вспоминать правильный пароль мускульного root-а. Если не вспоминается — «сбрасывать».
проблема в том, что я не могу забыть только что установленный (при установке) пароль на MYSQl
тут видимо проблема в другом, есть какой-то баг
и как сбросить пароль root?
===========================================================
Пользователи убунты не знают о существовании других дистров.
Они считают, что Ubuntu — это и есть линукс, единственный и неповторимый.

fisher74
и как сбросить пароль root?
Примерно так
sudo service mysqld stop
/usr/bin/mysqld_safe --skip-grant-tables --user=root &
mysql -u root
UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';
FLUSH PRIVILEGES;
q
sudo service mysqld restart

bumctik
да это все пробовал все равно не помогло…полностью снес все под 0 и заново поставил, и заработало (LAMP) из коробки
===========================================================
Пользователи убунты не знают о существовании других дистров.
Они считают, что Ubuntu — это и есть линукс, единственный и неповторимый.
mirzayaky
#2002 Невозможно подключиться к серверу MySQL
aleksandr@aleksandr-laptop:~$ sudo service mysqld stop
[sudo] password for aleksandr:
mysqld: unrecognized service
aleksandr@aleksandr-laptop:~$ /usr/bin/mysqld_safe --skip-grant-tables --user=root &
[1] 6073
aleksandr@aleksandr-laptop:~$ 131109 16:32:15 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
131109 16:32:15 mysqld_safe Logging to '/var/log/mysql/error.log'.
131109 16:32:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe: 126: /usr/bin/mysqld_safe: cannot create /var/log/mysql/error.log: Permission denied
/usr/bin/mysqld_safe: 1: eval: cannot create /var/log/mysql/error.log: Permission denied
131109 16:32:15 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
/usr/bin/mysqld_safe: 126: /usr/bin/mysqld_safe: cannot create /var/log/mysql/error.log: Permission denied
[1]+ Выход из 2 /usr/bin/mysqld_safe --skip-grant-tables --user=root
aleksandr@aleksandr-laptop:~$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
aleksandr@aleksandr-laptop:~$ UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';
bash: ошибка синтаксиса около неожиданной лексемы `('
aleksandr@aleksandr-laptop:~$
- Печать
Страницы: [1] 2 Все Вверх
I installed wamp.phpmyadmin working fine. Now that I have installed mysql command line client I am not able to connect to my databases from mysql command line or phpmyadmin. After restarting I could not access phpmyadmin #1045 Cannot log in to the MySQL server. In addition to that my mysql command line not accepting my password and rejects my config files:
C:wampbinmysqlmysql5.5.24
my.ini
port=3306
my config.inc.php
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'whtevr';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
httpd.conf
listen port:80
C:Program FilesMySQLMySQL Server 5.0
my.ini
port:3306
Again, I reinstalled mysql command line with port changed to 3307
port:3307
WAMP works fine accessing all the databases but from mysql command line client I could not access all my databases. It is only showing show databases;
information_schema
mysql
test
Jason
14.9k23 gold badges85 silver badges116 bronze badges
asked Jan 2, 2014 at 16:43
![]()
3
In case MySQL Server is up but you are still getting the error:
For anyone who still have this issue,
I followed awesome tutorial http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-9-mavericks/
However i still got #1045 error.
What really did the trick was to change localhost to 127.0.0.1 at your config.inc.php. Why was it failing if locahost points to 127.0.0.1? I don’t know. But it worked.
===== EDIT =====
Long story short, it is because of permissions in mysql. It may be set to accept connections from 127.0.0.1 but not from localhost.
The actual answer for why this isn’t responding is here:
https://serverfault.com/a/297310
answered Jul 2, 2015 at 16:51
![]()
JGutierrezCJGutierrezC
4,2685 gold badges24 silver badges42 bronze badges
2
I was experiencing the same problem on OS X. I’ve solved it now. I post my solution here for anyone who has the similar issue.
Firstly, I set the password for root in mysql client:
shell> mysql -u root
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MY_PASSWORD');
Then, I checked the version info:
shell> /usr/local/mysql/bin/mysqladmin -u root -p version
...
Server version 5.6.26
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 11 min 0 sec
...
Finally, I changed the connect_type parameter from tcp to socket and added the parameter socket in config.inc.php:
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';
answered Sep 8, 2015 at 11:05
micmiamicmia
1,3511 gold badge13 silver badges29 bronze badges
1
If you reinstalled the server it means that that the new installation most likely overwrote your username and passwords. (You might want to try loggin without a password see if it works).
If it is a clean install you need to set the root password .
Otherwise, you will need to reset root permissions.
answered Jan 2, 2014 at 17:21
AresAres
5,8753 gold badges35 silver badges51 bronze badges
Go to phpMyAdmin Directory of your Localhost Software Like Xampp, Mamp or others. Then change the host from localhost to 127.0.0.1 and change the port to 3307 . After that go to your data directory and delete all error log files except ibdata1 which is important file to hold your created database table link. Finaly restart mysql.I think your problem will be solved.
answered Aug 3, 2015 at 13:04
![]()
I just solved this error for myself, but it was a bit silly on my part. Still worth checking if the above doesn’t help you.
In my case, I was editing the config files in /etc/phpmyadmin, my install was located in /usr/share/phpmyadmin, and my install was not actually opening the /etc/phpmyadmin config files, as I thought it would. So I just did this command:
ln -s /etc/phpmyadmin/conf* /usr/share/phpmyadmin
For those not in the know, ln -s makes a soft link (basically a shortcut). So that command just makes shortcuts from the config files in /etc to the /usr/share install.
By the way, I figured this out after using the program opensnoop, which shows you what files are being opened (technically, traces open() syscalls and the pid of the process, as they happen), which you can install on Ubuntu with apt-get install perf-tools-unstable, or you can get it here.
answered Jan 13, 2016 at 4:37
![]()
apricot boyapricot boy
1212 silver badges4 bronze badges
I also had this error. It worked normally after I clean up the cookies.
![]()
Tunaki
130k45 gold badges326 silver badges414 bronze badges
answered Dec 4, 2014 at 9:35
1
After like three (3) hours of google..ing.This is the solution to the problem:
First, I run this command;
$mysqladmin -u root -p[your root password here] version
Which outputs:
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Server version 5.5.49-0ubuntu0.14.04.1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 1 hour 54 min 3 sec
Finally, I changed the connect_type parameter from tcp to socket and added the parameter socket in config.inc.php:
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
All credit goes to this person:
This is the correct solution
answered Jan 31, 2017 at 16:50
You have to go into your mySQL settings and change the settings to Legacy authentication. I use mysql community installer and it allows you to go back and reconfigure the settings.
Create a new user, and choose standard authentication, choose a password, thats it.
Its that simple!!!
answered Jan 18, 2019 at 21:26
![]()
Since the username and password is added in config.inc.php, you need to change:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
TO:
$cfg['Servers'][$i]['auth_type'] = 'config';
And save the file.
You will then need to restart WAMP after making the above changes.
answered Jul 22, 2015 at 20:03
![]()
AndrewL64AndrewL64
15.5k8 gold badges48 silver badges76 bronze badges
I also had this error once, but only with one specific user. So what I did is remove the user and re-create it with the same name and password.
Then after I re-imported the database, it worked.
answered Aug 13, 2016 at 23:22
bytecode77bytecode77
13.8k30 gold badges107 silver badges139 bronze badges
I would suggest 3 things:
- First try clearing browser’s cache
- Try to assign username & password statically into config.inc.php
- Once you’ve done with installation, delete the config.inc.php file under «phpmyadmin» folder
The last one worked for me.
answered Mar 10, 2017 at 8:54
Adding the following $cfg helps to narrow down the problem
$cfg['Error_Handler']['display'] = true;
$cfg['Error_Handler']['gather'] = true;
Don’t forget to remove those $cfg after done debugging!
answered Mar 9, 2018 at 8:07
Every once in a while, and this isn’t often, but every once in a while, there’s a typo in your password. A subtle difference between an upper and lower case letter, for example. I went through many, many of these solutions.
I had simply mistyped the password, and it was saved to my browser, so I didn’t think to check it again.
Since this error CAN be caused by a missed password, just double-check before you go on this quest.
answered Jun 7, 2020 at 20:03
DavidDavid
314 bronze badges
Before you start, go to the directory «phpMyAdmin» preferably the one in your localhost, clear all of your cookies, and have your sql running by entering:
sudo /usr/local/mysql/support-files/mysql.server start
To fix the error , you will have to run the following commands in your terminal:
export PATH=$PATH:/usr/local/mysql/bin/
then:
mysql -u root
after which, you’ll need to change your permissions inside the mySQL shell:
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
Refresh your phpMyAdmin window, re-enter the «root» username (or whichever is applicable), and your password and you should be good to go.
Check http://machiine.com/2013/how-to-setup-phpmyadmin-on-a-mac-with-osx-10-8-mamp-part-3/ if you are willing to set up from scratch.
answered Nov 8, 2014 at 2:21
![]()
0
I installed wamp.phpmyadmin working fine. Now that I have installed mysql command line client I am not able to connect to my databases from mysql command line or phpmyadmin. After restarting I could not access phpmyadmin #1045 Cannot log in to the MySQL server. In addition to that my mysql command line not accepting my password and rejects my config files:
C:wampbinmysqlmysql5.5.24
my.ini
port=3306
my config.inc.php
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'whtevr';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
httpd.conf
listen port:80
C:Program FilesMySQLMySQL Server 5.0
my.ini
port:3306
Again, I reinstalled mysql command line with port changed to 3307
port:3307
WAMP works fine accessing all the databases but from mysql command line client I could not access all my databases. It is only showing show databases;
information_schema
mysql
test
Jason
14.9k23 gold badges85 silver badges116 bronze badges
asked Jan 2, 2014 at 16:43
![]()
3
In case MySQL Server is up but you are still getting the error:
For anyone who still have this issue,
I followed awesome tutorial http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-9-mavericks/
However i still got #1045 error.
What really did the trick was to change localhost to 127.0.0.1 at your config.inc.php. Why was it failing if locahost points to 127.0.0.1? I don’t know. But it worked.
===== EDIT =====
Long story short, it is because of permissions in mysql. It may be set to accept connections from 127.0.0.1 but not from localhost.
The actual answer for why this isn’t responding is here:
https://serverfault.com/a/297310
answered Jul 2, 2015 at 16:51
![]()
JGutierrezCJGutierrezC
4,2685 gold badges24 silver badges42 bronze badges
2
I was experiencing the same problem on OS X. I’ve solved it now. I post my solution here for anyone who has the similar issue.
Firstly, I set the password for root in mysql client:
shell> mysql -u root
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MY_PASSWORD');
Then, I checked the version info:
shell> /usr/local/mysql/bin/mysqladmin -u root -p version
...
Server version 5.6.26
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 11 min 0 sec
...
Finally, I changed the connect_type parameter from tcp to socket and added the parameter socket in config.inc.php:
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';
answered Sep 8, 2015 at 11:05
micmiamicmia
1,3511 gold badge13 silver badges29 bronze badges
1
If you reinstalled the server it means that that the new installation most likely overwrote your username and passwords. (You might want to try loggin without a password see if it works).
If it is a clean install you need to set the root password .
Otherwise, you will need to reset root permissions.
answered Jan 2, 2014 at 17:21
AresAres
5,8753 gold badges35 silver badges51 bronze badges
Go to phpMyAdmin Directory of your Localhost Software Like Xampp, Mamp or others. Then change the host from localhost to 127.0.0.1 and change the port to 3307 . After that go to your data directory and delete all error log files except ibdata1 which is important file to hold your created database table link. Finaly restart mysql.I think your problem will be solved.
answered Aug 3, 2015 at 13:04
![]()
I just solved this error for myself, but it was a bit silly on my part. Still worth checking if the above doesn’t help you.
In my case, I was editing the config files in /etc/phpmyadmin, my install was located in /usr/share/phpmyadmin, and my install was not actually opening the /etc/phpmyadmin config files, as I thought it would. So I just did this command:
ln -s /etc/phpmyadmin/conf* /usr/share/phpmyadmin
For those not in the know, ln -s makes a soft link (basically a shortcut). So that command just makes shortcuts from the config files in /etc to the /usr/share install.
By the way, I figured this out after using the program opensnoop, which shows you what files are being opened (technically, traces open() syscalls and the pid of the process, as they happen), which you can install on Ubuntu with apt-get install perf-tools-unstable, or you can get it here.
answered Jan 13, 2016 at 4:37
![]()
apricot boyapricot boy
1212 silver badges4 bronze badges
I also had this error. It worked normally after I clean up the cookies.
![]()
Tunaki
130k45 gold badges326 silver badges414 bronze badges
answered Dec 4, 2014 at 9:35
1
After like three (3) hours of google..ing.This is the solution to the problem:
First, I run this command;
$mysqladmin -u root -p[your root password here] version
Which outputs:
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Server version 5.5.49-0ubuntu0.14.04.1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 1 hour 54 min 3 sec
Finally, I changed the connect_type parameter from tcp to socket and added the parameter socket in config.inc.php:
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
All credit goes to this person:
This is the correct solution
answered Jan 31, 2017 at 16:50
You have to go into your mySQL settings and change the settings to Legacy authentication. I use mysql community installer and it allows you to go back and reconfigure the settings.
Create a new user, and choose standard authentication, choose a password, thats it.
Its that simple!!!
answered Jan 18, 2019 at 21:26
![]()
Since the username and password is added in config.inc.php, you need to change:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
TO:
$cfg['Servers'][$i]['auth_type'] = 'config';
And save the file.
You will then need to restart WAMP after making the above changes.
answered Jul 22, 2015 at 20:03
![]()
AndrewL64AndrewL64
15.5k8 gold badges48 silver badges76 bronze badges
I also had this error once, but only with one specific user. So what I did is remove the user and re-create it with the same name and password.
Then after I re-imported the database, it worked.
answered Aug 13, 2016 at 23:22
bytecode77bytecode77
13.8k30 gold badges107 silver badges139 bronze badges
I would suggest 3 things:
- First try clearing browser’s cache
- Try to assign username & password statically into config.inc.php
- Once you’ve done with installation, delete the config.inc.php file under «phpmyadmin» folder
The last one worked for me.
answered Mar 10, 2017 at 8:54
Adding the following $cfg helps to narrow down the problem
$cfg['Error_Handler']['display'] = true;
$cfg['Error_Handler']['gather'] = true;
Don’t forget to remove those $cfg after done debugging!
answered Mar 9, 2018 at 8:07
Every once in a while, and this isn’t often, but every once in a while, there’s a typo in your password. A subtle difference between an upper and lower case letter, for example. I went through many, many of these solutions.
I had simply mistyped the password, and it was saved to my browser, so I didn’t think to check it again.
Since this error CAN be caused by a missed password, just double-check before you go on this quest.
answered Jun 7, 2020 at 20:03
DavidDavid
314 bronze badges
Before you start, go to the directory «phpMyAdmin» preferably the one in your localhost, clear all of your cookies, and have your sql running by entering:
sudo /usr/local/mysql/support-files/mysql.server start
To fix the error , you will have to run the following commands in your terminal:
export PATH=$PATH:/usr/local/mysql/bin/
then:
mysql -u root
after which, you’ll need to change your permissions inside the mySQL shell:
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
Refresh your phpMyAdmin window, re-enter the «root» username (or whichever is applicable), and your password and you should be good to go.
Check http://machiine.com/2013/how-to-setup-phpmyadmin-on-a-mac-with-osx-10-8-mamp-part-3/ if you are willing to set up from scratch.
answered Nov 8, 2014 at 2:21
![]()
0