emi
emi

Reputation: 45

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.

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):

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!

Upvotes: 2

Views: 3338

Answers (2)

Groovetrain
Groovetrain

Reputation: 3325

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

Upvotes: 3

Pekka
Pekka

Reputation: 449783

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.

Upvotes: 0

Related Questions