Jump to content


Photo

Exporting a database?


  • Please log in to reply
7 replies to this topic

#1 barrow

barrow
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 21 June 2003 - 03:08 AM

I have a database on one server and need to move it to another. Is there a way to export the database to a .sql file so I can just run it on my new server and poof my database it there?

#2 Arenium

Arenium
  • Staff Alumni
  • Advanced Member
  • 111 posts
  • LocationMassachusetts

Posted 21 June 2003 - 03:14 AM

are you using phpmyadmin? if you are i can give you detailed instructions (yeah, all 4 mouse clicks :P ) but i wont bother unless you do.

#3 barrow

barrow
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 21 June 2003 - 03:16 AM

Nope, on the server with the database I only have webmin which I don\'t like too much so I telnet in.

#4 BinaryStar

BinaryStar
  • Staff Alumni
  • Advanced Member
  • 74 posts
  • LocationBethlehem, PA

Posted 21 June 2003 - 03:23 AM

You can write a script, have it extract the database name, all table names, all columns per table and the data and have it write your own SQL file....

not too hard....

check this out...
http://www.php.net/m...n/ref.mysql.php

BS :D

#5 barrow

barrow
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 21 June 2003 - 03:32 AM

Well, i\'m a newb and was hoping there was already a function written that did this something like . Export(directorypath, filename.sql) oh well.

#6 Arenium

Arenium
  • Staff Alumni
  • Advanced Member
  • 111 posts
  • LocationMassachusetts

Posted 21 June 2003 - 03:35 AM

hmm...on my linux partition i have a phpmyadmin install...i might get around to looking at the php file/function used to make the sql file. No promises though

#7 BinaryStar

BinaryStar
  • Staff Alumni
  • Advanced Member
  • 74 posts
  • LocationBethlehem, PA

Posted 21 June 2003 - 04:28 AM

Only one way to not be a newbie anymore, just expirement, read that URL i gave you, it is only like 4 to 5 major functions and your done....

mysql_list_dbs() - List databases available on a MySQL server
mysql_list_fields() - List MySQL result fields
mysql_list_tables() - List tables in a MySQL database

It is really quite easy...

BS :D

#8 rhysmeister

rhysmeister
  • Members
  • PipPipPip
  • Advanced Member
  • 51 posts
  • LocationEngland

Posted 27 June 2003 - 09:28 AM

There is such a function, use mysqldump...

http://www.mysql.com.../mysqldump.html




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users