Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
  #46  
Old 28 Oct 2007, 01: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 mysql.myhost.com < /full/path/to/sqldump.sql
Reply With Quote
  #47  
Old 10 Jan 2008, 04: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
  #48  
Old 12 Jan 2008, 06: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
  #49  
Old 18 Jan 2008, 13: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
  #50  
Old 22 Oct 2008, 23: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: http://www.chiark.greenend.org.uk/~sgtatham/putty/). 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.

Thanks,
-Snake
www.metalgearforums.com
How does bash/command line. look like or what is it???
Reply With Quote
  #51  
Old 29 Jul 2009, 12: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
  #52  
Old 08 Nov 2009, 20:51
dr.msk dr.msk is offline
 
Join Date: Aug 2007
thanks
Reply With Quote
  #53  
Old 03 Mar 2010, 09: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

gsmrapid@gsmrapid.com [~]# mysql --password=bH>-cgSlQ9d/ -h localhost -u gsmrapid_forum gsmrapid_forum < gsmrapid_forum.sql
-jailshell: -cgSlQ9d/: Is a directory
gsmrapid@gsmrapid.com [~]#
Reply With Quote
  #54  
Old 06 Mar 2010, 21: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
  #55  
Old 21 Sep 2010, 10: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 11:02.
Reply With Quote
  #56  
Old 27 Nov 2010, 10:15
almajrouh almajrouh is offline
 
Join Date: Nov 2010
my be use scrip like bigdump.php
Reply With Quote
Reply



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 04:30.

Layout Options | Width: Wide Color: