phpMyAdmin Error #1045

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

T1mbo
Сообщения: 13
ОС: Debian Lenny

phpMyAdmin Error #1045

Сообщение T1mbo »

Доброй ночи! Дистр Debian Lenny. Возникла такая проблема: вдруг отвалился phpmyadmin при попытке зайти под любым логином и паролем выдает следующее: #1045 Cannot log in to the MySQL server. Пробую зайти через mysql-client - все в порядке, все работает. Перерыл все, включая iptables. Сравнивал конфиги, переставлял пакеты, брал конфиги с других серверов, нифига. Прошу вашей помощи.
Спасибо сказали:
Аватара пользователя
ieleja
Сообщения: 307
ОС: Debian 9, macOS, Windows

Re: phpMyAdmin Error #1045

Сообщение ieleja »

почистить кеш и кукис бровсера?
ad infinitum
Спасибо сказали:
T1mbo
Сообщения: 13
ОС: Debian Lenny

Re: phpMyAdmin Error #1045

Сообщение T1mbo »

Пробовали 3 человека с разных браузеров. Не работает, логи молчат.
Спасибо сказали:
Аватара пользователя
Ленивая Бестолочь
Бывший модератор
Сообщения: 2760
ОС: Debian; gentoo

Re: phpMyAdmin Error #1045

Сообщение Ленивая Бестолочь »

интерфейс lo поднят?
если, конечно, подключаетеся через него.
вообще - конфиги, конфиги давайте :)
Солнце садилось в море, а люди с неоконченным высшим образованием выбегали оттуда, думая, что море закипит.
Спасибо сказали:
patrius
Сообщения: 337
ОС: Debian (4 & 5) -> Gentoo

Re: phpMyAdmin Error #1045

Сообщение patrius »

T1mbo писал(а): ↑
17.10.2010 23:24
Доброй ночи! Дистр Debian Lenny. Возникла такая проблема: вдруг отвалился phpmyadmin при попытке зайти под любым логином и паролем выдает следующее: #1045 Cannot log in to the MySQL server. Пробую зайти через mysql-client - все в порядке, все работает. Перерыл все, включая iptables. Сравнивал конфиги, переставлял пакеты, брал конфиги с других серверов, нифига. Прошу вашей помощи.

phpMyAdmin - это совокупность скриптов написанных на PHP

Проверь работоспособность PHP, очень вероятно, что прошло изменение настроек.
Спасибо сказали:
T1mbo
Сообщения: 13
ОС: Debian Lenny

Re: phpMyAdmin Error #1045

Сообщение T1mbo »

Проверь работоспособность PHP, очень вероятно, что прошло изменение настроек.


На этом сервере стоит форум. Он же работает.


Логи mysql чистые
Спасибо сказали:
distress
Сообщения: 84
ОС: RHEL5

Re: phpMyAdmin Error #1045

Сообщение distress »

T1mbo писал(а): ↑
25.10.2010 14:40
Логи mysql чистые

логи вебсервера/пхп ?
Спасибо сказали:
T1mbo
Сообщения: 13
ОС: Debian Lenny

Re: phpMyAdmin Error #1045

Сообщение T1mbo »

в error.log чисто

в access.log вот:

Код: Выделить всё

192.168.0.252 - [25/Oct/2010:23:14:05 +0600] "POST /phpmyadmin/index.php HTTP/1.1" 302 20 "http://webserver/phpmyadmin/" "Mozilla/5.0 (X11; U; Linux i686; r$
192.168.0.252 - [25/Oct/2010:23:14:07 +0600] "GET /phpmyadmin/index.php?token=71481add746a41bc694e533c18638e88 HTTP/1.1" 200 2465 "http://webserver/phpmyadm$
192.168.0.252 - [25/Oct/2010:23:14:07 +0600] "GET /phpmyadmin/print.css HTTP/1.1" 304 0 "http://webserver/phpmyadmin/index.php?token=71481add746a41bc694e533$
192.168.0.252 - [25/Oct/2010:23:14:07 +0600] "GET /phpmyadmin/phpmyadmin.css.php?token=71481add746a41bc694e533c18638e88&js_frame=right&nocache=3797098077 HT$
192.168.0.252 - [25/Oct/2010:23:14:07 +0600] "GET /phpmyadmin/themes/original/img/logo_right.png HTTP/1.1" 304 0 "http://webserver/phpmyadmin/index.php?toke$
192.168.0.252 - [25/Oct/2010:23:14:07 +0600] "GET /phpmyadmin/themes/original/img/b_help.png HTTP/1.1" 304 0 "http://webserver/phpmyadmin/index.php?token=71$
192.168.0.252 - [25/Oct/2010:23:14:07 +0600] "GET /phpmyadmin/themes/original/img/s_error.png HTTP/1.1" 304 0 "http://webserver/phpmyadmin/phpmyadmin.css.ph$
Спасибо сказали:
distress
Сообщения: 84
ОС: RHEL5

Re: phpMyAdmin Error #1045

Сообщение distress »

config.inc.php посмотреть бы
Спасибо сказали:
T1mbo
Сообщения: 13
ОС: Debian Lenny

Re: phpMyAdmin Error #1045

Сообщение T1mbo »

/etc/phpmyadmin/config.inc.php

Код: Выделить всё

<?php
/**
 * Debian local configuration file
 *
 * This file overrides the settings made by phpMyAdmin interactive setup
 * utility.
 *
 * For example configuration see /usr/share/doc/phpmyadmin/examples/config.default.php.gz
 *
 * NOTE: do not add security sensitive data to this file (like passwords)
 * unless you really know what you're doing. If you do, any user that can
 * run PHP or CGI on your webserver will be able to read them. If you still
 * want to do this, make sure to properly secure the access to this file
 * (also on the filesystem level).
 */

/**
 * Server(s) configuration
 */
$i = 0;
// The $cfg['Servers'] array starts with $cfg['Servers'][1].  Do not use $cfg['Servers'][0].
// You can disable a server config entry by setting host to ''.
$i++;

/**
 * Read configuration from dbconfig-common
 * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
 */
if (is_readable('/etc/phpmyadmin/config-db.php')) {
    require('/etc/phpmyadmin/config-db.php');
}

/* Configure according to dbconfig-common if enabled */
if (!empty($dbname)) {
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    if (empty($dbserver)) $dbserver = 'localhost';
    $cfg['Servers'][$i]['host'] = $dbserver;

    if (!empty($dbport)) {
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
        $cfg['Servers'][$i]['port'] = $dbport;
    }
    //$cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    /* Optional: User for advanced features */
    $cfg['Servers'][$i]['controluser'] = $dbuser;
    $cfg['Servers'][$i]['controlpass'] = $dbpass;
    /* Optional: Advanced phpMyAdmin features */
    $cfg['Servers'][$i]['pmadb'] = $dbname;
    $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    $cfg['Servers'][$i]['relation'] = 'pma_relation';
    $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    $cfg['Servers'][$i]['history'] = 'pma_history';
    $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
    $cfg['Servers'][$i]['tracking'] = 'pma_tracking';

    /* Uncomment the following to enable logging in to passwordless accounts,
     * after taking note of the associated security risks. */
    // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

    /* Advance to next server for rest of config */
    $i++;
}

/* Authentication type */
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
//$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
//$cfg['Servers'][$i]['extension'] = 'mysql';
/* Optional: User for advanced features */
// $cfg['Servers'][$i]['controluser'] = '$dbuser';
// $cfg['Servers'][$i]['controlpass'] = '$dbpass';
/* Optional: Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
/* Uncomment the following to enable logging in to passwordless accounts,
 * after taking note of the associated security risks. */
// $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;

/*
 * End of servers configuration
 */

/*
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';



/usr/share/phpmyadmin/config.inc.php

Код: Выделить всё

<?php
/**
 * Please, do not edit this file. The configuration file for Debian
 * is located in the /etc/phpmyadmin directory.
 */

// Load secret generated on postinst
include('/var/lib/phpmyadmin/blowfish_secret.inc.php');

// Load autoconf local config
include('/var/lib/phpmyadmin/config.inc.php');

// Load user's local config
include('/etc/phpmyadmin/config.inc.php');

// Set the default server if there is no defined
if (!isset($cfg['Servers'])) {
    $cfg['Servers'][1]['host'] = 'localhost';
}

// Set the default values for $cfg['Servers'] entries
for ($i=1; (!empty($cfg['Servers'][$i]['host']) || (isset($cfg['Servers'][$i]['connect_type']) && $cfg['Servers'][$i]['connect_type'] == 'socket')); $i++) {
    if (!isset($cfg['Servers'][$i]['auth_type'])) {
        $cfg['Servers'][$i]['auth_type'] = 'cookie';
    }
    if (!isset($cfg['Servers'][$i]['host'])) {
        $cfg['Servers'][$i]['host'] = 'localhost';
    }
    if (!isset($cfg['Servers'][$i]['connect_type'])) {
        $cfg['Servers'][$i]['connect_type'] = 'tcp';
    }
    if (!isset($cfg['Servers'][$i]['compress'])) {
        $cfg['Servers'][$i]['compress'] = false;
    }
    if (!isset($cfg['Servers'][$i]['extension'])) {
        $cfg['Servers'][$i]['extension'] = 'mysql';
    }
}
Спасибо сказали:
distress
Сообщения: 84
ОС: RHEL5

Re: phpMyAdmin Error #1045

Сообщение distress »

а почему конфигов 2 ? может еще где-то 3-й есть который всё портит ?

если

Код: Выделить всё

$cfg['Servers'][$i]['connect_type'] = 'tcp';

значит надо попробовать что-то вроде

user@host

$ mysql -u root -h 127.0.0.1


проверить открыт ли порт и на какой ip.

root@host

# netstat -ntlp ... tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 16043/mysqld ...

Спасибо сказали:
T1mbo
Сообщения: 13
ОС: Debian Lenny

Re: phpMyAdmin Error #1045

Сообщение T1mbo »

3ий конфиг есть: /var/lib/phpmyadmin/config.inc.php, но он весом в 0 байт.


host:~# mysql -u root -h 127.0.0.1

Код: Выделить всё

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


host:~# netstat -ntlp

Код: Выделить всё

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:5280            0.0.0.0:*               LISTEN      2995/beam
tcp        0      0 0.0.0.0:5222            0.0.0.0:*               LISTEN      2995/beam
tcp        0      0 0.0.0.0:5223            0.0.0.0:*               LISTEN      2995/beam
tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      2108/amavisd (maste
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      4119/master
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      29139/mysqld
tcp        0      0 127.0.0.1:783           0.0.0.0:*               LISTEN      2575/spamd.pid
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1755/portmap
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      2980/epmd
tcp        0      0 127.0.0.1:5555          0.0.0.0:*               LISTEN      2995/beam
tcp        0      0 127.0.0.1:980           0.0.0.0:*               LISTEN      4196/famd
tcp        0      0 127.0.0.1:5556          0.0.0.0:*               LISTEN      2995/beam
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      4135/pure-ftpd (SER
tcp        0      0 192.168.3.3:53          0.0.0.0:*               LISTEN      4044/mydns
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      4044/mydns
tcp        0      0 0.0.0.0:5269            0.0.0.0:*               LISTEN      2995/beam
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2081/sshd
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      2251/postgres
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      4119/master
tcp        0      0 0.0.0.0:38909           0.0.0.0:*               LISTEN      1767/rpc.statd
tcp        0      0 0.0.0.0:54846           0.0.0.0:*               LISTEN      2995/beam
tcp6       0      0 :::993                  :::*                    LISTEN      2952/couriertcpd
tcp6       0      0 :::995                  :::*                    LISTEN      2970/couriertcpd
tcp6       0      0 :::139                  :::*                    LISTEN      4152/smbd
tcp6       0      0 :::110                  :::*                    LISTEN      2958/couriertcpd
tcp6       0      0 :::143                  :::*                    LISTEN      2940/couriertcpd
tcp6       0      0 :::8080                 :::*                    LISTEN      12120/apache2
tcp6       0      0 :::80                   :::*                    LISTEN      12120/apache2
tcp6       0      0 :::8081                 :::*                    LISTEN      12120/apache2
tcp6       0      0 :::21                   :::*                    LISTEN      4135/pure-ftpd (SER
tcp6       0      0 ::1:53                  :::*                    LISTEN      4044/mydns
tcp6       0      0 :::22                   :::*                    LISTEN      2081/sshd
tcp6       0      0 ::1:5432                :::*                    LISTEN      2251/postgres
tcp6       0      0 :::8090                 :::*                    LISTEN      4035/icecast2
tcp6       0      0 :::443                  :::*                    LISTEN      12120/apache2
tcp6       0      0 :::445                  :::*                    LISTEN      4152/smbd




Спасибо сказали:
distress
Сообщения: 84
ОС: RHEL5

Re: phpMyAdmin Error #1045

Сообщение distress »

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


user@host

$ mysql -u username -p -h 127.0.0.1 Enter password:


username/password подставить правильные
Спасибо сказали:
T1mbo
Сообщения: 13
ОС: Debian Lenny

Re: phpMyAdmin Error #1045

Сообщение T1mbo »


Код: Выделить всё

host:~# mysql -u root -p -h 127.0.0.1
Enter password:
Welcome to the MySQL monitor.  Commands end with; or \g.
Your MySQL connection id is 20341
Server version: 5.0.51a-24+lenny4 (Debian)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Спасибо сказали:
distress
Сообщения: 84
ОС: RHEL5

Re: phpMyAdmin Error #1045

Сообщение distress »

попробовать phpmyadmin с официального сайта? у него конфиг один, лежит в корне
Спасибо сказали: