Go Back   Linux Forums by TotalPenguin! Get linux Help! > GUI Linux > Linux Applications

Linux Applications Discussion for Linux Software and Application releated issues.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-08-2007, 02:21 PM
Lop
Guest
 
Posts: n/a
Default .SQL into MySQL

In a shell prompt how do I import a .SQL file into MySQL? I need to restore a test database that has gone bad.
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-08-2007, 02:48 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 570
Jordan is on a distinguished road
Default

I've had to do this a lot for the users on my server. Once you have the dump it is always easiest to go through phpMyAdmin if possible but here is the shell command:

mysql -u USER -p DBNAME < dump.sql
Reply With Quote
  #3 (permalink)  
Old 08-14-2007, 02:56 PM
Lop
Guest
 
Posts: n/a
Default

That works. How do I get it out in the .SQL file from shell?
Reply With Quote
  #4 (permalink)  
Old 08-14-2007, 07:01 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 570
Jordan is on a distinguished road
Default

mysqldump -u <username> -p <database_name> > sqlfile.sql
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:20 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.