UnitedForums - UK Web Hosting Forum UnitedHosting Community Hosting Forums
Network and Server StatusCustomer SupportUK Web Hosting
UnitedHostingUnitedHosting Sitemap UK Hosting ForumUK Web HostingWeb Hosting ForumsUK Reseller HostingWeb Host CommunityUK Managed Dedicated ServersHosting Help and SupportUK Domain Name Registration

Go Back   UnitedForums.co.uk > UnitedHosting Community > Website Development & Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 19th January 2010, 05:20 PM   #21 (permalink)
TygerTyger
Lumberjack and OK
 
Join Date: Aug 2004
Posts: 935
That's what I tried first, but it doesn't seem to do anything. Just printed the MySQL help and then returned me to the cursor. Nothing in MySQL's processes. No errors even with --show-warnings flagged.

The file is a single table rather than a complete database, does that make a difference? I tried load data infile as well, it did the same thing.
TygerTyger is offline   Reply With Quote
Old 19th January 2010, 07:19 PM   #22 (permalink)
mark.willis
Developer
 
Join Date: Oct 2008
Location: poole, dorset
Posts: 194
Send a message via Skype™ to mark.willis
how big is the sql file? if you pm me a copy I'll take a look at it, and test it on one of my servers?
__________________
My PHP and MySQL Blog
mark.willis is offline   Reply With Quote
Old 20th January 2010, 01:52 AM   #23 (permalink)
m_c
Registered User
 
Join Date: Jul 2009
Posts: 22
Remember you need to set the host for a United Hosting server, using the -h option (should be -h 127.0.0.1).
m_c is offline   Reply With Quote
Old 20th January 2010, 09:50 AM   #24 (permalink)
TygerTyger
Lumberjack and OK
 
Join Date: Aug 2004
Posts: 935
Quote:
Originally Posted by mark.willis View Post
the ` will be getting executed in the bash terminal ... how are you running the command?
I tried a backup without backticks and it still gave syntax errors at the same point, I guess it just doesn't work that way. Thank you for your very kind offer!

Quote:
Originally Posted by m_c View Post
Remember you need to set the host for a United Hosting server, using the -h option (should be -h 127.0.0.1).
Thanks, I tried that but the result was the same. Nothing happened. For the prosperity of future searchers, here's what does work:

Code:
cd /var/www/html/

mysql -h 127.0.0.1 -uusername -ppassword example_com_db < example.sql
It will again return you to the command prompt without any status messages, but the import should have been successful.
TygerTyger is offline   Reply With Quote
Old 20th January 2010, 02:40 PM   #25 (permalink)
mark.willis
Developer
 
Join Date: Oct 2008
Location: poole, dorset
Posts: 194
Send a message via Skype™ to mark.willis
It should work really. Are you able to display/pm a copy of the sql file and I can look further into this?

Mark
__________________
My PHP and MySQL Blog
mark.willis is offline   Reply With Quote
Old 22nd January 2010, 03:40 PM   #26 (permalink)
TygerTyger
Lumberjack and OK
 
Join Date: Aug 2004
Posts: 935
That was what support told me to use. But I came across a way to execute the backups, here it is for the benefit of searchers. This assumes you've exported the database using phpMyAdmin and uploaded the exported file to your root folder.

Code:
// Set the directory
cd /var/www/html/

// If the database is gzipped, unzip it. Otherwise, skip this step
gunzip example_db_com.sql.gz

// Connect to Mysql to save doing it every time.
mysql -h 127.0.0.1 -uusername -ppassword

// Select the database to save doing it every time
\u example_db_com

// Now you can just execute the file.
\. example_com_db.sql
TygerTyger is offline   Reply With Quote
Old 22nd January 2010, 08:33 PM   #27 (permalink)
UH-Tony
Senior Server Administrator
 
UH-Tony's Avatar
 
Join Date: Mar 2006
Location: Houston, TX USA
Posts: 630
Just to clarify, the method you used Tyger is the same as:

cd /var/www/html/
gunzip example_db_com.sql.gz
mysql -h 127.0.0.1 -u username -ppassword -D example_db_com < example_com_db.sql
__________________
.
Tony
UnitedHosting Staff

For official support please use our helpdesk at UnitedSupport.co.uk

UnitedHosting proudly hosting more than 30,000 sites since 1998.
UH-Tony is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 02:21 PM.

UK Web Hosting  |  UK Reseller Hosting  |  UK Dedicated Servers UnitedHosting  |  UnitedSupport  |  SEO by vBSEO 3.0.0
Copyright © 1998-2009 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309