Connect a remote database in Laravel

1

I am developing an application with Laravel 5.2 and I must connect a remote database, to do it from the command line I type.

mysql -u root -p -h 'remote_ip' --skip-secure-auth

Doing this does not send any errors, I want to do this from Laravel . How can I add the option?

  

- skip-secure-auth   from config / database.php

'estudiantesdb' => [
    'driver' => 'mysql',
    'host' => 'remote_ip',
    'port' => '3306',
    'database' => 'estudiantesdb',
    'username' => 'root',
    'password' => 'root_password',
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
    'strict' => false,
    'engine' => null,
],
    
asked by José Antonio Márquez Elguea 30.05.2017 в 00:59
source

1 answer

1

No It is possible to do this in Laravel, really the limitation is not from Laravel but from PHP.

Among the different parameters that the Laravel connection arrays receive, they do not allow sending something like this.

Furthermore, it is not recommended to do so according to the MySQL 5.7.x documentation:

  

- secure-auth

     

Do not send passwords to the server in old (pre-4.1) format. This prevents connections except for servers that use the newer password format.

     

As of MySQL 5.7.5, this option is deprecated and will be removed in a future MySQL release. It is always enabled and attempting to disable it (--skip-secure-auth, --secure-auth = 0) produces an error. Before MySQL 5.7.5, this option is enabled by default but can be disabled.

    
answered by 30.05.2017 в 04:37