Git commit fcf4695 Setting up MySQL user and database..........................Failed
-
I had a similar problem with 1.5.8 and centos 7 and also mariadb 5.x
In my case it turned out that I was running mysql with an empty root password. Which I don’t recall doing but may have occurred via the auto-accept/-y install when I initiatilly installed fog on this server. Should really not use -y the first time you run the installer, which is probably what I did many moons ago from habit in auto-updating to stay on the latest dev version. For updates once all is configured,
-y
should be fine.So can you login to mysql as root either with
mysql -u root
or does that fail and you can instead login with a passwordmysql -u root -p
Or do neither of those options work and maybe you’re locked out of mysql? I got locked out. If you are, don’t worry, we got you. Here’s how @Sebastian-Roth helped me reset the root password and afterwords everything worked again
#stop the mysql service systemctl stop mariadb # open mysql in safemode in a foreground task and use & to get back to your shell mysqld_safe --skip-grant-tables & # you may need to hit enter twice #login to mysql in safemode as root mysql -u root #look at what your usertable says for funsies select user,password,host,plugin from mysql.user; # You should see your root user(s) if it exists and the fogstorage and fogmaster users # Now update the password in the table to something else, note that for me this didn't actually # set a password but made it blank update mysql.user set password=PASSWORD("newpassword") where User='root'; update mysql.user set plugin='mysql_native_password' where User='root'; # flush the privileges to save the changes flush privileges; # exit the mysqld_safe command line \q; #shutdown the safemode mysql mysqladmin -u root shutdown # start the native mysql service up again systemctl start mariadb #try to login normally again, add -p and use what you think your password was or what you might have changed it to just now if it doesn't work mysql -u root #update the root user password with the proper command SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourPassword'); # flush the privileges to save the changes flush privileges; #exit the mysql shell \q; #restart mysql one more time to be safe service mariadb restart #attempt to login with the now set root password mysql -u root -p
If the last login works as expected, give the installer another try and see if it works now. Once I had that password reset and working I was able to run the latest dev-branch installer without issue.
-
@JJ-Fullmer Thanks for the instructions; that worked!
Also, it will tell you that your password is blank when you do these steps, because when you set both a password and authentication plugin, the password gets ignored by mysql.
I skipped the step to set password in mysql console itself to test the installer handling itself.
Some notes on the situation for me:
Root password was set BUT only for ‘localhost’, but the host localhost did not have any type set (whereas the others had mysql_native_password)
Running the installer a second time, after successfully setting root password in previous installer run, ends in the same error. (due to line 1201 expecting a root password it no longer has access to)
-
@Quazz said in Git commit fcf4695 Setting up MySQL user and database..........................Failed:
Running the installer a second time, after successfully setting root password in previous installer run, ends in the same error. (due to line 1201 expecting a root password it no longer has access to)
Once again the question: Do you run the installer with
-Y
(aka auto accept)? -
@Sebastian-Roth Not this time, no. The installer on first try after resetting root password, asked for a password, so I entered it. It accepted it, carried on sucessfully.
Then I ran the installer again (still no autoaccept) and it fails.
Observe:
localhost bin # ./installfog.sh Installing LSB_Release as needed * Attempting to get release information.......................Done +------------------------------------------+ | ..#######:. ..,#,.. .::##::. | |.:###### .:;####:......;#;.. | |...##... ...##;,;##::::.##... | | ,# ...##.....##:::## ..:: | | ## .::###,,##. . ##.::#.:######::.| |...##:::###::....#. .. .#...#. #...#:::. | |..:####:.. ..##......##::## .. # | | # . ...##:,;##;:::#: ... ##.. | | .# . .:;####;::::.##:::;#:.. | | # ..:;###.. | | | +------------------------------------------+ | Free Computer Imaging Solution | +------------------------------------------+ | Credits: http://fogproject.org/Credits | | http://fogproject.org/Credits | | Released under GPL Version 3 | +------------------------------------------+ Version: 1.5.8.13 Installer/Updater * Found FOG Settings from previous install at: /opt/fog/.fogsettings * Performing upgrade using these settings Starting Redhat based Installation ###################################################################### # FOG now has everything it needs for this setup, but please # # understand that this script will overwrite any setting you may # # have setup for services like DHCP, apache, pxe, tftp, and NFS. # ###################################################################### # It is not recommended that you install this on a production system # # as this script modifies many of your system settings. # ###################################################################### # This script should be run by the root user. # # It will prepend the running with sudo if root is not set # ###################################################################### # Please see our wiki for more information at: # ###################################################################### # https://wiki.fogproject.org/wiki/index.php # ###################################################################### * Here are the settings FOG will use: * Base Linux: Redhat * Detected Linux Distribution: CentOS Linux * Interface: eno1 * Server IP Address: 192.168.1.154 * Server Subnet Mask: 255.255.255.0 * Server Hostname: localhost * Installation Type: Normal Server * Internationalization: * Image Storage Location: /home/fog/images * Using FOG DHCP: No * DHCP will NOT be setup but you must setup your | current DHCP server to use FOG for PXE services. * On a Linux DHCP server you must set: next-server and filename * On a Windows DHCP server you must set options 066 and 067 * Option 066/next-server is the IP of the FOG Server: (e.g. 192.168.1.154) * Option 067/filename is the bootfile: (e.g. undionly.kpxe) * Are you sure you wish to continue (Y/N) y * Installation Started * Testing internet connection.................................Done * Adjusting repository (can take a long time for cleanup).....OK * Preparing Package Manager...................................OK * Packages to be installed: bc curl gcc gcc-c++ genisoimage gzip httpd jq lftp m4 make mariadb mariadb-server mod_ssl mtools net-tools nfs-utils php php-bcmath php-cli php-common php-fpm php-gd php-ldap php-mbstring php-mysqlnd php-process syslinux tar tftp-server unzip vsftpd wget xinetd xz-devel * Skipping package: bc......................................(Already Installed) * Skipping package: curl....................................(Already Installed) * Skipping package: gcc.....................................(Already Installed) * Skipping package: gcc-c++.................................(Already Installed) * Skipping package: genisoimage.............................(Already Installed) * Skipping package: gzip....................................(Already Installed) * Skipping package: httpd...................................(Already Installed) * Skipping package: jq......................................(Already Installed) * Skipping package: lftp....................................(Already Installed) * Skipping package: m4......................................(Already Installed) * Skipping package: make....................................(Already Installed) * Skipping package: mariadb.................................(Already Installed) * Skipping package: mariadb-server..........................(Already Installed) * Skipping package: mod_ssl.................................(Already Installed) * Skipping package: mtools..................................(Already Installed) * Skipping package: net-tools...............................(Already Installed) * Skipping package: nfs-utils...............................(Already Installed) * Skipping package: php.....................................(Already Installed) * Skipping package: php-bcmath..............................(Already Installed) * Skipping package: php-cli.................................(Already Installed) * Skipping package: php-common..............................(Already Installed) * Skipping package: php-fpm.................................(Already Installed) * Skipping package: php-gd..................................(Already Installed) * Skipping package: php-ldap................................(Already Installed) * Skipping package: php-mbstring............................(Already Installed) * Skipping package: php-mysqlnd.............................(Already Installed) * Skipping package: php-process.............................(Already Installed) * Skipping package: syslinux................................(Already Installed) * Skipping package: tar.....................................(Already Installed) * Skipping package: tftp-server.............................(Already Installed) * Skipping package: unzip...................................(Already Installed) * Skipping package: vsftpd..................................(Already Installed) * Skipping package: wget....................................(Already Installed) * Skipping package: xinetd..................................(Already Installed) * Skipping package: xz-devel................................(Already Installed) * Updating packages as needed.................................OK * Confirming package installation * Checking package: bc........................................OK * Checking package: curl......................................OK * Checking package: gcc.......................................OK * Checking package: gcc-c++...................................OK * Checking package: genisoimage...............................OK * Checking package: gzip......................................OK * Checking package: httpd.....................................OK * Checking package: jq........................................OK * Checking package: lftp......................................OK * Checking package: m4........................................OK * Checking package: make......................................OK * Checking package: mariadb...................................OK * Checking package: mariadb-server............................OK * Checking package: mod_ssl...................................OK * Checking package: mtools....................................OK * Checking package: net-tools.................................OK * Checking package: nfs-utils.................................OK * Checking package: php.......................................OK * Checking package: php-bcmath................................OK * Checking package: php-cli...................................OK * Checking package: php-common................................OK * Checking package: php-fpm...................................OK * Checking package: php-gd....................................OK * Checking package: php-ldap..................................OK * Checking package: php-mbstring..............................OK * Checking package: php-mysqlnd...............................OK * Checking package: php-process...............................OK * Checking package: syslinux..................................OK * Checking package: tar.......................................OK * Checking package: tftp-server...............................OK * Checking package: unzip.....................................OK * Checking package: vsftpd....................................OK * Checking package: wget......................................OK * Checking package: xinetd....................................OK * Checking package: xz-devel..................................OK * Configuring services * Setting up fogproject user..................................Skipped * Locking fogproject as a system account......................OK * Setting up fogproject password..............................OK * Stopping FOGMulticastManager.service Service................OK * Stopping FOGImageReplicator.service Service.................OK * Stopping FOGSnapinReplicator.service Service................OK * Stopping FOGScheduler.service Service.......................OK * Stopping FOGPingHosts.service Service.......................OK * Stopping FOGSnapinHash.service Service......................OK * Stopping FOGImageSize.service Service.......................OK * Setting up and starting MySQL...............................OK The installer detected a blank database *root* password. This is very common on a new install or if you upgrade from any version of FOG before 1.5.8. To improve overall security we ask you to supply an appropriate database *root* password now. NOTICE: Make sure you choose a good password but also one you can remember or use a password manager to store it. The installer won't store the given password in any place and it will be lost right after the installer finishes! Please enter a new database *root* password to be set: * Setting up MySQL user and database..........................OK * Backing up user reports.....................................Done * Stopping web service........................................OK * Removing vhost file.........................................OK * Setting up Apache and PHP files.............................OK * Testing and removing symbolic links if found................OK * Backing up old data.........................................OK * Copying new files to web folder.............................OK * Creating config file........................................OK * Downloading kernel, init and fog-client binaries............Done * Copying binaries to destination paths.......................OK * Enabling apache and fpm services on boot....................OK * Creating SSL Certificate....................................OK * Creating auth pub key and cert..............................OK * Resetting SSL Permissions...................................OK * Setting up Apache virtual host (no SSL).....................OK * Starting and checking status of web services................OK * Changing permissions on apache log files....................OK * Backing up database.........................................Done * You still need to install/update your database schema. * This can be done by opening a web browser and going to: http://192.168.1.154/fog/management * Press [Enter] key when database is updated/installed. * Update fogstorage database password.........................OK * Granting access to fogstorage database user.................OK * Setting up storage..........................................OK * Setting up and starting DHCP Server.........................Skipped * Setting up and starting TFTP and PXE Servers................OK * Setting up and starting VSFTP Server........................OK * Setting up FOG Snapins......................................OK * Setting up UDPCast..........................................OK * Configuring UDPCast.........................................OK * Building UDPCast............................................OK * Installing UDPCast..........................................OK * Installing FOG System Scripts...............................OK * Configuring FOG System Services * Setting permissions on FOGMulticastManager.service script...OK * Enabling FOGMulticastManager.service Service................OK * Setting permissions on FOGImageReplicator.service script....OK * Enabling FOGImageReplicator.service Service.................OK * Setting permissions on FOGSnapinReplicator.service script...OK * Enabling FOGSnapinReplicator.service Service................OK * Setting permissions on FOGScheduler.service script..........OK * Enabling FOGScheduler.service Service.......................OK * Setting permissions on FOGPingHosts.service script..........OK * Enabling FOGPingHosts.service Service.......................OK * Setting permissions on FOGSnapinHash.service script.........OK * Enabling FOGSnapinHash.service Service......................OK * Setting permissions on FOGImageSize.service script..........OK * Enabling FOGImageSize.service Service.......................OK * Setting up FOG Services.....................................OK * Starting FOGMulticastManager.service Service................OK * Starting FOGImageReplicator.service Service.................OK * Starting FOGSnapinReplicator.service Service................OK * Starting FOGScheduler.service Service.......................OK * Starting FOGPingHosts.service Service.......................OK * Starting FOGSnapinHash.service Service......................OK * Starting FOGImageSize.service Service.......................OK * Setting up exports file.....................................Skipped * Ensuring node username and passwords match..................Done * Setup complete You can now login to the FOG Management Portal using the information listed below. The login information is only if this is the first install. This can be done by opening a web browser and going to: http://192.168.1.154/fog/management Default User Information Username: fog Password: password localhost bin # ./installfog.sh Installing LSB_Release as needed * Attempting to get release information.......................Done +------------------------------------------+ | ..#######:. ..,#,.. .::##::. | |.:###### .:;####:......;#;.. | |...##... ...##;,;##::::.##... | | ,# ...##.....##:::## ..:: | | ## .::###,,##. . ##.::#.:######::.| |...##:::###::....#. .. .#...#. #...#:::. | |..:####:.. ..##......##::## .. # | | # . ...##:,;##;:::#: ... ##.. | | .# . .:;####;::::.##:::;#:.. | | # ..:;###.. | | | +------------------------------------------+ | Free Computer Imaging Solution | +------------------------------------------+ | Credits: http://fogproject.org/Credits | | http://fogproject.org/Credits | | Released under GPL Version 3 | +------------------------------------------+ Version: 1.5.8.13 Installer/Updater * Found FOG Settings from previous install at: /opt/fog/.fogsettings * Performing upgrade using these settings Starting Redhat based Installation ###################################################################### # FOG now has everything it needs for this setup, but please # # understand that this script will overwrite any setting you may # # have setup for services like DHCP, apache, pxe, tftp, and NFS. # ###################################################################### # It is not recommended that you install this on a production system # # as this script modifies many of your system settings. # ###################################################################### # This script should be run by the root user. # # It will prepend the running with sudo if root is not set # ###################################################################### # Please see our wiki for more information at: # ###################################################################### # https://wiki.fogproject.org/wiki/index.php # ###################################################################### * Here are the settings FOG will use: * Base Linux: Redhat * Detected Linux Distribution: CentOS Linux * Interface: eno1 * Server IP Address: 192.168.1.154 * Server Subnet Mask: 255.255.255.0 * Server Hostname: localhost * Installation Type: Normal Server * Internationalization: * Image Storage Location: /home/fog/images * Using FOG DHCP: No * DHCP will NOT be setup but you must setup your | current DHCP server to use FOG for PXE services. * On a Linux DHCP server you must set: next-server and filename * On a Windows DHCP server you must set options 066 and 067 * Option 066/next-server is the IP of the FOG Server: (e.g. 192.168.1.154) * Option 067/filename is the bootfile: (e.g. undionly.kpxe) * Are you sure you wish to continue (Y/N) y * Installation Started * Testing internet connection.................................Done * Adjusting repository (can take a long time for cleanup).....OK * Preparing Package Manager...................................OK * Packages to be installed: bc curl gcc gcc-c++ genisoimage gzip httpd jq lftp m4 make mariadb mariadb-server mod_ssl mtools net-tools nfs-utils php php-bcmath php-cli php-common php-fpm php-gd php-ldap php-mbstring php-mysqlnd php-process syslinux tar tftp-server unzip vsftpd wget xinetd xz-devel * Skipping package: bc......................................(Already Installed) * Skipping package: curl....................................(Already Installed) * Skipping package: gcc.....................................(Already Installed) * Skipping package: gcc-c++.................................(Already Installed) * Skipping package: genisoimage.............................(Already Installed) * Skipping package: gzip....................................(Already Installed) * Skipping package: httpd...................................(Already Installed) * Skipping package: jq......................................(Already Installed) * Skipping package: lftp....................................(Already Installed) * Skipping package: m4......................................(Already Installed) * Skipping package: make....................................(Already Installed) * Skipping package: mariadb.................................(Already Installed) * Skipping package: mariadb-server..........................(Already Installed) * Skipping package: mod_ssl.................................(Already Installed) * Skipping package: mtools..................................(Already Installed) * Skipping package: net-tools...............................(Already Installed) * Skipping package: nfs-utils...............................(Already Installed) * Skipping package: php.....................................(Already Installed) * Skipping package: php-bcmath..............................(Already Installed) * Skipping package: php-cli.................................(Already Installed) * Skipping package: php-common..............................(Already Installed) * Skipping package: php-fpm.................................(Already Installed) * Skipping package: php-gd..................................(Already Installed) * Skipping package: php-ldap................................(Already Installed) * Skipping package: php-mbstring............................(Already Installed) * Skipping package: php-mysqlnd.............................(Already Installed) * Skipping package: php-process.............................(Already Installed) * Skipping package: syslinux................................(Already Installed) * Skipping package: tar.....................................(Already Installed) * Skipping package: tftp-server.............................(Already Installed) * Skipping package: unzip...................................(Already Installed) * Skipping package: vsftpd..................................(Already Installed) * Skipping package: wget....................................(Already Installed) * Skipping package: xinetd..................................(Already Installed) * Skipping package: xz-devel................................(Already Installed) * Updating packages as needed.................................OK * Confirming package installation * Checking package: bc........................................OK * Checking package: curl......................................OK * Checking package: gcc.......................................OK * Checking package: gcc-c++...................................OK * Checking package: genisoimage...............................OK * Checking package: gzip......................................OK * Checking package: httpd.....................................OK * Checking package: jq........................................OK * Checking package: lftp......................................OK * Checking package: m4........................................OK * Checking package: make......................................OK * Checking package: mariadb...................................OK * Checking package: mariadb-server............................OK * Checking package: mod_ssl...................................OK * Checking package: mtools....................................OK * Checking package: net-tools.................................OK * Checking package: nfs-utils.................................OK * Checking package: php.......................................OK * Checking package: php-bcmath................................OK * Checking package: php-cli...................................OK * Checking package: php-common................................OK * Checking package: php-fpm...................................OK * Checking package: php-gd....................................OK * Checking package: php-ldap..................................OK * Checking package: php-mbstring..............................OK * Checking package: php-mysqlnd...............................OK * Checking package: php-process...............................OK * Checking package: syslinux..................................OK * Checking package: tar.......................................OK * Checking package: tftp-server...............................OK * Checking package: unzip.....................................OK * Checking package: vsftpd....................................OK * Checking package: wget......................................OK * Checking package: xinetd....................................OK * Checking package: xz-devel..................................OK * Configuring services * Setting up fogproject user..................................Skipped * Locking fogproject as a system account......................OK * Setting up fogproject password..............................OK * Stopping FOGMulticastManager.service Service................OK * Stopping FOGImageReplicator.service Service.................OK * Stopping FOGSnapinReplicator.service Service................OK * Stopping FOGScheduler.service Service.......................OK * Stopping FOGPingHosts.service Service.......................OK * Stopping FOGSnapinHash.service Service......................OK * Stopping FOGImageSize.service Service.......................OK * Setting up and starting MySQL...............................OK * Setting up MySQL user and database..........................Failed! localhost fogproject # tail -50 bin/error_logs/fog_error_1.5.8.13.log php-process-7.3.15-1.el7.remi.x86_64 syslinux-4.05-15.el7.x86_64 tar-1.26-35.el7.x86_64 tftp-server-5.2-22.el7.x86_64 unzip-6.0-20.el7.x86_64 vsftpd-3.0.2-25.el7.x86_64 wget-1.14-18.el7_6.1.x86_64 xinetd-2.3.15-13.el7.x86_64 xz-devel-5.2.2-1.el7.x86_64 No packages marked for update bc-1.06.95-13.el7.x86_64 curl-7.29.0-54.el7_7.2.x86_64 gcc-4.8.5-39.el7.x86_64 gcc-c++-4.8.5-39.el7.x86_64 genisoimage-1.1.11-25.el7.x86_64 gzip-1.5-10.el7.x86_64 httpd-2.4.6-90.el7.centos.x86_64 jq-1.6-1.el7.x86_64 lftp-4.4.8-11.el7.x86_64 m4-1.4.16-10.el7.x86_64 make-3.82-24.el7.x86_64 mariadb-5.5.64-1.el7.x86_64 mariadb-server-5.5.64-1.el7.x86_64 mod_ssl-2.4.6-90.el7.centos.x86_64 mtools-4.0.18-5.el7.x86_64 net-tools-2.0-0.25.20131004git.el7.x86_64 nfs-utils-1.3.0-0.65.el7.x86_64 php-7.3.15-1.el7.remi.x86_64 php-bcmath-7.3.15-1.el7.remi.x86_64 php-cli-7.3.15-1.el7.remi.x86_64 php-common-7.3.15-1.el7.remi.x86_64 php-fpm-7.3.15-1.el7.remi.x86_64 php-gd-7.3.15-1.el7.remi.x86_64 php-ldap-7.3.15-1.el7.remi.x86_64 php-mbstring-7.3.15-1.el7.remi.x86_64 php-mysqlnd-7.3.15-1.el7.remi.x86_64 php-process-7.3.15-1.el7.remi.x86_64 syslinux-4.05-15.el7.x86_64 tar-1.26-35.el7.x86_64 tftp-server-5.2-22.el7.x86_64 unzip-6.0-20.el7.x86_64 vsftpd-3.0.2-25.el7.x86_64 wget-1.14-18.el7_6.1.x86_64 xinetd-2.3.15-13.el7.x86_64 xz-devel-5.2.2-1.el7.x86_64 chsh: Shell is niet gewijzigd. Wijzigen van standaard-shell voor fogproject. Nieuw wachtwoord:Nieuw wachtwoord herhalen: Wachtwoord voor gebruiker fogproject veranderen. passwd: alle authenticatie tokens zijn succesvol bijgewerkt. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
-
@Quazz Thanks for clarifying. I will have a bit more time tomorrow and gonna work on this. Seems like I have messed up big times with this DB security stuff. It’s strange because I have done a lot of testing on this, as well on CentOS. Not sure what I have missed but I am sure I will figure it out soon.
-
@Sebastian-Roth Setting
snmysqlrootpass
in .fogsettings allows it to function normally again, but that’s of course not very secure.Line 1201 is where it trips up, if not set.
-
@Quazz Nice workaround. I am working on this right now. Hopefully I can get it right this time. It’s quite complex to think about all the different situations people come from. Fresh install, update, auto-accept, empty root DB pass, unix_socket and so on.
Will let you know when I pushed the fix.
-
@Quazz Ok, here we go. Mind giving the latest dev-branch (1.5.8.14 as of now) a try?
-
@Sebastian-Roth Went through it successfully. Of course this is only the scenario where root password is already set, not sure what an initial environment would do if that makes sense.
-
@Quazz said in Git commit fcf4695 Setting up MySQL user and database..........................Failed:
Of course this is only the scenario where root password is already set, not sure what an initial environment would do if that makes sense.
Absolutely! I will do further testing and we have Wayne’s automated install tests running as well. Will see if they all still work fine.
Thanks for quickly testing!
-
@sgennadi Please try the latest in dev-branch after manually setting DB root password. Sorry for the issue.
-
@Quazz said in Git commit fcf4695 Setting up MySQL user and database..........................Failed:
@JJ-Fullmer Thanks for the instructions; that worked!
Some notes on the situation for me:Woo Hoo!
Root password was set BUT only for ‘localhost’, but the host localhost did not have any type set (whereas the others had mysql_native_password)
I think that this may have also been the case for me. I certainly remember having set a root password but after fixing everything my only conclusion was that I must have not. But I did also notice that my mysql.user table had 3 different root users for localhost, 127.0.0.1, and 1 other I can’t remember right now. Mine were all set to the mysql_native_password plugin as well. It looks like a solution is in the works here already, but just wanted to add that note that the root problem might be the authentication problem.