gen36644
gen36644

I am trying to install October on a linux ubuntu vps with mysql using the Wizard. The installation fails at the "Create Admin Account" stage, with the following error is returned:

SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = database and table_name = migrations)

So, I assume the installation process is trying to access the database with the mysql root user. If this is the case, I am unsure why, as I have provided an existing mysql username and password with access to the database, and these are written into the database.php file.

Does anyone have any ideas?

The database.php file contains the following:

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | PDO Fetch Style
    |--------------------------------------------------------------------------
    |
    | By default, database results will be returned as instances of the PHP
    | stdClass object; however, you may desire to retrieve records in an
    | array format for simplicity. Here you can tweak the fetch style.
    |
    */

    'fetch' => PDO::FETCH_CLASS,

    /*
    |--------------------------------------------------------------------------
    | Default Database Connection Name
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the database connections below you wish
    | to use as your default connection for all database work. Of course
    | you may use many connections at once using the Database library.
    |
    */

    'default' => 'mysql',

    /*
    |--------------------------------------------------------------------------
    | Database Connections
    |--------------------------------------------------------------------------
    |
    | Here are each of the database connections setup for your application.
    | Of course, examples of configuring each database platform that is
    | supported by Laravel is shown below to make development simple.
    |
    |
    | All database work in Laravel is done through the PHP PDO facilities
    | so make sure you have the driver for your particular database of
    | choice installed on your machine before you begin development.
    |
    */

    'connections' => [

        'sqlite' => [
            'driver'   => 'sqlite',
            'database' => 'storage/database.sqlite',
            'prefix'   => '',
        ],

        'mysql' => [
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'port'      => 3306,
            'database'  => 'october',
            'username'  => 'october_user',
            'password'  => 'my_password',
            'charset'   => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix'    => '',
        ],

        'pgsql' => [
            'driver'   => 'pgsql',
            'host'     => 'localhost',
            'port'     => 5432,
            'database' => 'database',
            'username' => 'root',
            'password' => '',
            'charset'  => 'utf8',
            'prefix'   => '',
            'schema'   => 'public',
        ],

        'sqlsrv' => [
            'driver'   => 'sqlsrv',
            'host'     => 'localhost',
            'port'     => 1433,
            'database' => 'database',
            'username' => 'root',
            'password' => '',
            'prefix'   => '',
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Migration Repository Table
    |--------------------------------------------------------------------------
    |
    | This table keeps track of all the migrations that have already run for
    | your application. Using this information, we can determine which of
    | the migrations on disk have not actually be run in the databases.
    |
    */

    'migrations' => 'migrations',

    /*
    |--------------------------------------------------------------------------
    | Redis Databases
    |--------------------------------------------------------------------------
    |
    | Redis is an open source, fast, and advanced key-value store that also
    | provides a richer set of commands than a typical key-value systems
    | such as APC or Memcached. Laravel makes it easy to dig right in.
    |
    */

    'redis' => [

        'cluster' => false,

        'default' => [
            'host'     => '127.0.0.1',
            'password' => null,
            'port'     => 6379,
            'database' => 0,
        ],

    ],

];

This is the 'create Admin' section of the log file:

.============================ POST REQUEST ==========================.
[2019/04/24 01:31:57] Postback payload: Array
(
    [step] => createAdmin
    [meta] => Array
        (
            [core] => Array
                (
                    [hash] => 61c929870890c2206ff3d84c4a12c354
                    [build] => 447
                    [uhash] => 3bea68b737188c91d4613538c6dbcec4
                )

            [plugins] => Array
                (
                    [RainLab.Blog] => 0b6eaf74c999eb254549d1b1ab90aaa3
                )

            [themes] => Array
                (
                    [Responsiv.Clean] => 07e5b7066168a94349ac92018770c2e8
                )

        )

    [db_type] => mysql
    [db_host] => localhost
    [db_port] => 
    [db_name] => october
    [db_user] => october_user
    [db_pass] => *******
    [admin_first_name] => Stephen
    [admin_last_name] => Grabner
    [admin_email] => *******@*****.com
    [admin_login] => steve
    [admin_password] => *******
    [admin_confirm_password] => *******
    [backend_uri] => /backend
    [encryption_code] => *******
    [file_mask] => 777
    [folder_mask] => 777
    [active_theme] => Responsiv.Clean
    [handler] => onInstallStep
)

[2019/04/24 01:31:57] Install step: createAdmin
[2019/04/24 01:31:57] Handler error (onInstallStep): SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = database and table_name = migrations)
[2019/04/24 01:31:57] Trace log:
#0 /var/www/html/october/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('select * from i...', Array, Object(Closure))
#1 /var/www/html/october/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\Database\Connection->run('select * from i...', Array, Object(Closure))
#2 /var/www/html/october/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(18): Illuminate\Database\Connection->select('select * from i...', Array)
#3 /var/www/html/october/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Illuminate\Database\Schema\MySqlBuilder->hasTable('migrations')
#4 /var/www/html/october/modules/system/classes/UpdateManager.php(135): Illuminate\Support\Facades\Facade::__callStatic('hasTable', Array)
#5 /var/www/html/october/install_files/php/Installer.php(525): System\Classes\UpdateManager->update()
#6 /var/www/html/october/install_files/php/Installer.php(382): Installer->createAdminAccount()
#7 /var/www/html/october/install_files/php/Installer.php(48): Installer->onInstallStep()
#8 /var/www/html/october/install_files/php/boot.php(91): Installer->__construct()
#9 /var/www/html/october/install.php(1): include('/var/www/html/o...')
#10 {main}
skoobi
skoobi

Did you add the database details into the installer or the file itself. If its into the file itself while doing the install (cant remember if there's validation there or not) but it may try and overwrite the database.php file.

gen36644
gen36644

Thanks for your response! No, the details were added via the installer forms. It's weird, I just can't get it to work. Since posting this, i have had the install say it worked, but when I try to access the admin area ('backend'), well there is no backend to access, despite having agreed to the installation defaults, and entered admin information. I have tried every permutation i can think of, to no avail.

skoobi
skoobi

Weird! Might be worth checking the config/cms.php file to make sure the 'backendUri' => '/backend', is set correctly. Also may be worth checking the app.php to see if the url is correct, just in case that may be stopping it.

Dizoo
Dizoo

This is an error I have gotten before on several installations. By simply pressing retry it always resolved itself. My guess was that it might be an issue that the database has to create too many tables in one go. Hope it is this easy for you to solve the problem as well.

endi.linux.mint51510
endi.linux.mint51510

I managed to overcome the problem SQLSTATE [HY000] [1698] Access denied for this 'root' @ 'localhost' user by installing using a theme. My problem is solved.

1-6 of 6