[GH-ISSUE #89] Can't Connect to target database #62

Open
opened 2026-02-25 21:33:10 +03:00 by kerem · 3 comments
Owner

Originally created by @neerajUdai on GitHub (Dec 5, 2018).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/89

Using PHP 7.2

Set everything up according to the instructions but still getting the issue:-
"Can't Connect to target database"

Much simpler solution and worked like a charm.
https://code.google.com/archive/p/sql-dump-schema-diff/downloads

Originally created by @neerajUdai on GitHub (Dec 5, 2018). Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/89 Using PHP 7.2 Set everything up according to the instructions but still getting the issue:- "Can't Connect to target database" Much simpler solution and worked like a charm. https://code.google.com/archive/p/sql-dump-schema-diff/downloads
Author
Owner

@matdodgson commented on GitHub (Jan 7, 2019):

I'm also having the same problem (the target database). I'm also using Php 7.2 and I'm on Ubuntu 18.10. I assume the problem is to do with the mysql library for PHP. Maybe some more detailed error output would be helpful?

<!-- gh-comment-id:451820505 --> @matdodgson commented on GitHub (Jan 7, 2019): I'm also having the same problem (the target database). I'm also using Php 7.2 and I'm on Ubuntu 18.10. I assume the problem is to do with the mysql library for PHP. Maybe some more detailed error output would be helpful?
Author
Owner

@amanullah92 commented on GitHub (Aug 13, 2019):

I added log in the relevant php file (src/DB/DBManager.php) where the error was thrown. It pointed to the error :

DOException: PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php:47
Stack trace:
#0 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('mysql:host=127....', 'root', '*xxx', Array)
#1 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/MySqlConnector.php(20): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=127....', Array, Array)
#2 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/ConnectionFactory.php(57): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#3 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/ConnectionFactory.php(46): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array)
#4 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/DatabaseManager.php(176): Illuminate\Database\Connectors\ConnectionFactory->make(Array, 'source')
#5 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/DatabaseManager.php(64): Illuminate\Database\DatabaseManager->makeConnection('source')
#6 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Capsule/Manager.php(107): Illuminate\Database\DatabaseManager->connection('source')
#7 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DB/DBManager.php(38): Illuminate\Database\Capsule\Manager->getConnection('source')
#8 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DB/DBManager.php(32): DBDiff\DB\DBManager->testResource(Array, 'source')
#9 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DB/DiffCalculator.php(19): DBDiff\DB\DBManager->testResources(Object(stdClass))
#10 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DBDiff.php(23): DBDiff\DB\DiffCalculator->getDiff(Object(stdClass))
#11 /Users/mohdamandullah/code_repo/opensource/DBDiff/dbdiff(8): DBDiff\DBDiff->run()

<!-- gh-comment-id:520713367 --> @amanullah92 commented on GitHub (Aug 13, 2019): I added log in the relevant php file (src/DB/DBManager.php) where the error was thrown. It pointed to the error : DOException: PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php:47 Stack trace: #0 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('mysql:host=127....', 'root', '**xxx*', Array) #1 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/MySqlConnector.php(20): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=127....', Array, Array) #2 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/ConnectionFactory.php(57): Illuminate\Database\Connectors\MySqlConnector->connect(Array) #3 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Connectors/ConnectionFactory.php(46): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array) #4 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/DatabaseManager.php(176): Illuminate\Database\Connectors\ConnectionFactory->make(Array, 'source') #5 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/DatabaseManager.php(64): Illuminate\Database\DatabaseManager->makeConnection('source') #6 /Users/mohdamandullah/code_repo/opensource/DBDiff/vendor/illuminate/database/Illuminate/Database/Capsule/Manager.php(107): Illuminate\Database\DatabaseManager->connection('source') #7 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DB/DBManager.php(38): Illuminate\Database\Capsule\Manager->getConnection('source') #8 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DB/DBManager.php(32): DBDiff\DB\DBManager->testResource(Array, 'source') #9 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DB/DiffCalculator.php(19): DBDiff\DB\DBManager->testResources(Object(stdClass)) #10 /Users/mohdamandullah/code_repo/opensource/DBDiff/src/DBDiff.php(23): DBDiff\DB\DiffCalculator->getDiff(Object(stdClass)) #11 /Users/mohdamandullah/code_repo/opensource/DBDiff/dbdiff(8): DBDiff\DBDiff->run()
Author
Owner

@Avalancs commented on GitHub (Oct 7, 2019):

Hi all!

I had the same exception message, I commented the try-catch part in the code, and I was missing the mysql driver for php. If you have this on the very first run this might be your issue too.
On ubuntu I had to run sudo apt-get install php-mysql and it solved the issue.

<!-- gh-comment-id:539019492 --> @Avalancs commented on GitHub (Oct 7, 2019): Hi all! I had the same exception message, I commented the try-catch part in the code, and I was missing the mysql driver for php. If you have this on the very first run this might be your issue too. On ubuntu I had to run `sudo apt-get install php-mysql` and it solved the issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DBDiff#62
No description provided.