Forum Moderators: coopster

Message Too Old, No Replies

Database and table on my own computer

         

dkin

3:01 am on Dec 27, 2004 (gmt 0)

10+ Year Member



I am trying to create a database on my comp that replicates the database I use for my site. Now can I use the txt file through the extract option in phpmyadmin, and somehow run it from the mysql command line?

Or how could I do this?

Salsa

11:33 am on Dec 27, 2004 (gmt 0)

10+ Year Member



It's been long, long time since I used phpMyAdmin, but I recall that it has an option to view the dump or scheme of a database. That's what you want. Save the output as something like database_name.sql.

If you haven't created even an empty database on your local machine, add to the top of database_name.sql, something like:

CREATE DATABASE database_name; 
USE database_name;

Then, at the command line on your local machine (not in the mysql client):

mysql -u username -p < database_name.sql

...this assumes that you're in the same directory as database_name.sql and mysql is in your paths--or you've put database_name.sql in the same directory as mysql, and that's where you are on the command line too...

I hope this helps.