mirror of
https://github.com/DBDiff/DBDiff.git
synced 2026-04-25 05:15:49 +03:00
[GH-ISSUE #89] Can't Connect to target database #62
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/DBDiff#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@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?
@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()
@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-mysqland it solved the issue.