Posts Tagged ‘mysql’

只用一个数据库装多个Wordpress

如果你的空间服务商只提供一个mysql数据库,但是还想装两个甚至更多个wordpress?

如果出于经济考虑,你想和朋友共用一个mysql数据库,而建立不同的wordpress?

如果你在A公司买的php空间,在B公司买的mysql,如果搭建起wordpress?

今天在研究wordpress时,发现上面问题都可以在wp-config.php中圆满解决。

// ** MySQL settings ** //
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'username'); // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

// You can have multiple installations in one database if you give each a unique prefix
$table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-includes/languages.
// For example, install de.mo to wp-includes/languages and set WPLANG to 'de'
// to enable German language support.
define ('WPLANG', '');

/* That's all, stop editing! Happy blogging. */

define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
?>
Read the rest of this entry »

  • 全文搜索

  • 按月存档

  • 请猛点这里

    标签云

  • 最新评论

    • sayisee: 恭喜学长啊,异地恋真的不容易,佩...
    • sayisee: 刚查看谷歌分析入口来源,发现学长...
    • Lemok: 诶哟 恭喜包子哥...
    • 谢国冰: 老大 遇到点事情 寻求帮忙 有时间上...
    • Lee: 我也看中了这个,不过好贵呀,最便...
    • Min: 求源码......fla形式...
    • 网上·网下: 真是太棒了,比原文件少了许多,却...
    • Chon: 前两天还特意去看了一下,没研究出...
    • WeekFace: 安全的维护一台服务器需要考虑的太...
    • ugg boot: 这么多人围观,有好吃的要和大家分...
  • 纵横坐标