开发者

how to import mysql database

I'm not a great expert in php and mysql. I want to test my drupal site, but I don't know how to import my local database to the webserver开发者_StackOverflow社区.

I only have ftp credential, database name and database credential. phpmyadmin and any type of control panel are not present.

This is the ftp folders tree (I'm using filezilla):

  • anon_ftp
  • bin
  • cgi_bin
  • conf
  • error_docs
  • httpdocs
  • httpsdocs
  • pd
  • private
  • statistics
  • subdomains
  • web_users

I've published the drupal's folder in httpdocs folder. May I publish my database dump file through ftp?

I ask you a little help before contacting my hosting provider

Thanks in advance!


Without having an interface like phpmyadmin this could be a hard task. The only think I can think of is to use php to run a .sql script.

  1. Export your database into a *.sql file
  2. upload it to your webserver
  3. In a php page, do commands to connect to your database, and then run a command like

this:

mysql_query("SOURCE path/to/sqlfile.sql");

Then hit that php page with your web browser

reference: php mysql_query


Installing phpMyAdmin (installation instructions here) would be a valid way to do this. phpMyAdmin provides a convenient interface for importing database dumps.

Alternatively, phpMiniAdmin is a lightweight tool that fits in one small file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜