How do I fix the error connecting Snort and BASE databases?

In summary: The code is written specifically for MySQL/MariaDB and there's a lot of it. You'd be better off trying to get MySQL working.In summary, the conversation discusses a problem with connecting the database and BASE after installing snort. The error indicates an issue with the authentication method and suggests upgrading to PHP 7.4. However, BASE is old and can be difficult to get working on current infrastructure. Other solutions such as reinstalling on a new Ubuntu 16.x install or using a different database engine like H2 are mentioned as well.
  • #1
rifal
2
0
I installed snort and I want to connect the database with BASE but an error occurs, I don't know where I went wrong, everything is running smoothly but not with BASE connection with the database

I suspect if I'm wrong when running the command:

# sudo mysql_secure_installation

what should i do to solve this problem please help me

Error (p)connecting to DB : snort@localhost

Check the DB connection variables in base_conf.php

= $alert_dbname : MySQL database name where the alerts are stored
= $alert_host : host where the database is stored
= $alert_port : port where the database is stored
= $alert_user : username into the database
= $alert_password : password for the username


Database ERROR:The server requested authentication method unknown to the client
 
Computer science news on Phys.org
  • #2
rifal said:
Database ERROR:The server requested authentication method unknown to the client
This message indicates that MySQL (or MariaDB) is asking for the password to be sent from PHP in a format that PHP does not support. This is common with e.g. MariaDB 8.x and PHP 7.3. Given that PHP 7.3 reaches EOL in a few months, the best way to resolve this is to upgrade to PHP 7.4. Otherwise, you will need to tell MariaDB to use an old authentication method by executing the following command as root in the mysql terminal (substituting the correct username and password of course):
SQL:
ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
 
  • Informative
Likes berkeman
  • #3
pbuk said:
This message indicates that MySQL (or MariaDB) is asking for the password to be sent from PHP in a format that PHP does not support. This is common with e.g. MariaDB 8.x and PHP 7.3. Given that PHP 7.3 reaches EOL in a few months, the best way to resolve this is to upgrade to PHP 7.4. Otherwise, you will need to tell MariaDB to use an old authentication method by executing the following command as root in the mysql terminal (substituting the correct username and password of course):
SQL:
ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
I run the configuration like the steps given here

https://www.linkedin.com/posts/vtfoundation_how-to-install-snort-ugcPost-6781345099180843008-OTwE

and i run it on ubuntu 20.04

I've upgraded the php version to php7.4 but the error is still the same, is there any other solution? because I have to solve this problem to finish my final project in university, I need your help :(
 
Last edited:
  • #4
rifal said:
I've upgraded the php version to php7.4 but the error is still the same, is there any other solution?
The problem is that BASE is pretty old software (for instance the Pear and ADOdb libraries it uses are not well supported any more) and getting it to work on current infrastructure is tricky.

You could try running through the steps here: https://php.watch/articles/PHP-7.4-MySQL-8-server-gone-away-fix.

Or get some help from someone with more experience at this kind of thing who can log into your machine and check things out.

Or try reinstalling from scratch on a new Ubuntu 16.x install as that is the version your notes are for (and install MySQL instead of MariaDB).
 
  • #6
There's absolutely zero chance of getting BASE to work with H2 I'm afraid.
 

FAQ: How do I fix the error connecting Snort and BASE databases?

1. How do I know if there is an error connecting Snort and BASE databases?

To determine if there is an error connecting Snort and BASE databases, you can check the logs for both Snort and BASE. If there is an error, it will be displayed in the logs with a corresponding error code and message. You can also try connecting to the databases manually to see if there are any connection issues.

2. What are the common causes of errors when connecting Snort and BASE databases?

Some common causes of errors when connecting Snort and BASE databases include incorrect database credentials, firewall restrictions, and compatibility issues between the versions of Snort and BASE. It is also possible that the databases were not properly configured or that there is a network connectivity issue.

3. How can I fix database connection errors in Snort and BASE?

To fix database connection errors in Snort and BASE, you can start by checking the database credentials and ensuring that they are correct. You can also try restarting both Snort and BASE, as well as the database server. If the issue persists, you may need to update the versions of Snort and BASE to ensure compatibility, or consult the documentation for further troubleshooting steps.

4. Can I use different databases for Snort and BASE?

Yes, you can use different databases for Snort and BASE. However, you will need to make sure that both databases are properly configured and that the credentials are correctly entered in the configuration files for both Snort and BASE. It is recommended to use the same database for both Snort and BASE for easier management and troubleshooting.

5. How can I prevent future database connection errors in Snort and BASE?

To prevent future database connection errors in Snort and BASE, it is important to regularly check the database configuration and credentials to ensure they are up to date and correct. You should also keep the versions of Snort and BASE updated to avoid compatibility issues. It is also recommended to have a backup of the databases in case of any errors or issues. Regularly monitoring the logs and performing maintenance tasks can also help prevent future errors.

Similar threads

Back
Top