Database fails to initialize

  • I’m having a problem with SVN Revision 5949 (version 1.3.0-RC-8) with the SQL database. For some odd reason, it’s not creating the fog database or ‘fog’ user is sql during installation. I’ve looked and look and as best I can tell the installer just never gets to mysql. The root password on mysql is blank. Eveything has been cleaned. I deleted the fog user and fog database to get a clean install. When I run the installer, everything looks fine but starting fog the firsttime jumps to with the message:

    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/html/fog/lib/fog/config.class.php. Also confirm that the database is indeed running. If credentials are correct, and the Database service is running, check to ensure your filesystem has enough space.

    I’ve checked everything, and on the mysql side, everything looks good. Phpmyadmin shows a good system with a blank root password.

    Based on what I can see, it doesn’t look like mysql is even getting run. The most frustrating part is that all of the logs look fine. mysql does get restarted by the installer, but it doesn’t show any activity like creating user fog, or tables and the like. Any help or advise would be appreciated.

    In the process of debugging this, I found a bug with sql password query in the installer. If you run mysql version 5.6 or ealier; the sql command sql="ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘’;"

    ALTER USER’ was added in 5.7. You find this used in ./fog/lib/common/

    I’m running Mageia 4, mysql 5.5.45 if you need to know. Thanks for the help.

  • @Tom-Elliott

    Awesome. I’ll give it a try on a fresh install of Mageia5 and see how it goes. I’m not sure why it wouldn’t build the database. I turned on debugging in mysql and could see that fog was restarting mysqld in the first part of the install, but when it came time to populate the database and create all of the tables and things, there was nothing. I had a previous version of fog on this system and it makes me think that there was something left-over after upgrading.

  • Senior Developer

    Based on the information in this thread, I’m marking it as solved. Of course I won’t know for sure if it will work 100%, but I’m fairly sure we’ve taken the steps we need for this be addresses, at least with the limited information we have right now.

  • Senior Developer

    @syschuck As I understand it, mariadb 10.2 and mysql 5.7 is really where these things matter.

    I’ve updated the code base to hopefully address these things. (Either mysql >= 5.7 and mariadb >= 10.2)

  • Hi Tom. You may also need to check for MariaDB as well, it used a different versioning. The ALTER USER is very new feature added to MariaDB in 10.2.0. In Mysql ALTER USER was added in 5.6.6 (not 5.7 as I said).

  • Senior Developer

    I’ve added code in attempt to address the issue you’ve brought here.

    Basically, I’ll only run the mysql alter user statement if the value of mysqlver (after getting it of course) is greater than 5.6 (So I’m only using maj.min portion, not the maj.min.patch in whole.)

    Also, it will only attempt the user if the snmysqlpass is blank.

Log in to reply