mySql dump

  • Christian Chat is a moderated online Christian community allowing Christians around the world to fellowship with each other in real time chat via webcam, voice, and text, with the Christian Chat app. You can also start or participate in a Bible-based discussion here in the Christian Chat Forums, where members can also share with each other their own videos, pictures, or favorite Christian music.

    If you are a Christian and need encouragement and fellowship, we're here for you! If you are not a Christian but interested in knowing more about Jesus our Lord, you're also welcome! Want to know what the Bible says, and how you can apply it to your life? Join us!

    To make new Christian friends now around the world, click here to join Christian Chat.
W

wwjd_kilden

Guest
#1
I am trying to make a dump of my database.

(Actually, I am trying to move tables between databases, and using create table db1.dbo.table select * from db2.dbo.table is not working)

If I understand this correctly the dump command must be preformed without me being signed in first.
However, I don't know how to bypass the automatic prompt to sign in as the sql client starts (thus i have to sign in). I tried doing it anyway, but end up with a syntax error warning.

Any suggestions?

Oh, btw, I don't have to create any file before doing this, right?

..
mysql> mysqldump -u root -p x test > minDB.sql;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump -u root -p x test > minDB.sql' at line 1

mysql> mysqldump -u root -p x test > C:\\Users\\astridbo\\mindb.sql;
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR:
Unknown command '\\'.
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump -u root -p x test > C:\\Users\\astridbo\\mindb.sql' at line 1
-----

It's not something I have to know now, but I am sure it would be a useful thing to know in the future
 
W

wwjd_kilden

Guest
#2
Oh, and totally unrelated:

In Visual Studio I have this problem where "rebuild" doesn't seem to rebuild at all. (The old code runs rather than the updated one, so it is not detecting my newly added method),

I tried to remove everyting in the bin and obj folders (apart from the exe file and some other stuff needed to make sure it didn't crash), but still it is not detecting the new code (!). I tried google, but they only suggest the things that I already tried.

is there any way to fix this? Even if deleting files had worked it is pointless to have to do this a hundred times because I am testing small bits of code.

PS: I have not been able to find the "clean" option in VS
 

Attachments

Last edited:

shemaiah

Senior Member
Jan 28, 2011
2,233
30
48
29
#3
I haven't done this in sometime and have no pc with me, but isn't "-p" supposed to be "-P" and you mustn't type the password after the "-P" its supposed to pop after you execute the command... Or maybe try:
mysqldump --opt --user=root --password test
 

shemaiah

Senior Member
Jan 28, 2011
2,233
30
48
29
#4
I've never used VS so am 101% blank on that :)
 
W

wwjd_kilden

Guest
#5
I haven't done this in sometime and have no pc with me, but isn't "-p" supposed to be "-P" and you mustn't type the password after the "-P" its supposed to pop after you execute the command... Or maybe try:
mysqldump --opt --user=root --password test

hmm, will try that tomorrow (too late to think now). Thanks for the tip.

But: Where do I do this from? I can't be signed in when doing that, can I? the thing is, I cannot access the mySql command thing without doing so, as it opens asking for my password (!).
 

shemaiah

Senior Member
Jan 28, 2011
2,233
30
48
29
#6
Yes, just open the terminal and type in the command as you did originally, but this time just change the options to that which I said. You can't be signed in into mysql but after entering the command it will prompt for the password. God bless
 
G

GRA

Guest
#7
'-p' => '--password'
'-P' => '--port'

If you use '-p' AND supply the password on the command line --- DO NOT put a space between '-p' and the password. (If you use '-p' without a password, it should prompt you for it after you submit the command.)


Try this:

mysqldump -u root -px test >minDB.sql

'x' is the password.

Remember - no space between '-p' and 'x'. Or, use '-p' without supplying the password.

.