Error connecting to database access denied for user zabbix localhost using password yes

Stuck with the Zabbix error connecting to database access denied for user? Our skilled Support Engineers have a solution. Click to read.

Zabbix error connecting to database access denied for user will no longer be a problem with Bobcares by your side.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.

Let’s take a look at how our Support Team recently helped a customer who had trouble with connecting to the database.

Zabbix error: Connecting to database access denied for user

Are you facing an Access denied for user ‘root’ @ ‘localhost’ error while attempting to connect to the database? Our Support Engineers have come up with a workaround solution for this particular issue.

Zabbix is a monitoring software tool for various IT components like networks, virtual machines, servers as well as cloud services. Additionally, it offers monitoring metrics like network utilization, disk space consumption, CPU load, and so on. It is a popular open-source software monitoring tool all over the world.

Before we dive into the solution, we need to check the zabbix_server.conf file, user name, password, and database to ensure everything is in order. We will also be able to get a glimpse of the following line in the error log:

[Z3001] connection to database 'zabbixdb' failed: [1045] Access denied for user 'zabbixuser'@'centos62' (using password: YES)
  1. First, we will set user rights with the following command:
    GRANT ALL PRIVILEGES ON * * TO zabbixuser @ "%" IDENTIFIED BY "xxx"; 
    FLUSH PRIVILEGES;
  2. Next, we have to modify the Zabbix configuration file. We can find it at vim/etc/zabbix/web/zabbix.conf.php. The following changes have to be made:
    $ DB [ 'DATABASE'] = 'zabbixdb'; 
    $ DB [ 'USER'] = 'zabbixuser'; 
    $ DB [ 'PASSWORD'] = 'xxx';
  3. After that, we have to restart the service by executing this command:
    service zabbix-server restart
  4. Finally, we will be able to access http://xxx.xxx.xxx.xxx/zabbix/login by entering the username and password.

[Need help with another query? We are available 24/7.]

Conclusion

In brief, the skilled Support Engineers at Bobcares demonstrated how to resolve the Zabbix error: database access denied for user.

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

  • Печать

Страницы: [1]   Вниз

Тема: zabbix ошибка входа  (Прочитано 15074 раз)

0 Пользователей и 2 Гостей просматривают эту тему.

Оффлайн
vetallkvn

mysql_connect(): Access denied for user ‘zabbix’@’localhost’ (using password: YES)[/usr/share/zabbix/include/db.inc.php:58]

Установлена ubuntu 10.04 Все с репов. При попытке входа пишет ошибку. Как поправить?


Оффлайн
xeon_greg

ну четко же пишет в чем проблема, логин , пароль правильные?


Оффлайн
Дмитрий Бо

Проверить можно так: mysql -u zabbix -p


Оффлайн
vetallkvn

Что пишет я прекрасно вижу. Но такого пользователя я не создавал, а он создался сам при установке zabbix. Поэтому и спрашиваю как поправить.


Оффлайн
nomeron

Либо создать в mysql  пользователя zabbix и дать права доступа к базе, либо  http://xxxxx/zabbix/instal.php и в п.4 настроить Configure DB connection.
Или как вариант скачать виртуальную машину на которой все настроено.


Оффлайн
Дмитрий Бо

Что пишет я прекрасно вижу. Но такого пользователя я не создавал, а он создался сам при установке zabbix. Поэтому и спрашиваю как поправить.

Если он действительно создался — разрешить ему логиниться с локалхоста и дать права на нужную БД.


Оффлайн
vetallkvn

Спасибо, большое, за помощь.


Пользователь решил продолжить мысль 10 Октября 2011, 10:25:41:


Что пишет я прекрасно вижу. Но такого пользователя я не создавал, а он создался сам при установке zabbix. Поэтому и спрашиваю как поправить.

Если он действительно создался — разрешить ему логиниться с локалхоста и дать права на нужную БД.

Но в списке пользователей я его не вижу, но при попытке создать такого, система говорит, что он есть уже.


Пользователь решил продолжить мысль 10 Октября 2011, 10:35:59:


Либо  http://xxxxx/zabbix/instal.php и в п.4 настроить Configure DB connection.
Или как вариант скачать виртуальную машину на которой все настроено.

Таже ошибка про доступ.


Пользователь решил продолжить мысль 10 Октября 2011, 13:04:25:


Проверить можно так: mysql -u zabbix -p

accessdenied for users zabbix@localhost

« Последнее редактирование: 10 Октября 2011, 13:04:25 от vetallkvn »


Оффлайн
xeon_greg

при установке заббикса у тебя к в консоли спрашивали пароль всего 3 раза
1  — рутовый пароль к mysql , чтобы создать базу заббикса и юзеров
2,3 —  пароль и его подтверждение на саму базу для юзера zabbix
ты помнишь что вводил?


Пользователь решил продолжить мысль 10 Октября 2011, 13:32:27:


если не помнишь, какой пароль вводил, заходи в mysql под root  меняй пароль для пользователя zabbix  и в /etc/zabbix/ есть файл конфига базы (точно не помню как называется), там прописаны логин и пароль на базу и измени там пароль на новый

« Последнее редактирование: 10 Октября 2011, 13:33:47 от xeon_greg »


Оффлайн
Дмитрий Бо

Если он действительно создался — разрешить ему логиниться с локалхоста и дать права на нужную БД.

Но в списке пользователей я его не вижу, но при попытке создать такого, система говорит, что он есть уже.

Где ты смотришь список и пытаешься создать?
На всякий случай уточняю, что в системе свои пользователи, в MySQL — свои. Нас интересует пользователь zabbix из MySQL.


Оффлайн
vetallkvn

при установке заббикса у тебя к в консоли спрашивали пароль всего 3 раза
1  — рутовый пароль к mysql , чтобы создать базу заббикса и юзеров
2,3 —  пароль и его подтверждение на саму базу для юзера zabbix
ты помнишь что вводил?


Пользователь решил продолжить мысль 10 Октября 2011, 13:32:27:


если не помнишь, какой пароль вводил, заходи в mysql под root  меняй пароль для пользователя zabbix  и в /etc/zabbix/ есть файл конфига базы (точно не помню как называется), там прописаны логин и пароль на базу и измени там пароль на новый

Дело на виртуалке, поэтому уже два раза систему окатил и снова поставил. Пароль конечно помню (он везде один), так вот результат один и тот же.


Оффлайн
xeon_greg

Цитата: Дмитрий Бо от 08 Октябрь 2011, 12:42:57

    Проверить можно так: mysql -u zabbix -p

accessdenied for users zabbix@localhost

ну если это пробовал и не помогло . значит пароль таки не правильный. заходи под рутом и меняй, заодно проверишь есть ли доступ у zabbix  к базе


Оффлайн
vetallkvn

Откатил на начало. Создал пользователя в ОС, а потом поставил zabbix и все заработало. Спасибо всем.


Оффлайн
Дмитрий Бо


  • Печать

Страницы: [1]   Вверх

By trying to open Zabbix 2.2.2 server web-interface, I’ve got an error:

Database error: Error connecting to database [Access denied for user 'zabbix'@'localhost' (using password: YES)]

This is log:

870:20140716:181121.327 Starting Zabbix Server. Zabbix 2.2.2 (revision 42525).
   870:20140716:181121.327 ****** Enabled features ******
   870:20140716:181121.328 SNMP monitoring:           YES
   870:20140716:181121.328 IPMI monitoring:            NO
   870:20140716:181121.328 WEB monitoring:            YES
   870:20140716:181121.329 VMware monitoring:          NO
   870:20140716:181121.329 Jabber notifications:      YES
   870:20140716:181121.329 Ez Texting notifications:  YES
   870:20140716:181121.329 ODBC:                       NO
   870:20140716:181121.329 SSH2 support:               NO
   870:20140716:181121.330 IPv6 support:              YES
   870:20140716:181121.330 ******************************
   870:20140716:181121.330 using configuration file: /usr/local/etc/zabbix22/zabbix_server.conf
   870:20140716:181121.335 current database version (mandatory/optional): 02020000/02020000
   870:20140716:181121.335 required mandatory version: 02020000
   871:20140716:181121.345 server #1 started [configuration syncer #1]
   872:20140716:181121.346 server #2 started [db watchdog #1]
   870:20140716:181121.395 server #0 started [main process]
   873:20140716:181121.424 server #3 started [poller #1]
   874:20140716:181121.452 server #4 started [poller #2]
   875:20140716:181121.479 server #5 started [poller #3]
   876:20140716:181121.509 server #6 started [poller #4]
   877:20140716:181121.535 server #7 started [poller #5]
   878:20140716:181121.564 server #8 started [unreachable poller #1]

No messages about connection error. This is configuration file:

### Option: DBHost
#       Database host name.
#       If set to localhost, socket is used for MySQL.
#       If set to empty string, socket is used for PostgreSQL.
#
# Mandatory: no
# Default:
DBHost=localhost

### Option: DBName
#       Database name.
#       For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
#
# Mandatory: yes
# Default:
# DBName=

DBName=zabbix
### Option: DBSchema
#       Schema name. Used for IBM DB2.
#
# Mandatory: no
# Default:
# DBSchema=

### Option: DBUser
#       Database user. Ignored for SQLite.
#
# Mandatory: no
# Default:
# DBUser=

DBUser=zabbix

### Option: DBPassword
#       Database password. Ignored for SQLite.
#       Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=zabbix

### Option: DBSocket
#       Path to MySQL socket.
#
# Mandatory: no
# Default:
#DBSocket=/tmp/mysql.sock
### Option: DBPort
#       Database port when not using local socket. Ignored for SQLite.
#
# Mandatory: no
# Range: 1024-65535
# Default (for MySQL):
# DBPort=3306

I can connect from shell with that username and password:

root@zabbix-srv:/usr/home/ishayahu # mysql -u zabbix -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 167
Server version: 5.5.37 Source distribution

Copyright (c) 2000, 2014, 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.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql> show grants for 'zabbix'@'localhost';
+------------------------------------------------------------------------------------------------------------------------+
| Grants for zabbix@localhost                                                                                            |
+------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'zabbix'@'localhost' IDENTIFIED BY PASSWORD '*DEEF4D7D88CD046ECA02A80393B7780A63E7E789' |
| GRANT ALL PRIVILEGES ON `zabbix`.* TO 'zabbix'@'localhost'                                                             |
+------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

Thank you for help!

I’m having trouble starting zabbix server on centOS 7.

This is the status message I get after trying to start zabbix-server:

[root@monitor2:~] #systemctl status zabbix-server
zabbix-server.service - Zabbix Server
   Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled)
   Active: failed (Result: start-limit) since Thu 2016-04-28 01:15:16 EDT; 20s ago
  Process: 23744 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=killed, signal=SEGV)
 Main PID: 31446 (code=exited, status=1/FAILURE)

Apr 28 01:15:16 monitor2 systemd[1]: zabbix-server.service: control process exited, code=killed status=11
Apr 28 01:15:16 monitor2 systemd[1]: Failed to start Zabbix Server.
Apr 28 01:15:16 monitor2 systemd[1]: Unit zabbix-server.service entered failed state.
Apr 28 01:15:16 monitor2 systemd[1]: zabbix-server.service holdoff time over, scheduling restart.
Apr 28 01:15:16 monitor2 systemd[1]: Stopping Zabbix Server...
Apr 28 01:15:16 monitor2 systemd[1]: Starting Zabbix Server...
Apr 28 01:15:16 monitor2 systemd[1]: zabbix-server.service start request repeated too quickly, refusing to start.
Apr 28 01:15:16 monitor2 systemd[1]: Failed to start Zabbix Server.
Apr 28 01:15:16 monitor2 systemd[1]: Unit zabbix-server.service entered failed state.

And this is what I see in the zabbix server log:

[root@monitor2:~] #tail /var/log/zabbix/zabbix_server.log
zabbix_server [24366]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24366]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24370]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24370]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24374]: [file:'log.c',line:271] lock failed: [43] Identifier removed
zabbix_server [24374]: [file:'log.c',line:271] lock failed: [43] Identifier removed
 24378:20160428:011714.312 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)
 24378:20160428:011714.312 database is down: reconnecting in 10 seconds
 19933:20160428:011714.593 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)
 19933:20160428:011714.593 database is down: reconnecting in 10 seconds

This is my /etc/zabbix/zabbix_server.conf file:

LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBName=zabbix
DBUser=zabbix
DBPassword='secret'
SNMPTrapperFile=/var/log/snmptt/snmptt.log
ListenIP=127.0.0.1
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts

And this is my /etc/zabbix/web/zabbix.conf.php

 <?php
// Zabbix GUI configuration file.
global $DB;

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = '127.0.0.1';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'secret';

// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'zabbix.example.com';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'Zabbix';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>

And I can connect to the mysql database using the same credentials as I have listed in both config files:

[root@monitor2:~] #mysql -uzabbix -p -h 127.0.0.1
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 36326
Server version: 10.0.22-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

So I don’t know why the zabbix server fails to connect to the database.

I’d appreciate some help on this!

Описание проблемы:

Введите http://192.168.34.7/zabbix в браузере и обнаружите следующую ошибку
Error connecting to database: Access denied for user ‘zabbix’ @ ‘localhost’ to database ‘zabbix’(PASSWORD:YES)

анализ:
Из приведенного выше сообщения об ошибке мы можем обнаружить, что разрешения на отображение недостаточно при подключении к базе данных, поэтому мы можем выполнить следующие шаги, чтобы решить эту проблему.
1. Сначала войдите в msyql на машине, чтобы проверить, удастся ли это.

Команда входа в систему: mysql -uzabbix -p пароль

Если авторизация не удалась, проверьте, правильный ли пароль для входа в систему и есть ли у пользователя zabbix разрешение на вход в базу данных.
2. Если описанное выше может быть успешным, но ошибка все еще не устранена, проверьте файл zabbix_server.conf, чтобы проверить правильность настроек в файле.

3. Если описанное выше по-прежнему не удается, проверьте правильность настроек в zabbix.conf.php, обычно пароль установлен неверно.

Выполните описанный выше процесс, чтобы решить проблему.

Понравилась статья? Поделить с друзьями:
  • Error connecting to agent no such file or directory ssh add windows 10
  • Error connect to ek5 calculate перевод
  • Error connect psrc pmid как исправить
  • Error constexpr needed for in class initialization of static data member
  • Error connect failed please try again check ip and port check network connection ок