2

First time Magento user here, seeking enlightenment. I did a CLI install on CentOS 7 using the following command...

./bin/magento setup:install 
 --base-url="http://example.com/shop/"
 --db-host="127.0.0.1" --db-name="th_magento"
 --db-user="th_magento" --db-password="asdfashd238"
 --admin-firstname="Hugh" --admin-lastname="Mongous"
 --admin-email="[email protected]" --admin-user="admin"
 --admin-password="b39fe8a09" --backend-frontname="aaa"

[... ssh buffer too small ...]

Module 'Magento_WebapiAsync':
[Progress: 818 / 833]
Module 'Magento_WebapiSecurity':
[Progress: 819 / 833]
Module 'Magento_Weee':
[Progress: 820 / 833]
Module 'Magento_WeeeGraphQl':
[Progress: 821 / 833]
Module 'Magento_CatalogWidget':
[Progress: 822 / 833]
Module 'Dotdigitalgroup_Email':
[Progress: 823 / 833]
Module 'Magento_WishlistAnalytics':
[Progress: 824 / 833]
Module 'Magento_WishlistGraphQl':
[Progress: 825 / 833]
Module 'Temando_Shipping':
[Progress: 826 / 833]
Module 'Vertex_Tax':
[Progress: 827 / 833]
[Progress: 828 / 833]
Installing admin user...
[Progress: 829 / 833]
Caches clearing:
Cache cleared successfully
[Progress: 830 / 833]
Disabling Maintenance Mode:
[Progress: 831 / 833]
Post installation file permissions check...
For security, remove write permissions from these directories: '/home/example/public_html/shop/app/etc'
[Progress: 832 / 833]
Write installation date...
[Progress: 833 / 833]
[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /aaa
Nothing to import.

For some reason I can't understand1 all I get when I navigate to /aaa is an Error while establishing database connection message (rough translation, locale is not english).

I tried some basic troubleshooting like checking requirements with the web based install, and ensuring that I can login using the MySQL client and it works. I can't find the logs for the error, tough...

I can post additional data if needed. It might be worth noting the SQL server is MariaDB 10.0 and that the frontend shows no errors (it seems to display correctly).


1: Wouldn't the install stop before the [SUCCESS]: Magento installation complete. if there was a problem?


Update: env.php

The db user and password match...

'db' => [
        'table_prefix' => '',
        'connection' => [
            'default' => [
                'host' => 'localhost',
                'dbname' => 'th_magento',
                'username' => 'th_magento',
                'password' => 'asdfashd238',
                'model' => 'mysql4',
                'engine' => 'innodb',
                'initStatements' => 'SET NAMES utf8;',
                'active' => '1'
            ]
        ]
    ],

While at it I also enabled developer mode, but nothing changed in the error page html. The var/log/debug.log file contains only cache_invalidate entries, while connector.log is empty.

4
  • add you your app/etc/env.php databse conneciton array code after installation.
    – Saphal Jha
    Commented May 21, 2019 at 11:57
  • your database is down
    – MagenX
    Commented May 21, 2019 at 12:02
  • @MagenX how can it be down if the install used the db and CLI mysql login is ok?
    – beppe9000
    Commented May 21, 2019 at 12:27
  • @SaphalJha I updated with the env.php's db section
    – beppe9000
    Commented May 21, 2019 at 12:27

2 Answers 2

1

Please try:

php bin/magento setup:install 
     --base-url="http://example.com/shop/"
     --db-host="127.0.0.1" 
     --db-name="th_magento"
     --db-user="th_magento" 
     --db-password="asdfashd238"
     --admin-firstname="Hugh" 
     --admin-lastname="Mongous"
     --admin-email="[email protected]" 
     --admin-user="admin"
     --admin-password="b39fe8a09" 
     --backend-frontname="aaa"
     --language="en_US"
     --currency="USD"
     --timezone="America/Chicago"
     --use-rewrites=1
1
  • 1
    This and replacing all FollowSymlinks directives with SymlinkIfOwnwner match did the trick.
    – beppe9000
    Commented May 22, 2019 at 14:48
0

Try switching from localhost to 127.0.0.1 or vice versa for your database host in the magento configuration. Failing that you might have to put the FQDN to the database server.

3
  • do i need to drop the tables or just re-run the install command ?
    – beppe9000
    Commented May 21, 2019 at 11:52
  • Edit app/etc/env.php on server. If it works and you get connection and redirect you will need to update base urls in db as shown in other answer. Commented May 21, 2019 at 11:59
  • Same error with 127.0.0.1, localhost, and FQDN, I also updated the question...
    – beppe9000
    Commented May 21, 2019 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.