Register Members List Search Today's Posts Mark Forums Read

Article Options
Old 28 Oct 2007, 00:33
ryanj19 ryanj19 is offline
Join Date: Nov 2003
Originally Posted by Rhoads View Post
I tried but i get a error:

Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect -/bin/bash-2.05b$

Whats the problem, i use the command from your post, with my user and database name.
I noticed someone asked this question, but it doesn't look like it got answered. Anyway, the MySQL command could be more complete. In some cases the server might not be localhost. Therefore, the command should look like this:

mysql -u MyUserName -p MyDBName -h < /full/path/to/sqldump.sql
Reply With Quote
Old 10 Jan 2008, 03:34
letsjoy's Avatar
letsjoy letsjoy is offline
Join Date: Jul 2006
thanks for post
"Everything you can imagine is real"
-Pablo Picasso

Pakistan - Ahmad
Reply With Quote
Old 12 Jan 2008, 05:01
Raptor Raptor is offline
Join Date: Nov 2001
for those with SSH access its very easy to backup and to compress (gzip took my DB from 1.4GB to 327MB - Took about 3 minutes

mysqldump --opt -Q -u <username> -p <database name> | gzip > database.sql.gz

to restore....

gunzip < database.sql.gz | mysql -u <username> -p <database name>

hope this is clear and helps someone out
Reply With Quote
Old 18 Jan 2008, 12:57
Snake's Avatar
Snake Snake is offline
Join Date: Mar 2005
Location: Cleveland, OH
Real name: Josh
Yeah, but I don't think most of the hosts out there provide SSH access especially when they're running a small forum. That's why the either way to backup and/or restore is by phpMyAdmin or some other SQL tool. Shell is pretty much useful for a very large forum.

You're quite welcome, letsjoy.
Reply With Quote
Old 22 Oct 2008, 22:16
mokujin's Avatar
mokujin mokujin is offline
Join Date: Nov 2005
Real name: Đạt
Originally Posted by Snake View Post
Step 4 - Restoring using SSH

Note: Some hosts do not offer SSH access, I suggest contacting your host and asking him/her if SSH access is enabled and if so the details. A good program to use for connecting via SSH is PuTTY (Get it at: Don't know how to use it? Search on Google for a tutorial.
  1. Connect to your host via SSH, login & run: mysql -u user -p dbname < {path}/backup.sql
  2. You will be asked to type out your password once you run that command, do so and click enter. It may take some time for it to respond, but once completed you should be brought back to where you started (bash/command line).
Congratulations! You have successfully restored your database using SSH.

That's basically it I think, I believe I have covered everything? Anything I missed? Comments or suggestions? Just let me know! Hope this tutorial was as useful to you as it is to me.

How does bash/command line. look like or what is it???
Reply With Quote
Old 29 Jul 2009, 11:29
nickson nickson is offline
Join Date: Jul 2009
my host has 2mb of limited to upload sql, and my database is worth 22mb, how could i go about this now? I am noob for restoring
Reply With Quote
Old 08 Nov 2009, 19:51
dr.msk dr.msk is offline
Join Date: Aug 2007
Reply With Quote
Old 03 Mar 2010, 08:04
kabir's Avatar
kabir kabir is offline
Join Date: Aug 2009
Originally Posted by Coders Shack View Post
To login and backup a database in one line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To restore a database in one line:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
I use This Command But Server Says Me

[email protected] [~]# mysql --password=bH>-cgSlQ9d/ -h localhost -u gsmrapid_forum gsmrapid_forum < gsmrapid_forum.sql
-jailshell: -cgSlQ9d/: Is a directory
[email protected] [~]#
Reply With Quote
Old 06 Mar 2010, 20:25
ehabfouad22 ehabfouad22 is offline
Join Date: Oct 2007
I've created a backup zipped file in (MYI, MYD, FRM) formats. Its size was about 120 MB. Then I created a backup of the same database through phpMyAdmin in a .sql format, with a size of 16 MB only! Does that mean that my backup with phpMyAdmin was incomplete? Or it's normal to have a .sql file with a size much less than the actual size of direct database files?
Reply With Quote
Old 21 Sep 2010, 09:56
basketmen's Avatar
basketmen basketmen is offline
Join Date: Nov 2006
guys i want to move to another host, i already backup the mysql using ssh and get the .sql file, downloading to computer, and i want to uploading to new host using ftp and restore it there using ssh too

my question is in uploading to new host using ftp part, do i need using ASCII mode or binary mode when uploading the .sql file?
I am SEO specialist and forum coordinator

Last edited by basketmen; 21 Sep 2010 at 10:02.
Reply With Quote
Old 27 Nov 2010, 09:15
almajrouh almajrouh is offline
Join Date: Nov 2010
my be use scrip like bigdump.php
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Article Options

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

New To Site? Need Help?

All times are GMT. The time now is 17:29.

Layout Options | Width: Wide Color: