I’m unable to get a database connection working with mariaDB on v5.
Opening the site gives a “Target class [db] does not exist.” with a reference to a check for the accounts table, however as the issue remains the same when entering a wrong DB password on purpose, it probably just can’t connect.
Config file below. Note: DB is running on a non-standard port, but switch it to 3306 makes no difference.
Any ideas?
Thx, now I’m indeed able to connect (with an old db backup loaded).
For a clean database, how can I create the structure? I’ve tried the setup wizard, but no luck…
For anyone also struggling on Synology to run php artisan optimize (it defaults to an earlier version): new versions are located in ex. /volumeXX/@appstore/PHP7.4/usr/local/bin/php74.
You can run this with the full path to the executable without having to modify the default version.
On finishing the setup wizard, this is in the laravel log: [2021-04-23 13:45:04] production.INFO: The command "mysql --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"" failed.
Exit Code: 127(Command not found)
Working directory: /volume2/web/InvoiceNinja/ninja5/public
Output:
================
Error Output:
================
sh: mysql: command not found
On calling the main page (but probably just a consequence of the previous step failing) "[2021-04-23 13:42:15] production.INFO: account table not found"
There seems to be an issue there indeed. It is installed but permissions and PATH are not set as you would expect. Although, being on a NAS it will probably not be easy to fix.
Is mysql only needed during initial set-up or also with upgrades etc…
@timmy I had the same problem but was able to fix it.
The problem is that InvoiceNinja calls ‘mysql’ and because we installed MariaDB packages, that command cannot be found in the current path.
The solution is to add the path or what I did: create a symbolic link.
You can create a symbolic link to mysql in /usr/local/bin, e.g.: sudo ln -s /volume1/@appstore/MariaDB10/usr/local/mariadb10/bin/mysql /usr/local/bin/mysql
Thanks for sharing this with us. However, this seems to be an edge case, since we didn’t have many reports for this not working. That said, I don’t think it’s worth putting this into docs.
However, what we could do is, having a dedication section in docs with many helpful links, which includes links to this thread.
My preference would be to compile these sorts of tips into the docs directly, maybe in the troubleshooting section. This makes it easier to search, using links makes things harder to find.
Note: for this particular problem the better solution may be to add MariaDB as an option, I imagine many users will want to use it.