[GH-ISSUE #18] DBDiff does not work for me #7

Closed
opened 2026-02-25 21:33:01 +03:00 by kerem · 5 comments
Owner

Originally created by @amontalban on GitHub (Aug 9, 2016).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/18

Hey,

I'm trying DBDiff to see if we can use it in our push to production process and I can't get it to work:

root@47db20dcad75:/DBDiff# ./dbdiff --debug --server1=root:secret@192.168.1.5:32789 --server2=root:secret@192.168.1.5:32790 --type=all server1.employees:server2.employees
✖ Can't connect to target database

It seems that it fails to connect (I also tried by creating .dbdiff config file with following content):

server1-user: root
server1-password: secret
server1-port: 32789
server1-host: 192.168.1.5
server2-user: root
server2-password: secret
server2-port: 32790
server2-host: 192.168.1.5
template: templates/simple-db-migrate.tmpl
type: all
include: all
no-comments: true

But as you can see the MySQL client can connect just fine to both servers (Docker instances):

root@47db20dcad75:/DBDiff# mysql -h 192.168.1.5 -u root -psecret -P32789 -e "show databases; select @@hostname;"
+--------------------+
| Database           |
+--------------------+
| information_schema |
| employees          |
| mysql              |
| performance_schema |
+--------------------+
+--------------+
| @@hostname   |
+--------------+
| 9b76c1977e66 |
+--------------+
root@47db20dcad75:/DBDiff# mysql -h 192.168.1.5 -u root -psecret -P32790 -e "show databases; select @@hostname;"                                                                                                                              
+--------------------+
| Database           |
+--------------------+
| information_schema |
| employees          |
| mysql              |
| performance_schema |
+--------------------+
+--------------+
| @@hostname   |
+--------------+
| 2601fdf05b85 |
+--------------+

Am I missing something?

Originally created by @amontalban on GitHub (Aug 9, 2016). Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/18 Hey, I'm trying DBDiff to see if we can use it in our push to production process and I can't get it to work: ``` bash root@47db20dcad75:/DBDiff# ./dbdiff --debug --server1=root:secret@192.168.1.5:32789 --server2=root:secret@192.168.1.5:32790 --type=all server1.employees:server2.employees ✖ Can't connect to target database ``` It seems that it fails to connect (I also tried by creating .dbdiff config file with following content): ``` yaml server1-user: root server1-password: secret server1-port: 32789 server1-host: 192.168.1.5 server2-user: root server2-password: secret server2-port: 32790 server2-host: 192.168.1.5 template: templates/simple-db-migrate.tmpl type: all include: all no-comments: true ``` But as you can see the MySQL client can connect just fine to both servers (Docker instances): ``` bash root@47db20dcad75:/DBDiff# mysql -h 192.168.1.5 -u root -psecret -P32789 -e "show databases; select @@hostname;" +--------------------+ | Database | +--------------------+ | information_schema | | employees | | mysql | | performance_schema | +--------------------+ +--------------+ | @@hostname | +--------------+ | 9b76c1977e66 | +--------------+ ``` ``` bash root@47db20dcad75:/DBDiff# mysql -h 192.168.1.5 -u root -psecret -P32790 -e "show databases; select @@hostname;" +--------------------+ | Database | +--------------------+ | information_schema | | employees | | mysql | | performance_schema | +--------------------+ +--------------+ | @@hostname | +--------------+ | 2601fdf05b85 | +--------------+ ``` Am I missing something?
kerem closed this issue 2026-02-25 21:33:01 +03:00
Author
Owner

@amontalban commented on GitHub (Aug 9, 2016):

NVM, I just saw that I didn't have php5-mysql installed in my test container.

Thanks!

<!-- gh-comment-id:238595784 --> @amontalban commented on GitHub (Aug 9, 2016): NVM, I just saw that I didn't have php5-mysql installed in my test container. Thanks!
Author
Owner

@cleartechllc commented on GitHub (May 1, 2017):

Hi amontalban,

I have the exact same issue (✖ Can't connect to target database). can you please tell me how fixed it?
how to install "php5-mysql installed in test container"

<!-- gh-comment-id:298384905 --> @cleartechllc commented on GitHub (May 1, 2017): Hi amontalban, I have the exact same issue (✖ Can't connect to target database). **can you please tell me how fixed it?** how to install "php5-mysql installed in test container"
Author
Owner

@gordonmurray commented on GitHub (May 16, 2017):

@cleartechllc If using Ubuntu, use the following:

sudo apt install php5-mysql
or
sudo apt install php7.0-mysql

depending on your system.

<!-- gh-comment-id:301931022 --> @gordonmurray commented on GitHub (May 16, 2017): @cleartechllc If using Ubuntu, use the following: sudo apt install php5-mysql or sudo apt install php7.0-mysql depending on your system.
Author
Owner

@lokeshatbigbasket commented on GitHub (Nov 16, 2017):

@gordonmurray @amontalban it's really weird for me, I got can't connect to target database then installed php5-mysql using apt-get, it worked and produced output. But, later after 5 minutes when I run the same command, it's throwing me the same error. I am yelling like anything. Anyone gotta help me here??

<!-- gh-comment-id:344902098 --> @lokeshatbigbasket commented on GitHub (Nov 16, 2017): @gordonmurray @amontalban it's really weird for me, I got can't connect to target database then installed php5-mysql using apt-get, it worked and produced output. But, later after 5 minutes when I run the same command, it's throwing me the same error. I am yelling like anything. Anyone gotta help me here??
Author
Owner

@lokeshatbigbasket commented on GitHub (Nov 16, 2017):

Guys sorry, it's my fault.... The database I am comparing in one server doesn't exist.... It's working now... Thanks...

<!-- gh-comment-id:344906680 --> @lokeshatbigbasket commented on GitHub (Nov 16, 2017): Guys sorry, it's my fault.... The database I am comparing in one server doesn't exist.... It's working now... Thanks...
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#7
No description provided.