Author Topic: DKIM Manager fails to connect to MySQL  (Read 617 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
DKIM Manager fails to connect to MySQL
« on: December 06, 2020, 04:23:00 PM »
When opening DKIM Manager section it shows multiple errors connecting to MySQL
Code: [Select]
Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php on line 0

Warning: mysqli_query(): Couldn't fetch mysqli in /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php on line 0

Notice: Trying to get property 'num_rows' of non-object in /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php on line 0

Warning: mysqli_query(): Couldn't fetch mysqli in /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php on line 0

Notice: Trying to get property 'num_rows' of non-object in /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php on line 0

Warning: mysqli_query(): Couldn't fetch mysqli in /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php on line 0

Notice: Trying to get property 'num_rows' of non-object in /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php on line 0

Root account is set with password and doesn't have any other issues with the other SQL tables.
There is no bind-address set in /etc/my.cnf so I don't know if localhost if suitable for connection.

Seems it's not happy with @localhost (may be it wants "127.0.0.1" but I don't know which CWP config files to change) or for some reason root is missing some permissions over some table?

How to fix it?

Offline
*
Re: DKIM Manager fails to connect to MySQL
« Reply #1 on: January 11, 2021, 04:10:15 AM »
Hey support!
Can you at least tell me which file is used for SQL settings when connecting from /usr/local/cwpsrv/htdocs/resources/admin/modules/dkim.php

I changed my SQL root password manually some time ago and seems it's not updated somewhere in CWP config.
(Of course in /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php root pass is correct)
« Last Edit: January 11, 2021, 04:12:12 AM by Hardoman »

Offline
*
Re: DKIM Manager fails to connect to MySQL
« Reply #2 on: January 11, 2021, 09:52:34 AM »
http://wiki.centos-webpanel.com/how-to-reset-mysql-root-password
maybe you have some special characters, probably the best is to use the cwp auto-generate random password
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: DKIM Manager fails to connect to MySQL
« Reply #3 on: January 12, 2021, 12:26:28 AM »
Thanks, I finally found the root cause.
in the old CWP installation /root/.my.cnf file looked like

Code: [Select]
[client]
user=root
password='password'

I have compared with a fresh installation and it looks like:
Code: [Select]
[client]
password=password
user=root

I removed the ' ' symbols from the password and it started to work perfectly well.
Note: nevertheless CWP was auto-updated the my.cnf file remained old

Hope it will help someone because it caused may other related issues including cron fails.
I also prevented New backup page to show up (it was completely blank)...

Issue resolved, thanks.