[GH-ISSUE #124] Cannot connect to target database #228

Open
opened 2026-03-07 20:42:14 +03:00 by kerem · 1 comment
Owner

Originally created by @SanaAnsari09 on GitHub (Jul 12, 2021).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/124

I have been trying many possible things to resolve this. I wanted to know whether comparison of schema and data can happen between different versions of mysql.

Originally created by @SanaAnsari09 on GitHub (Jul 12, 2021). Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/124 I have been trying many possible things to resolve this. I wanted to know whether comparison of schema and data can happen between different versions of mysql.
Author
Owner

@ratedcrypto commented on GitHub (Jul 15, 2021):

To debug the issue comment out try-catch in src/DB/DBManager.php/testResource line 37.

public function testResource($input, $res) { // try { $this->capsule->getConnection($res); // } catch(\Exception $e) { // throw new DBException("Can't connect to target database"); // } if (!empty($input['table'])) { try { $this->capsule->getConnection($res)->table($input['table'])->first(); } catch(\Exception $e) { throw new DBException("Can't access target table"); } } }

Might need to install a driver I used docker so used the following command to install:

docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable pdo_mysql

<!-- gh-comment-id:880377256 --> @ratedcrypto commented on GitHub (Jul 15, 2021): To debug the issue comment out try-catch in src/DB/DBManager.php/testResource line 37. ` public function testResource($input, $res) { // try { $this->capsule->getConnection($res); // } catch(\Exception $e) { // throw new DBException("Can't connect to target database"); // } if (!empty($input['table'])) { try { $this->capsule->getConnection($res)->table($input['table'])->first(); } catch(\Exception $e) { throw new DBException("Can't access target table"); } } } ` Might need to install a driver I used docker so used the following command to install: `docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable pdo_mysql`
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#228
No description provided.