ssslinppp

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

安装git

忽略

安装visual c++组件(和mysql workbench需要的一样)

https://www.microsoft.com/en-us/download/details.aspx?id=48145

一般如果本地之前安装过mysql,该组件应该已经安装完成

安装php,推荐wamp server一键安装以及自动配置

  1. 下载wamp server软件,可参考:WampServer的下载方法
  2. 官方下载地址:官方地址

如果安装完成后,失败,可以尝试如下方式解决:

  1. 换个网站下载安装包,可能是安装包的问题;
  2. https://stackoverflow.com/questions/35135587/php-no-php-ini-file

打开浏览器,输入localhost验证wamp server以及php是否安装成功

查看php.ini位置,并加入以下配置(放在最顶端即可)

配置文件位置确认: localhost登录成功后,最下方有个phpinfo()的tool,点击进去后搜索php.ini可以找到路径,
此处的路径为: D:\wamp64\bin\apache\apache2.4.37\bin\php.ini(示例)

zend_extension=php_opcache.dll
opcache.enable=On
opcache.cli_enable=On

安装composer

下载地址:https://getcomposer.org

安装过程中,如果发现选择 cmd-line php没有可选的,则手动选择一下 php.exe的路径,可以在 phpinfo()中查看php的版本;

打开cmd,输入composer -V能够查看到版本信息则安装成功

下载dbdiff文件夹

https://dbdiff.github.io/DBDiff
(download.zip文件)

随便找个目录解压;
可能还需要一个 vender.zip文件(没有会报错)

修改配置:.dbdiff文件

server1:
    user: root
    password: xxxx
    port: 30118 # for MySQL this is 3306
    host: 10.254.xx.xx # usually localhost or 127.0.0.1,这里配置数据库的ip
server2:
    user: user
    password: password
    port: port # for MySQL this is 3306
    host: host1 # usually localhost or 127.0.0.1
template: templates/simple-db-migrate.tmpl
type: schema
include: all
nocomments: true 

执行比对的语句:

$ ./dbdiff server1.db1:server2.db2

比对结果:

migration.sql
posted on 2019-03-18 18:17  ssslinppp  阅读(1103)  评论(2编辑  收藏  举报