Problem with Database Schema Installer / Updater
I installed FOG on a Virtualbox virtual machine on a Windows 10 (ugh… don’t ask…) host.
After the instalation of FOG, when accessing for the first time through Web UI, the following error appears:
“Your database connection appears to be invalid. FOG is unable to communicate with the database. There are many reasons why this could be the case. Please check your credentials in /var/www/fog/lib/fog/config.class.php. Also confirm that the database is indeed running. If credentials are correct, and if the Database service is running, check to ensure your filesystem has enough space.”
MySQL is up and running. Credentials are correct on config.class.php file. Database is working (that goes without saying) and the server is newly installed with only 22% of the hard drive occupied.
Anyone else had the same issue?
@Tom-Elliott Perfect. You can mark this topic as “Solved”.
I’ve modified the code base slightly to help prevent this problem in the future.
The installer will adjust the alter syntax to whatever value is stored in snmysqlpass now. It will only run on known versions of mysql/mariadb that will accept the ALTER USER syntax. It does not set the mysql user password FOR you. It ONLY set’s the alter user syntax (which can break your system if you simply enter a password and ALTER USER is not accepted on your version.) I don’t know what setting this without runnign through GRANT on system that accept this will do.
@Tom-Elliott Yes I did set the password after. I don’t know what went wrong with it, but after the installation finished, I ran through the configurations (and its passwords), in order to verify if everything was ok.
Anyway, all ok and going to test the image capture/deployment tasks.
Thanks a bunch.
@koelhomem When you installed initially, did you set the password AFTER it ran through once?
I say this because that ALTER statement only runs if the password is initially blank (in which case it sounds like it was originally).
@Tom-Elliott That solved it. But this issue occurred after the default automated installation.
For now, this is only a test server. Later on, if everything going ok, it will be implemented on a production environment. Hope everything goes ok from here.
Thanks a lot for your help!
@koelhomem Then something seems really off.
If you login to the DB then via command line:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<YourPasswordHere>';
@Tom-Elliott No. Alphanumeric only.
@koelhomem Does your password contain any special characters? Double/Single quotes, $ symbol?
@koelhomem So you can access the db by running:
mysql -u root -p'YourPassHere'
Yes. And the password is the correct one set on the php file.
@koelhomem Does mysql have a password set?
FOG version: 1.3.0-RC-21
OS: Ubuntu 16.04
Firewall: disabled (no ufw, no iptables)
We need much more information.
What version of FOG is installed?
What OS is the FOG Server installed on?
Is firewall enabled?