我想知道如何从 Windows 7 连接到远程服务器中的 MySql 数据库。我想从管理面板提供外部连接。如何连接到数据库?我有一个 php 编码来插入和检索远程数据库中的值。但在此之前我需要手动连接到远程数据库吗?请你帮我解决这个问题。#
<?PHP
$user_name = "fbapp";
$password = " 123";
$database = "fb_db";
$server = "mysql.dfw1.stabletransit.com";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "INSERT INTO Sample(Firstname, Lastnamme)
VALUES (35,67)");
$result = mysql_query($SQL);
mysql_close($db_handle);
echo "Records added to the database";
}
else {
echo "Database NOT Found ";
mysql_close($db_handle);
}
?>