liuch / dmarc-srg

A php parser, viewer and summary report generator for incoming DMARC reports.
GNU General Public License v3.0
218 stars 32 forks source link

DB Error on web interface #1

Closed fgams352 closed 1 year ago

fgams352 commented 3 years ago

Thank you for sharing this much needed software!

I'm getting an error message when I try to use the web interface:

DB Error 1045: Access denied for user 'root'@'localhost' (using password: YES)

I have followed the instructions and added the correct creds to the conf.php file.

thanks

liuch commented 3 years ago

Hello! As far as I can see in the error message, you used root as your user name. You should use a different username for that (not root) because in new versions of mysql / mariadb, using root without sudo is prohibited for security reasons.

fgams352 commented 3 years ago

nope, I created the user d'marc_user' and have tested the login with mysql utility.

maybe its a php.ini setting?

fgams352 commented 3 years ago

oops username is 'dmarc_user'

liuch commented 3 years ago

In your error message, I see the root user, which shouldn't be there. Are you sure that your conf.php looks like this?

$database = [
    'host'     => 'localhost',
    'type'     => 'mysql',
    'name'     => 'dmarc',
    'user'     => 'dmarc_user',
    'password' => 'yourpassword'
];
fgams352 commented 3 years ago

below is my conf.php file, its like the variables are not being passed to the functions.

dmarc1

liuch commented 3 years ago

Okay. What is your php version? Do you have any warnings in the log?

fgams352 commented 3 years ago

Where is the log located?

php is version 7.4.21. Thanks for your help!

dmarc2

fgams352 commented 3 years ago

liuch, it looks like the php session never started and other php files do not have access to the data... but I may be wrong.

liuch commented 3 years ago

Usually php writes its errors and warnings to the log of the web server you are using. For me, the log is located in /var/log/nginx directory (I'm using nginx web server on debian).

fgams352 commented 3 years ago

This is Centos 8 with Apache. Rather than waste time trying to make that work, I'll configure the same platform you are using.

what version of debian? what version of php?

Thanks!

liuch commented 3 years ago

I use Debian Testing (bullseye), standard packages from the repositories. Just for case:

$ cat /etc/issue
Debian GNU/Linux 11 \n \l

$ /usr/sbin/nginx -v
nginx version: nginx/1.18.0

$ php -v
PHP 7.4.15 (cli) (built: Feb 20 2021 09:45:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies

$ mariadb --version
mariadb  Ver 15.1 Distrib 10.5.10-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper
liuch commented 3 years ago

Is there any result on this issue?

fgams352 commented 3 years ago

I could not get it work.

Aleksey Andreev @.***> 8/5/2021 6:23 PM >>> Is there any result on this issue? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub ( https://github.com/liuch/dmarc-srg/issues/1#issuecomment-893860132) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AU6PPLVZTGEY3XTF23A3WALT3MFO7ANCNFSM5A42AR2Q) . Triage notifications on the go with GitHub Mobile for iOS ( https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android ( https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email) .

liuch commented 3 years ago

I made many tries to get an error as yours but failed and I have no idea why it happends. It would be useful to see your log file. If you do not have the access to the log, you can turn on the debug mode in the config file to see error messages in the server responces by using the console of your browser.

liuch commented 1 year ago

Try replacing localhost with 127.0.0.1 in the config. If it doesn't work, could you turn the debug mode on then run the command php utils/database_admin.php status with the latest updates and show me the error messages?