Muteking
Muteking

Reputation: 1513

Transfer mysql table to server

I've set up a website on my local drive and created a table with xamp and php myadmin. The simple answer I'm asking is: how do I transfer the table into the server? I've tried to export the file with sql extension placing it in the root directory of the remote but that didn't work.

Upvotes: 1

Views: 102

Answers (6)

FelasDroid
FelasDroid

Reputation: 643

export and import sql file of your table

Upvotes: 1

Diego Claudiu
Diego Claudiu

Reputation: 334

  1. Go to your localhost database and choose export as normal .sql file with no compression
  2. Go to your server database and choose import and import the .sql file that you have saved earlier

So you need to save the file as .sql no archieve and then choose import in your server sqladmin

Upvotes: 1

Althaf M
Althaf M

Reputation: 508

You can export using phpMyAdmin as .sql format and import in the remote server either using phpMyAdmin (import) or by giving the file name as paramter to mysql command

Eg : mysql -u username -D databasename -p < filname.sql

replace username with your username & databasename with your datbasename to which the tables have to be imported and filename.sql as the filename to be imported

the filename.sql should be in your current directory where ever you are executing the mysql command from.

Upvotes: 1

ilias
ilias

Reputation: 521

In general, one would use mysqldump to create a dump and then import said dump on your server.

Another option to consider is using so called migrations. These are, basically, SQL scripts that introduce or remove changes to your table layout or necessary priming data.

A last option would be to use phpMyAdmin on your local environment and, again, import the created dump on your server using either phpMyAdmin (but you shouldn't really have that on a public-facing production server) or through the commandline.

Upvotes: 1

Sumit Bijvani
Sumit Bijvani

Reputation: 8179

Simple, After Export the sql file, you need to Import it via phpmyadmin.

Upvotes: 2

elixenide
elixenide

Reputation: 44851

You need to import the data somehow, not just put the .sql file on your server. Try using phpMyAdmin, which is likely already installed on your production server.

Upvotes: 1

Related Questions