How to use PostgreSQL instead of MySQL
-
I cannot make IdeaSpace work with a PostgreSQL database instead of mysql. I changed the default value in config/database.php from mysql into psql, then in the installation part I add the correct values (database name, username etc) but I always get "Cannot connect to the database. Please verify your database settings and try again." I have pdo_pgsql installed and working fine in my system. Do I need to edit more files apart from config/database.php to make the default database psql instead of mysql?
Thanks
Luis Calisto
-
@lcalisto Did you try to set the default value to "pgsql" in config/database.php ?
-
Yes that was exactly what I've done.
-
@lcalisto Ok, because you said in your post above: "I changed the default value in config/database.php from mysql into psql, then in the..." so I thought mabye instead of
psql
thatpgsql
works, as is written in config/database.php
-
@WeddingDJ Sorry for my bad explanation. I set the default value to "pgsql" and not "psql" in config/database.php
Any ideia why is not working? I cannot see any useful log info.
-
@lcalisto I think this line causes your error. You could comment it and see if you can install the tables in Postgresql. If you are familiar with debugging PHP/Laravel you could add some \Log::debug('debug msg'); which log into /storage/logs/laravel.log
-
@WeddingDJ I'm not familiar with Laravel. Were you propose to add that \Log::debug('debug msg'); ?
-
@lcalisto I just saw my link was filtered out in my previous message.
You can add the debug statements in this function: https://github.com/IdeaSpaceVR/IdeaSpace/blob/master/app/Http/Controllers/InstallationController.php#L176 and see where the problem happens.
I think this line causes a problem with Postresql: https://github.com/IdeaSpaceVR/IdeaSpace/blob/master/app/Http/Controllers/InstallationController.php#L207 you could comment it out and see if you can initialize the DB with tables.
-
@WeddingDJ Commenting https://github.com/IdeaSpaceVR/IdeaSpace/blob/master/app/Http/Controllers/InstallationController.php#L207 solves the problem. After commenting that line and changing the default to pgsql in config/database.php I can install Ideaspace with Postgres, no more issues! Thanks!
-
@lcalisto Glad it worked. Now I have to find a substitute statement which works for ProstgreSQL as well.