PDA

View Full Version : Instruction command for SAVING a Database Backup?


Xube
Tue 30th Jul '02, 6:50pm
In an attempt to backup my database using telnet/SSH rather than the simple "save to disk" method, I have downloaded Putty and logged on to save my dbase to ssh. I then logged on to putty and used the following command input line:

mysqldump --opt -uPutMyUsernameHere -pPutmyDatabaseNameHere > /path/to/backup.sql

And got this reply:

bash: /path/to/backup.sql: no such file or directory


:( I did confirm with my host that my dbase name was correct. Hints? Are there other instruction lines I can use? What else can I try to do to resolve this?

eva2000
Tue 30th Jul '02, 7:51pm
/path/to/backup.sql

you have to change that to your own path

i.e.

if your account web space is at

/home/username/public_html

you need to change it to


mysqldump --opt -u PutMyUsernameHere -p PutmyDatabaseNameHere > /home/username/public_html/backup.sql

Xube
Tue 30th Jul '02, 8:23pm
Originally posted by eva2000
/path/to/backup.sql

you have to change that to your own path

i.e.

if your account web space is at

/home/username/public_html

you need to change it to


... > /home/username/public_html/backup.sql


<gulp> I told you I was a newbie. :p

regarding the


/home/username/public_html/backup.sql

-- is "home" just the word home....or do I enter my websites main address (like website.com) ...

-- I assum that "username" is my logon name (same as the one I use to log onto the sillyputty.

--what is "public_html"? I have one website where everything that you want to display has to be entered into the public_html folder...but the website that I'm doing this backup on does not seem to use the public_html tags for folders.... so.. ummm... should I substitute "localhost" for the public_html?

Other question is.... regarding the path/to/backup.sql concept... am I at the moment that I enter this info CREATING a new file with the path that I describe in this line for a backup file. ie: if I enter:

...mywebsite.com/mylogonname/localhost/storemynewlycreatedbackupfilehere.sql


Is that command's purpose to CREATE a file called storemynewlycreatedbackupfilehere.sql, such that once I'm done, I'll be able to go onto my site's file manager and download an sql file titled storemynewlycreatedbackupfilehere.sql

...Or do you mean I should be pointing to some pre-existing backup.sql file (that I have created before I begin the puttyprocess) somewhere on my webspace?




OMG...I really wish Microsoft would buy this silly putty organization and "dumb it down" like they do everything else they own so we "pedestrians" could understand it all.... (...to save your database just click and drag the friendly smiling database cartoon character displayed down to your toolbar....) :D

eva2000
Tue 30th Jul '02, 9:02pm
ask your web host what the full path to your web account is - it's different depending on how the host has their server configured

Zenith
Tue 30th Jul '02, 11:37pm
Don't worry about a path. If you're logged into your hosting account through ssh (or telnet) then you're in your account's root directory anyway. Just give it a filename eg. > a_file_name.sql

It doesn't have to exist, mysqldump will create it.

If you then ftp to your account you'll find the file in root (top level) directory of your account.

Also, you don't need the --opt switch.

mysqldump -uusername -ppassword db_name > filename.sql

is fine.

Z

eva2000
Wed 31st Jul '02, 12:01am
Originally posted by Zenith
Don't worry about a path. If you're logged into your hosting account through ssh (or telnet) then you're in your account's root directory anyway. Just give it a filename eg. > a_file_name.sql

It doesn't have to exist, mysqldump will create it.

If you then ftp to your account you'll find the file in root (top level) directory of your account.

Also, you don't need the --opt switch.

mysqldump -uusername -ppassword db_name > filename.sql

is fine.

Z --opt is important if you have a large database, and it prevents mysql from loading your entire mysql database into memory before dumping.... you're web host would appreciate it too... and not complain about mysql usage etc :)

DO NOT pass your password on the same line it's a security risk!

Zenith
Wed 31st Jul '02, 1:02am
Ah, OK. I'll keep that in mind.

Z

Xube
Wed 31st Jul '02, 5:56pm
Originally posted by Zenith
mysqldump -uusername -ppassword db_name > filename.sql


So the p is referring to the fact that I need to put a password in this space? In the earlier examples I thought it was indicated that what I should put there is mydatabasename (whatever it actually is)?


Originally posted by eva2000
--opt is important if you have a large database, and it prevents mysql from loading your entire mysql database into memory before dumping.... you're web host would appreciate it too... and not complain about mysql usage etc :)

DO NOT pass your password on the same line it's a security risk!

Ok, never put your password on the same line... do U mean I need to put it on a different line or just not enter it at all and place my actual database's name after the p?

Will go and try a some variations on these suggestions. :( I'm so lost.

Steve Machol
Wed 31st Jul '02, 6:01pm
Just use:

mysqldump --opt -uusername -p db_name > filename.sql

...then you will be prompted for your db password.

Xube
Wed 31st Jul '02, 6:09pm
Ok, "some" progress... (if you can call it that... ? :p )

Instead of the "There is no such file, go away until you know what the 'ell you're doin message" as noted earlier, I now get this:


mysqldump: Got error: 1045: Access denied for user: 'myusername@localhost[' (Using password: NO) when trying to connect


(I'm putting my actual log on name in the area instead of the "myusername" which I'm showing above for display purposes)... The user name I'm insterting is the same one that allows me to log on to putty in the first place. So... ummm... is something other than the username I'm entering wrong.. or can the error 1045 indicate something else? Thanks for all your help so far. Much appreciated. :D

** I notice it says "using password: NO"..... Any chance this is indcating that I do indeed have to insert some kind of password during this step?

Xube
Wed 31st Jul '02, 6:14pm
Originally posted by smachol
Just use:

mysqldump --opt -uusername -p db_name > filename.sql

...then you will be prompted for your db password.

:rolleyes: Just saw your post Steve. Note my post above... I didn't get a prompt for a password when getting that response from putty.

Xube
Wed 31st Jul '02, 6:32pm
Originally posted by smachol
Just use:

mysqldump --opt -uusername -p db_name > filename.sql

...then you will be prompted for your db password.

I stand corrected Steve. With my previous putty entry I had entered all that you suggested in your line above except the --opt part. I've gone back and entered the line the way you have it and the response is...






....absolutely nothing. :( No request for a password, nothing except a ~$ (which are the characters given at the beginning of each new line of putty). I guess putty has decided to stop speaking with me.

http://www.showdogsupersite.com/nutty.jpg

Steve Machol
Wed 31st Jul '02, 6:39pm
PM me the ssh access info and your db username, password and db name and I'll take a look.

Xube
Wed 31st Jul '02, 7:03pm
:rolleyes: Sent.

Steve Machol
Wed 31st Jul '02, 7:10pm
The login info didn't work.

Zenith
Wed 31st Jul '02, 7:33pm
Originally posted by eva2000 DO NOT pass your password on the same line it's a security risk! [/B]
He's in through ssh though isn't he? I can see the risk in telnet, but secure shell?

Sorry, I'm confusing the issue... I'll butt out now :)

Z

Steve Machol
Wed 31st Jul '02, 7:37pm
There's still a risk because anyone else on the same server could find out the password by typing 'ps aux' at the command line while he is running the dump.

Zenith
Wed 31st Jul '02, 7:43pm
Ah, gotchya.

Z

Xube
Thu 1st Aug '02, 12:29pm
Originally posted by smachol
The login info didn't work.

Ok, :( I'll try again, resent.

Steve Machol
Thu 1st Aug '02, 3:55pm
I tried to run mysqldump on your server and got the same errors as you. The only thing I can think of is: (a) the host requires special permissions to access the db with mysqldump, or (b) they require a special prefix on the user name and password.

The first thing I'd recommend is that you contact your host and tell them that you are running into permission errors running mysqldump even when you are using the correct u/n, p/w and db name. If they can't or won't help, then fill out a support ticket at:

http://www.vbulletin.com/members/support_form.php

Be sure to include the login info to your Admin CP, ssh *and* phpMyAdmin (or equivalent.)

Xube
Fri 9th Aug '02, 8:12pm
Just following up for anyone who may have subscribed to this post:

http://www.vbulletin.com/forum/images/icons/icon14.gif All is resolved. Backup completed. Thanks for all the help here guys!