我有mysql主从配置,当我指定两个ips时我无法连接到它。我搜索连接字符串并找到http://www.connectionstrings.com/mysql-connector-net-mysqlconnection/
Server=serverAddress1, serverAddress2, serverAddress3;Database=myDataBase;
Uid=myUsername;Pwd=myPassword;
所以它看起来很简单但是当我指定我的两个ips时我得到错误“没有这样的主机已知”
我也找到了https://blogs.oracle.com/MySqlOnWindows/entry/how_to_using_replication_load并试了一下,但奇怪的是那时它慢得多。所以现在我迷失了,我无法使用我的复制。
PS。我不确定它是否有意义,但我在Azure上运行它
答案 0 :(得分:0)
您应该在特定配置部分指定服务器
"server=MasterSlave;database=sakila;"
然后使用以下作为连接字符串:
<!DOCTYPE html>
<html>
<body>
<script>
var error_user_password = false;
function checkpw(){
var user_password = document.forms["joinform"]["user_password"].value;
if (user_password == null || user_password == "") {
text = "Password : Required";
document.getElementById("errormsg4").innerHTML = text;
error_user_password = false;
} else {
document.getElementById("errormsg4").innerHTML = "";
error_user_password = true;
}
}
function submitall() {
checkpw()
if(error_user_password == false) {
return false;
} else {
return true
}
}
</script>
</body>
<form id="joinform" method="post" name="joinform" action="#hello" onsubmit="return submitall()" >
<h2>Join</h2>
<input type="password" name="user_password" id="user_password" placeholder="Password" onblur="checkpw()" />
<div class ="errormsg" id ="errormsg4"></div><br>
<input type="submit" name="join" id="join" value="Submit" ><br><br>
</form>
</html>
来源:https://blogs.oracle.com/MySqlOnWindows/entry/how_to_using_replication_load