我有两个 mysql 数据库,我想在其上运行 diff,我想连接的用户(root)有一个密码。
当我使用 mysqldiff 文档 here 中给出的命令时:
mysqldiff --server1=root@localhost --server2=root@localhost --difftype=sql old_db:db_brand_new
我收到一条错误消息,指出我的命令未经授权。
我尝试过普通 -p
开关的变体,但它不起作用。
如何验证 mysqldiff
命令?
最佳答案
您链接的文档说:
--server1=<source>
Connection information for the first server in the format: <user>[:<passwd>]@<host>[:<port>][:<socket>] or <login-path>[:<port>][:<socket>].
--server2=<source>
Connection information for the second server in the format: <user>[:<passwd>]@<host>[:<port>][:<socket>] or <login-path>[:<port>][:<socket>].
所以你可以尝试一下 mysqldiff --server1=root:[您的密码]@localhost --server2=root:[您的密码]@localhost --difftype=sql old_db:db_brand_new
关于mysql - 当数据库用户需要密码时如何使用mysqldiff?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29700276/