Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup/Restore mysql database from remote server to local pc

Status
Not open for further replies.

suseli

Technical User
Dec 9, 2005
77
GB
Im trying to download mysql database "dbproducts1" which is residing in my webhost's server (Linux).
From telnet i backed up using "mysqldump -u -p dbproducts1 > dbproducts1.sql"

Then i downloaded this file via ftp to my local pc(WinXP). Now on my local pc to restore database i went to command prompt and i did following:
mysql -u -p dbproducts1 < dbproducts1.sql

I got following error:
ERROR 1064 (42000) at line 380: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to use
near '-workshop (
title varchar(250) NOT NULL default '',
decription longtext NOT ' at line 1

I opened the phpmyadmin and found that dbproducts1 database was restored but with only few tables i.e. not all tables in the db was restored.

Can somebody please help me to backup/restore this database. I checked the mysql server version and found following:

server version: 5.0.24a-community in my local winxp pc
server version: 3.23.36 in my webhost's server (Linux)
 
I ran into a similar problem today. I downloaded data (mysqlhotcopy) from a MySQL 4.0 database (Linux) and tried to import into MySQL v.5 (Linux). Everything worked fine until I tried to access the data. Once I downgraded my version to 4.0, everything worked. There must me some compatibility issues. I suppose, you could edit the create table part of the dump, but I'm not sure how many you'd have to touch.

Good luck,
Mark
 
After you upgrade MySQL you should update the system tables using mysqlcheck.
Code:
% mysqlcheck --check-upgrade --all-databases --auto-repair
mysql_fix_privilege_tables

M. Brooks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top