【发布时间】:2021-02-25 08:46:42
【问题描述】:
我的本地 sql 太大了。
现在我想添加另一个远程mysql。
任何人都可以在以下本地mysql连接中设置远程mysql吗?
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
#Localhost mysql: Make it only read
$hostname_saha = "localhost";
$database_saha = "bdwebstk_1a";
$username_saha = "bdwebstk_1a";
$password_saha = "111111111111";
#remote mysql : Plesae make it read and write
$hostname_saha = "xx.yy.zz.zz";
$database_saha = "horjecom_aw";
$username_saha = "horjecom_aw";
$password_saha = "000000000000000000";
$saha = mysqli_connect($hostname_saha, $username_saha, $password_saha, $database_saha) or trigger_error(mysqli_error($saha),E_USER_ERROR);
mysqli_set_charset( $saha, 'utf8');
?>
【问题讨论】:
-
您遇到错误了吗?
-
上面只放了我的代码。它没有被编辑。你可以编辑它,就好像只有 localhost 会读取而 Remote sql 会读取和写入。