leomarquine / php-etl

Extract, Transform and Load data using PHP.
MIT License
178 stars 81 forks source link

PDOException: No handler for this scheme #18

Closed tmcnicholls closed 4 years ago

tmcnicholls commented 5 years ago

Pulling the latest version of this package via Composer (v2.2.0) has an old version of the MySqlConnector class included.

The code tagged in this release has a version of this class from before the unix socket fix was applied in v1.2.

Specifically, this commit isn't included in v2.2.0

https://github.com/leomarquine/php-etl/commit/aa1ce7b9c8221449b20f01d3072984c85e382bf8

tmcnicholls commented 5 years ago

This is related to https://github.com/leomarquine/php-etl/issues/12 and https://github.com/leomarquine/php-etl/issues/14

jimmypuckett commented 5 years ago

I am working with a clean Laravel 5.8 instance, and I have this error too...

(new Marquine\Etl\Etl)->extract('csv', './file.csv')->transform('rename_columns', ['columns' => ['email_address' => 'email']])->load('insert_update', 'people')->run()

I get...

PDOException with message 'SQLSTATE[HY000] [2002] No handler for this scheme'

Here are my configs...

config('database.connections.mysql')
=> [
     "driver" => "mysql",
     "url" => null,
     "host" => "mysql",
     "port" => "3306",
     "database" => "laravel",
     "username" => "root",
     "password" => "",
     "unix_socket" => "",
     "charset" => "utf8mb4",
     "collation" => "utf8mb4_unicode_ci",
     "prefix" => "",
     "prefix_indexes" => true,
     "strict" => true,
     "engine" => null,
     "options" => [],
   ]

If I comment out 'unix_socket' => env('DB_SOCKET', ''), from config/database.php, then it works...

(new Marquine\Etl\Etl)->extract('csv', './file.csv')->transform('rename_columns', ['columns' => ['email_address' => 'email']])->load('insert_update', 'people')->run()
=> null
config('database.connections.mysql')
=> [
     "driver" => "mysql",
     "url" => null,
     "host" => "mysql",
     "port" => "3306",
     "database" => "laravel",
     "username" => "root",
     "password" => "",
     "charset" => "utf8mb4",
     "collation" => "utf8mb4_unicode_ci",
     "prefix" => "",
     "prefix_indexes" => true,
     "strict" => true,
     "engine" => null,
     "options" => [],
   ]