Zabbix database error permission denied

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 ошибка входа  (Прочитано 15087 раз)

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]   Вверх

Hi,
I have Centos 7

[root@localhost log]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

I did install zbxtg from wiki

cat /var/log/zabbix/zabbix_server.log
13460:20190209:001533.252 Got signal
[signal:15(SIGTERM),sender_pid:13797,sender_uid:0,reason:0]. Exiting …
13460:20190209:001533.310 [Z3001] connection to database ‘zabbix’ failed: [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2 «No such file or directory»)
13460:20190209:001533.311 Cannot connect to the database. Exiting…
3538:20190209:001851.365 Starting Zabbix Server. Zabbix 4.0.4 (revision 89349).
3538:20190209:001851.382 ****** Enabled features ******
3538:20190209:001851.382 SNMP monitoring: YES
3538:20190209:001851.382 IPMI monitoring: YES
3538:20190209:001851.382 Web monitoring: YES
3538:20190209:001851.382 VMware monitoring: YES
3538:20190209:001851.382 SMTP authentication: YES
3538:20190209:001851.382 Jabber notifications: YES
3538:20190209:001851.382 Ez Texting notifications: YES
3538:20190209:001851.382 ODBC: YES
3538:20190209:001851.382 SSH2 support: YES
3538:20190209:001851.382 IPv6 support: YES
3538:20190209:001851.382 TLS support: YES
3538:20190209:001851.382 ******************************
3538:20190209:001851.382 using configuration file: /etc/zabbix/zabbix_server.conf
3538:20190209:001851.419 [Z3001] connection to database ‘zabbix’ failed: [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2 «No such file or directory»)
3538:20190209:001851.419 database is down: reconnecting in 10 seconds
3538:20190209:001859.049 database connection re-established
3538:20190209:001859.051 current database version (mandatory/optional): 04000000/04000003
3538:20190209:001859.051 required mandatory version: 04000000
3538:20190209:001859.148 server #0 started [main process]
4091:20190209:001859.150 server #1 started [configuration syncer #1]
4092:20190209:001859.150 server #2 started [alerter #1]
4093:20190209:001859.151 server #3 started [alerter #2]
4094:20190209:001859.151 server #4 started [alerter #3]
4095:20190209:001859.152 server #5 started [housekeeper #1]
4096:20190209:001859.152 server #6 started [timer #1]
4097:20190209:001859.153 server #7 started [http poller #1]
4098:20190209:001859.154 server #8 started [discoverer #1]
4100:20190209:001859.155 server #10 started [history syncer #2]
4103:20190209:001859.159 server #13 started [escalator #1]
4108:20190209:001859.164 server #17 started [poller #1]
4101:20190209:001859.164 server #11 started [history syncer #3]
4105:20190209:001859.165 server #14 started [proxy poller #1]
4099:20190209:001859.166 server #9 started [history syncer #1]
4107:20190209:001859.170 server #16 started [task manager #1]
4111:20190209:001859.171 server #20 started [poller #4]
4109:20190209:001859.177 server #18 started [poller #2]
4102:20190209:001859.178 server #12 started [history syncer #4]
4106:20190209:001859.179 server #15 started [self-monitoring #1]
4110:20190209:001859.180 server #19 started [poller #3]
4112:20190209:001859.183 server #21 started [poller #5]
4115:20190209:001859.190 server #22 started [unreachable poller #1]
4117:20190209:001859.200 server #24 started [trapper #2]
4122:20190209:001859.201 server #26 started [trapper #4]
4121:20190209:001859.205 server #25 started [trapper #3]
4116:20190209:001859.205 server #23 started [trapper #1]
4125:20190209:001859.209 server #29 started [alert manager #1]
4124:20190209:001859.212 server #28 started [icmp pinger #1]
4126:20190209:001859.213 server #30 started [preprocessing manager #1]
4123:20190209:001859.213 server #27 started [trapper #5]
4128:20190209:001859.224 server #31 started [preprocessing worker #1]
4129:20190209:001859.225 server #32 started [preprocessing worker #2]
4134:20190209:001859.235 server #33 started [preprocessing worker #3]

When i started scrip manual — it’s ok.

[root@localhost zabbix]# /usr/lib/zabbix/alertscripts/zbxtg.py «@avdanilov» «тест21» «тестовое сообщение12» —debug
zbxtg.py: {u’ok’: True, u’result’: {u’username’: u’ithelp_group_zbx_bot’, u’first_name’: u’Monitoring IT Help Group’, u’is_bot’: True, u’id’: 762026319}}
zbxtg.py: Cache file with uids: /usr/lib/zabbix/zbxtg/uids.txt
zbxtg.py: Trying to read cached uid for avdanilov, private, from /usr/lib/zabbix/zbxtg/uids.txt
zbxtg.py: Telegram uid of private ‘avdanilov’: 111981553

zbxtg.py: Trying to /sendMessage:
zbxtg.py: https://api.telegram.org/bot762026319:AAG6jb7vde0JNZV9WZWk-WaLfvxRToBycYs/sendMessage
zbxtg.py: post params: {‘text’: ‘xd1x82xd0xb5xd1x81xd1x8221nxd1x82xd0xb5xd1x81xd1x82xd0xbexd0xb2xd0xbexd0xb5 xd1x81xd0xbexd0xbexd0xb1xd1x89xd0xb5xd0xbdxd0xb8xd0xb512’, ‘disable_notification’: False, ‘chat_id’: ‘111981553n’, ‘disable_web_page_preview’: False}
{u’ok’: True, u’result’: {u’date’: 1549662356, u’text’: u’u0442u0435u0441u044221nu0442u0435u0441u0442u043eu0432u043eu0435 u0441u043eu043eu0431u0449u0435u043du0438u043512′, u’from’: {u’username’: u’ithelp_group_zbx_bot’, u’first_name’: u’Monitoring IT Help Group’, u’is_bot’: True, u’id’: 762026319}, u’message_id’: 60, u’chat’: {u’username’: u’avdanilov’, u’first_name’: u’u0410u043du0434u0440u0435u0439′, u’last_name’: u’u0414u0430u043du0438u043bu043eu0432′, u’type’: u’private’, u’id’: 111981553}}}

But when it’s did zabbix, i get error:

Traceback (most recent call last):
File «/usr/lib/zabbix/alertscripts/zbxtg.py», line 909, in
main()
File «/usr/lib/zabbix/alertscripts/zbxtg.py», line 785, in main
uid = tg.get_uid(zbx_to)
File «/usr/lib/zabbix/alertscripts/zbxtg.py», line 179, in get_uid
updates = self.get_updates()
File «/usr/lib/zabbix/alertscripts/zbxtg.py», line 67, in get_updates
answer = requests.post(url, params=params, proxies=self.proxies)
File «/usr/lib/python2.7/site-packages/requests/api.py», line 112, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File «/usr/lib/python2.7/site-packages/requests/api.py», line 58, in request
return session.request(method=method, url=url, **kwargs)
File «/usr/lib/python2.7/site-packages/requests/sessions.py», line 508, in request
resp = self.send(prep, **send_kwargs)
File «/usr/lib/python2.7/site-packages/requests/sessions.py», line 618, in send
r = adapter.send(request, **kwargs)
File «/usr/lib/python2.7/site-packages/requests/adapters.py», line 502, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host=’api.telegram.org’, port=443): Max retries exceeded with url: /bot762026319:AAG6jb7vde0JNZV9WZWk-WaLfvxRToBycYs/getUpdates?offset=0 (Caused by ProxyError(‘Cannot connect to proxy.’, NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1e5678efd0>: Failed to establish a new connection: [Errno 13] Permission denied’,))

[root@localhost zabbix]# pip list
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
Package Version


backports.ssl-match-hostname 3.5.0.1
certifi 2018.11.29
chardet 3.0.4
configobj 4.7.2
decorator 3.4.0
idna 2.6
iniparse 0.4
ipaddress 1.0.16
IPy 0.75
oauthlib 3.0.1
pep8 1.7.1
perf 0.1
pip 19.0.1
policycoreutils-default-encoding 0.1
proxy 0.0.1
pycurl 7.19.0
pygobject 3.22.0
pygpgme 0.3
pyliblzma 0.5.3
PySocks 1.6.8
python-linux-procfs 0.4.9
pyudev 0.15
pyxattr 0.5.1
requests 2.18.4
requests-oauthlib 0.6.2
requests-toolbelt 0.9.1
schedutils 0.4
seobject 0.1
sepolicy 1.1
setuptools 0.9.8
slip 0.4.0
slip.dbus 0.4.0
urlgrabber 3.10
urllib3 1.22
wheel 0.32.3
yum-metadata-parser 1.1.4

What is wrong ? =)

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Zabbix database error connection refused centos
  • Zabbix configure error mysql library not found
  • Zabbix configuration file error permission denied
  • Zabbix appliance database error
  • Zabbix an authentication function returned an error

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии