简体   繁体   English

Mysql 从 Azure 数据库中复制的数据,用于 MYSQL 到 VM Z14498B83DD1667A0ZFAFFDA4B

[英]Mysql Data in Replicaiton from Azure Database for MYSQL to VM MYSQL

I created Azure Database for MYSQL and also created a VM and installed MYSQL.我为 MYSQL 创建了 Azure 数据库,还创建了一个 VM 并安装了 MYSQL。

I have created the users with privilages in both the servers using the below command.我已经使用以下命令在两个服务器中创建了具有特权的用户。

CREATE USER 'syncuser'@'%' IDENTIFIED BY 'yourpassword';
GRANT REPLICATION SLAVE ON *.* TO ' syncuser'@'%';

when i tried executing the below command from Azure Database MYSQL it got executed.当我尝试从 Azure 数据库 MYSQL 执行以下命令时,它被执行了。

CALL mysql.az_replication_change_master('11.11.11.11', 'syncuser', 'P@ssword!', 3306, 'mysql-bin.000002', 120, '');

however when i tried to execute the below command from VM MYSQL i am getting error has mentioned below highlighted, please help但是,当我尝试从 VM MYSQL 执行以下命令时,我收到的错误已在下面突出显示,请帮助

change master to将主人更改为

master_host = 'somedb.mysql.database.azure.com' , 
master_user='myuser', 
master_password='passwrd', 
master_log_file='mysqldb2-bin.000003';

error connecting to master '@mepocdb.mysql.database.azure.com:3306' - retry-time: 60 retries: 1 message: The connection string may not be right.连接到主服务器时出错'@mepocdb.mysql.database.azure.com:3306' - 重试时间:60 可能不是正确的连接字符串:1 条消息Please visit portal for references.请访问门户以获取参考。

For your issue, just as the error shows that the connection string may not be right.对于您的问题,正如错误表明连接字符串可能不正确一样。 I'm not sure, but you said you created the users with privileges in both the servers.我不确定,但您说您在两台服务器中都创建了具有特权的用户。 So I think the user and the password od the change master string should be the same:所以我认为更改主字符串的用户和密码应该是相同的:

master_host = 'somedb.mysql.database.azure.com' , 
master_user='syncuser', 
master_password='P@ssword!', 
master_log_file='mysqldb2-bin.000003';

And I think you should also add the public IP address of the VM to the firewall of the Azure Database for MySQL.而且我认为您还应该将VM的公共IP地址添加到MySQL的Azure数据库的防火墙中。 And more details here .更多细节在这里 Please let me know if you have more questions.如果您有更多问题,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM