昨天我问了这个问题,但由于这个论坛的规则而被否决了。不管怎么说,这是我的学习,我真的感谢主持人谁投了这个,因为他们帮助我获得提示。
我的问题是,我在我的主机服务器Hostgator中有两个域名,名为damiracle.net (因为我无权提供多个像这样写的超链接)和damiracle.biz。
我的员工经常可以访问damiracle.biz的数据库。我必须在我的damiracle.biz目录中的一个目录中托管一个wordpress网站(因为没有可能在damiracle.net中托管特定的网站)。但我需要在damiracle.biz目录中的一个目录中保护该特定网站的数据库。
在这种情况下,我想的是,我将把数据库保存在damiracle.net中,damiracle.biz中的所有wordpress文件都保存在damiracle.biz中,这样我的数据库就不会受到员工访问的保护。
在damiracle.biz中的wordpress网站的following文件中,我以以下方式提到:
define('DB_NAME', 'the_db_name_of_the DB_inside_damiracle.net');
define('DB_USER', 'the_db_user_name_of_the DB_inside_damiracle.net');
define('DB_PASSWORD', 'the_password_of_the DB_inside_damiracle.net');
define('DB_HOST', 'ip_address_of_damiracle.net');因为我必须设置远程MySQL,所以我已经设置了damiracle.net的ip地址。
我还尝试过通过编写DB_HOST No来设置damiracle.net:port。而不是IP地址
但我仍然面临数据库连接错误。
有人能帮忙吗?
提前谢谢。
发布于 2014-04-25 14:08:39
对于安全问题,Hostgator需要wp-config.php中的更多参数(如端口等)才能连接到远程-非本地主机- mysql服务器。
读取http://support.hostgator.com/articles/cpanel/how-to-connect-to-the-mysql-database-remotely
https://wordpress.stackexchange.com/questions/142419
复制相似问题