top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

Importing SQL dumps into MySQL through Command line

0 votes
33 views

To source sqldump i can use the source command, but if I need to do the same stuff using command line without going to the sqlpromt, can I achieve that.

posted Mar 31, 2013 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

If I understand your question correctly, and assuming a *nix environment, you can:

mysql -u xxx dbname -p < mysqldump

You'll get prompted for the password. [you can embed the pw there, but that's not good form as it will then be in your shell's history, which can be cleared, but can be captured.]

I always dump my table definition(s) separately from the data, so do the load in two steps, but if you did the dump as a single action that will work too, though it is harder to debug if there's a problem.

answer Mar 31, 2013 by anonymous
Similar Questions
0 votes

I am running My-SQL in cluster mode with two machine. Want to know if mysql database get corrupted on one of the machine will it force the corruption on the other machine too or in this case sync between two mysql instances will stop after the corruption.

0 votes

My site is using mysql and PHP, now for the scale purpose want to introduce mysql-cluster. Few questions are -
1. Do I need to change any code which is written in PHP.
2. What are the steps to convert mysql to mysql-cluster.

Appreciate the help.

+1 vote

I am using PHP along with mysql. Mysql default configuration allows to have 100 simultaneous connection which I want to chane to 200. Please help.


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...