1. Stepan Koltsov
  2. mysql-diff

Wiki

Clone wiki

mysql-diff / Demo

Latest mysql-diff source contains script demo.sh that creates two databases, executes different scripts in both and then executed mysql-diff program to compare databases. demo.sh output is:

# mysqlp -e DROP DATABASE IF EXISTS mysql_diff_demo_1

# mysqlp -e DROP DATABASE IF EXISTS mysql_diff_demo_2

# mysqlp -e CREATE DATABASE mysql_diff_demo_1

# mysqlp -e CREATE DATABASE mysql_diff_demo_2

# mysqlp mysql_diff_demo_1 < src/test/sql/simple_from.sql

# mysqlp mysql_diff_demo_2 < src/test/sql/simple_to.sql

# ./mysql-diff.sh jdbc:mysql://localhost:3306/mysql_diff_demo_1?user=video&password=video jdbc:mysql://localhost:3306/mysql_diff_demo_2?user=video&password=video

CREATE TABLE test (
    id INT(10) NOT NULL,
    test1 VARCHAR(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
    blim INT(10) NULL DEFAULT NULL
) ENGINE=MyISAM COLLATE=utf8_general_ci;

ALTER TABLE complaints DROP PRIMARY KEY, DROP COLUMN reporter_id, ADD COLUMN id INT(10) NULL DEFAULT NULL, ADD COLUMN r_id BIGINT(19) NOT NULL, ADD PRIMARY KEY (user_id), ENGINE=MyISAM;

# mysqlp mysql_diff_demo_1 < demo-diff.sql

Updated