首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在我新托管的wp网站上建立数据库连接时出错

问在我新托管的wp网站上建立数据库连接时出错
EN

Stack Overflow用户
提问于 2015-11-01 13:47:22
回答 1查看 513关注 0票数 0

我在一个困难的情况下。我还不知道托管网站到目前为止。我已经开发了一个wordpress网站,并试图在当前工作域的工作服务器上托管它。在它成为一个静态网站之前。主机提供程序是www.networksolutions.com。我主持的是,

代码语言:javascript
复制
1. exported database from a fully working website in local server (xampp).
2. exported database file is opened with dreamweaver and edited localhost and repalce with my domain name (www.abc.com) say..
3.edited wp_config file like below 

   define('DB_NAME', 'my_db');

  /** MySQL database username */
  define('DB_USER', 'my_usernm'); //before 'root'

  /** MySQL database password */
 define('DB_PASSWORD', 'my_pass'); //before null

  /** MySQL hostname */
  define('DB_HOST', 'www.abc.com'); //before 'localhost'

    4.uploaded database file in to web server and transfer the website folder in /htdocs using filezilla

 5.Redifined the domain pointing to old folder to my new folder jst uploaded
  www.oldabc.com -> htdocs/
   www.abc.com -> htdocs/abc/ <-here abc folder contains the whole files and  folders of my wordpress site.

 6. databse is uploaded sucsessfully but dont know how to link with    thespecific ftp account/folder.  I have put the username and password in  wp_config file same like ausername and   password for uploading the database to the phpmyadmin host window.  

请帮帮忙!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-11-01 15:06:03

问题可能在这里:

/** MySQL主机名*/ MySQL(‘DB_HOST’,'www.abc.com');//在'localhost‘之前

数据库几乎总是托管在'localhost‘,而不是在您的域中。

试着恢复到:

/** MySQL主机名*/ MySQL(‘DB_HOST’,'localhost');

更详细的答案

  1. 我建议您在NetworkSolutions上创建WP的默认安装--包括库存数据库。这将负责配置所有内容:站点url、站点主页、数据库用户、dbase pw等等。
  2. 从本地安装下载您的主题,并将其上载到新站点。
  3. 然后在现有的本地WP安装中,转到Admin > Tools >Export并选择要导出到新站点的所有内容。
  4. 转到新站点Admin > Tools > Import,并导入您导出的内容。使用WP导入/导出应该消除覆盖新数据库中不应被本地安装(站点url、home url、用户等)覆盖的任何内容。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33462814

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档