The provided database host, username, and/or password is invalid

I think you are currently the leader on MySQL 8 issues :slight_smile:

I can’t speak for SalesAgility, but as far as I can see, there won’t be Doctrine support on SuiteCRM 8.0, the initial v8. But further along it is planned to be introduced. I don’t think it will be a simple task at all, so it’s bound to require several versions and delays before it’s usable.

So I am in favor of fixing and updating DBmanager code as it is, without waiting for Doctrine. This would include both MySQL 8.0 support and PostgreSQL support, both things are in high demand by the Community.

If you make a PR with the issues you know of, and keep using MySQL 8.0 as you go along, I think that should be enough to get the ball rolling, and hopefully more people will try it, and eventually we will achieve a good level of security that we can say we suppport MySQL 8.

So was doing another install/test and ran into more installer trouble. Again the issue is that underlying mysql errors are not being exposed to the user. I can manually edit the code to add the error reporting in MysqliManager and then the underlying error shows in nginx error log and I can figure out what went wrong.

This really isn’t a mysql8 issue and so any db misconfiguration doesn’t provide any hint about what went wrong.

FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught mysqli_sql_exception: Host ‘fully.qualified.hostname’ is not allowed to connect to this MySQL server in /opt/apps/suitecrm/include/database/MysqliManager.php:321

Would be great if these underlying mysql errors were caught and exposed to the user rather than just saying: "something went wrong, check your connection details and ~try~ guess again.

Hi @mattp
I don’t know if it is fully related. but i saw your first post with the screenshot and the error messages which I do recognize myself from previous installs of the system.

But I have experienced that every time I done a SugarCRM Community (in the past) or now a SuiteCRM installation the installation guide is a bit stupid.

If you set a too long, too complex password for the DB user then you will get these annoying error messages. The way I come to solve it myself is to set a really silly and short password on the DB user (like only 4-5 characters) and using that during the install then the installation goes smoothly and instantly accepts the password, user and DB info.

After I installed the CRM system; I then go back to the DB user on the DB server and change it to some really complicated long complex password and then in the config file change the easy password for the new one. This works every time for me.

Kind regards
Powerquest

Thanks for the tips. I think the point I am trying to make is that the Mysql code in SuiteCRM is simply looking at boolean return value (success/fail) rather than surfacing the underlying mysql error message. This means the user needs to guess what is wrong rather than understanding what is wrong based on the mysql error message.

These errors currently aren’t even LOGGED, let alone surfaced to the end user in the UI. Fixing that requires adding a single lined as I described above.

I’m not a PHP developer so I don’t know the best practice way to deal with error handling in PHP, let alone this application’s architecture.

Just imagine the number of underlying errors mysql can have:

  • connection timeout
  • connection refused
  • wrong credentials
  • unsupported auth plugin type
  • access denied
  • bad SQL syntax
  • etc

These errors aren’t surfaced to the user or log…so you never have a clue what might have gone wrong when something inevitably goes wrong.

Also because these are not logged, you don’t have a way to detect when errors/failures are starting to happen…or at least what types of errors (if you use central error log aggregation and monitoring). So you have to wait until a user reports a problem, patch the SuiteCRM code to enable mysql error logging and then reproduce the error and check the logs.

On topic of mysql8…of course figuring out what is working or what is broken in mysql8 is difficult without mysql error logging enabled. If it was enabled people could just try using mysql8 and then check their logs after a week or so and see what if any mysql errors are popping up and then report/collect them for the knowledge base (either for install guide in terms of mysql settings, or patches required to SuiteCRM to support mysql8).

1 Like

Yes, you are correct. It is not logged at all and will drive you crazy until you realize that it is the password length/complexity that creates the whole ordeal.

The first time I installed SugarCRM CE long ago I got really mad because I did try everything but changing the password it took me forever to figure it out. :upside_down_face::rage::joy:

Kind regards
PowerQuest

That was the issue for you.

I’ve run into this twice due to other underlying errors (unsupported auth plugin and connection timeout firewall issue).
Other people will run into this due to other errors that neither you or I have run into yet.

The problem is that none of us knows what is really wrong because it could be MANY different underlying errors and the underlying error is not surfaced to the log or the UI.

The guess and check method to resolving an unknown/unlogged error will take a long time for some things (like unsupported auth plugin).

Ouch… :scream:
That sounds like “fun” too (I mean in an ironical way of course).

I do understand you and there is other issues too that you can run into. Just never been the case for me.

It would be smart if the installer logged everything as it would make life easier.

Kind regards
PowerQuest

Use command:
sudo systemctl enable mysqld
OR
sudo systemctl enable mysql

This is really works for me.
If your are using centos and other linux system so this answer is for you.
my version of php, mysql and Suitecrm
Suitecrm 7.12.1
php version 7.3
mysql 8.0

First enable mysql service
Use command:

sudo systemctl enable mysqld
OR
sudo systemctl enable mysql

Second thing:

ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password
BY ‘password’;

Thanks @Ayush_legalpay but this post was not looking for a copy and paste solution specific to your install. The underlying issue (lack of logging mysql errors) has already been identified and discussed enough. To avoid confusion for future users I’ve added a summary of the general solution and marked it as a solution.


The solution to db connection issues is to patch the code (as I described earlier) to enable php mysql connector error logging so you can see what the problem is (could be MANY things).

Then reproduce the error and check the logs, identify the problem and fix it.

Regarding mysql8 support, it is working fine for me on 2 installs after a year. If you are paranoid you should also enable php mysql connector error logging and periodically check your logs regularly for issues so you don’t have unlogged failures like you may have out of the box with a default SuiteCRM install.

Thanks @mattp for suggestion but this code is work for me.