![]() |
Help Needed: MySql Question
Here is the situation....
I am getting ready to revamp dnclassifieds.com completely and I need to extract the mysql database and its info so i can get some info out of it and have it configured to work with the new system that is being built.... How would i extract it and be able to get info out of it? This is on a NT Box and its running in coldfusion.. Keev 104463163 |
NT Box, hmmm...I know for unix (redhat actually), this'll do it:
mysql -p(passwordhere no space after the -p) (database name to extract to) < /absolute/path/to/*.sql Obviously, don't use the parenthesis. |
Installing phpmyadmin on the new (or both) machines can make life a LOT easier if you're not too hot on MySQL and need to move stuff.
|
Oops - that'll teach me. Totally missed the NT box thing. Still, it may have an NT version.
|
|
mysqldump [db_name] > some_file
move 'some_file' to new server myqladmin create [db_name] mysql [db_name] < some_file pretty simple.. |
just use mysqldump it comes with windows install and is located under the bin directory in your mysql instillation
|
if you can run PHP and I'm pretty sure you can install phpMyAdmin.... once setup, just select the database you want, select all tables in the database and select table structure and data and you can download it to your comp as a .sql file.
that's the easiest way.... Backing up mySQL from the command line: Log into telnet. Then move to the directory where you want the backup to be. then type: mysqldump -u mysqlusername -p mysqldatabase > dumpfile.sql; (Note: the ";" at the end is important to have it recognised as a mysql command) Then you'll be asked for your mysql password. Just enter it without any ";" at the end. Then ftp in and go to the dir. Download the .sql file and there you go. Restoring the data to the database (same or different) is easy. Just log in into telnet again, change to the appropriate directory where you have your .sql stored and enter following: mysqldump -u mysqlusername -p mysqldatabase < dumpfile.sql; Then you'll be asked again for your password. I don't really know if this works on your box.... Contact me if you have problems! |
you don't run mysqldump the second time to import it, you run mysqlimport or you can simply do
mysql -uUSER -pPASS -A < file.sql assuming the file.sql has the create database foo; use foo; lines. |
| All times are GMT -7. The time now is 10:08 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123