Database Schema Installer/ Updater
-
Server
- FOG Version: 1.3.5 RC 13
- OS: Ubuntu 16.04
Client
- Service Version:
- OS:
Description
Just upgraded from Ubuntu 14.04 to 16.04 and updated FOG.
install succeeded, except backing up database, which always failed but was not a problem.
Now when I attempt to launch fog in Firefox on the server (localhost), I get following error message:Database Schema Installer / Updater
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 if the Database service is running, check to ensure your filesystem has enough space.I looked in the config.class.php file, but couldn’t figure out what should be changed. MySQL is running, and I have enough disk space.
-
@templink Please run:
sudo mysql -u root
Within mysql please run:ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY ''; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; exit;
Then you should be good to go.
-
Does your database have a password set for it?
This error will present any time there’s an issue with connecting to the db. The information given there is just a quick, check these types of things too, message. Are the credentials correct?
-
I’ve never changed the credentials. So as far as I know, they are correct. My database has no password.
-
@templink Is there a password defined for the database in the config.class.php file?
-
@templink said in Database Schema Installer/ Updater:
I looked in the config.class.php file, but couldn’t figure out what should be changed.
Nothing should be changed in that file, make your changes inside of
/opt/fog/.fogsettings
so that they are permanent.Can you access the database with any of these?
mysql -D fog mysql -h localhost -D fog mysql -h 127.0.0.1 -D fog mysql -h localhost -D fog -u root -p mysql -h 127.0.0.1 -D fog -u root -p
-
@Wayne-Workman
I was able to successfully logon to the database using the first, second and fourth method you provided. Both ways using 127.0.0.1 failed though. -
@templink If you edit the config.class.php and change the
define('DATABASE_HOST', '127.0.0.1');
To read as:
define('DATABASE_HOST', 'localhost');
-
@Tom-Elliott
It read:
define(‘DATABASE_HOST’, ‘p:localhost’);I changed it to:
define(DATABASE_HOST’, ‘localhost’);and rebooted, but the problem persists.
-
Does your config.class.php file have a defined definition for the DATABASE_PASSWORD field?
-
@Tom-Elliott
db settings from my config.class.php file:private static function _dbSettings()
{
define(‘DATABASE_TYPE’, ‘mysql’); // mysql or oracle
define(‘DATABASE_HOST’, ‘localhost’);
define(‘DATABASE_NAME’, ‘fog’);
define(‘DATABASE_USERNAME’, ‘root’);
define(‘DATABASE_PASSWORD’, “”);
} -
What happens if you run:
mysql -u root fog
as a “non-root” user? -
ubuntu@fogserver:~$ mysql -u root fog
ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’ -
@templink Please run:
sudo mysql -u root
Within mysql please run:ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY ''; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; exit;
Then you should be good to go.
-
response was
Query OK, 0 rows affected (0.00 sec)It worked! Big thanks! I’m up and running in the browser again.