Skip to content

Problem with database name during cli installation #2216

@rtmkrlv

Description

@rtmkrlv

I am trying to use the cli installer and execute the command:

install/cli-install.php --typeInstall=1 --databaseType=mysql --databaseServer='host.mysql.tools' --database='db_name' --databaseUser='db_user' --databasePassword='password' --tablePrefix=evo_ --cmsAdmin='admin' --cmsAdminEmail='admin@example.com' --cmsPassword='password' --language=en --removeInstall=y

The following error occurs during installation:

SQLSTATE[HY000] [1044] Access denied for user 'db_user'@'%' to database '[+database_name+]' (Connection: default, Host: host.mysql.tools, Port: 3306, Database: [+database_name+], SQL: select exists (select 1 from information_schema.tables where table_schema = schema() and table_name = 'evo_migrations_install' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as `exists`)

If check the configuration file created during the process, it can be seen that all variables except the database name are included in it:

<?php
return [
    'driver' => env('DB_TYPE', 'mysql'),
    'host' => env('DB_HOST', 'host.mysql.tools'),
    'port' => env('DB_PORT', '3306'),
    'database' => env('DB_DATABASE', '[+database_name+]'),
    'username' => env('DB_USERNAME', 'db_user'), //$database_user
    'password' => env('DB_PASSWORD', 'password'), //$database_password
    'unix_socket' => env('DB_SOCKET', ''),
    'charset' => env('DB_CHARSET', 'utf8mb4'), // $database_connection_charset
    'collation' => env('DB_COLLATION', 'utf8mb4_unicode_520_ci'), //$database_collation
    'prefix' => env('DB_PREFIX', 'evo_'),
    'strict' => env('DB_STRICT', false),
    'engine' => env('DB_ENGINE', 'innodb'),
    'options' => [
        PDO::ATTR_STRINGIFY_FETCHES => true,
    ]
];

That is, during the installation process, the installer does not recognize or save the database name, which leads to an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions