Web Hosting Talk







View Full Version : Newbie2MySQL, backup related question


boz1
11-16-2003, 12:01 PM
Hi all,

I'm completely clueless about MySQL/DB and related commands, but for reasons of changing Host I do need to download and save a small DB that a friend created for me long time ago.

Here is the problem:
I can reach to my DB through my account SSH (as my host demand),
I know that mysqldump is installed and that the command line should be:

/usr/local/mysql/bin/mysqldump -h DBHOSTNAME -u USERNAME -p DATABASENAME > DUMPFILE

I know the DBHOSTNAME, USERNAME and DATABASENAME.
I named the DUMPFILE back.sql.

But when I run the command instead to get a password demand i got this sign:
->

1.Whats wrong?
2. If it will work, where can i find the back up files?

Thanks in advance for your help.

Burhan
11-16-2003, 02:37 PM
after -p type your password (without a space). Also, you don't need -h because the default host is localhost (which is probably what you are on). Lets say your password is secret, then your command would look like :

mysqldump -u USERNAME -psecret DATABASENAME > DUMPFILE

Notice there is no space between -p and secret -- that is important.

boz1
11-16-2003, 02:50 PM
Thanks for your effort!

I just typed it in, it looked like this:

mysql>mysqldump -u USERNAME -psecret DATABASENAME > DUMPFILE


After i press Enter i got:


->


***The mysql> disappeared...

Please advise.

Burhan
11-16-2003, 03:26 PM
type a ; at the end of the line.
mysql>mysqldump -u USERNAME -psecret DATABASENAME > DUMPFILE;

boz1
11-16-2003, 03:32 PM
Eror in the SQL Syntex...

I trippled checked it and all seems OK.

Do you have any other idea?

Burhan
11-16-2003, 03:44 PM
You have to run mysqldump from the shell, not from the mysql> prompt.

If your screen says

mysql>

type quit;

then type

mysqldump -u USERNAME -psecret DATABASENAME > DUMPFILE

and hit enter.

boz1
11-16-2003, 04:48 PM
OK,

I went out to the shell, typed:

mysqldump -u USERNAME -psecret DATABASENAME > DUMPFILE;

Got:
command not found

But than i tried:
/usr/local/mysql/bin/mysqldump -h DBHOSTNAME -u USERNAME -p DATABASENAME > DUMPFILE

And I did got password request, I typed the pass and got a blinking dot :-(

But, when i checked the site through FTP I found the DUMPFILE.sql there!!!

But it was 0kb...

-What should i do after the i'm getting the blinking dot?
-Why was the DUMPFILE.sql empty?

Beer on me in Stockholm (sWEDEN) ;-)

Burhan
11-16-2003, 04:54 PM
blinking dot = its working

why you are getting the empty file? probably because you are not passing it the correct parameters.

Make sure the database name is correct, and try it without the -h HOSTNAME part.

boz1
11-16-2003, 05:07 PM
The info about the DB is from my laim hosting support team, is there any command to check the name of the DB or user through SSH?

I dropped the -h.. and got Eror 2002, can't connect to local MySQL...

Burhan
11-16-2003, 05:23 PM
okay -- use the -h HOSTNAME

make sure you are giving it the correct database name.

Ask your host to do the backup for you

If you have access to phpmyadmin, use that.

Read the mysql manual (http://www.mysql.com/doc/en/mysqldump.html)

boz1
11-16-2003, 05:42 PM
Thanks a lot for all the help!

I'll keep pressing my host to help, and read the manual.

sri
11-16-2003, 09:06 PM
boz, why not just install phpmyadmin? It has a easy to understand GUI and taking backups is very simple.

boz1
11-17-2003, 03:38 AM
Thanks for your response.

I don't think I can install any other application on it because the only way for me to reach the MySQL is through my SSH (I'm with/was Hostway...which don't answer my tickets on this issue).

My mission now is just to backup this DB, and run away from there.
Yesterday I signed with Unitedhosting, and there they have this application.

UH-Matt
11-17-2003, 05:09 AM
If you would like someone from here to SSH into your old hostway account and try the backup for you then please let us know.

UH-Matt
11-17-2003, 08:01 AM
Please check your PM, I have successfully recovered the database data from Hostway on your behalf.

boz1
11-17-2003, 08:10 AM
This what i call first class Host=UnitedHosting!