Gossamer Forum
Home : Products : Others : MySQLMan :

Mysql Error restoring Wordpress

Quote Reply
Mysql Error restoring Wordpress
Apache version1.3.37 (Unix)PHP version4.4.7MySQL version4.1.22-standard When using mysqlman I restore a wordpress 2.1.2 backup made with mysqlman, it gives me this error: Error MySQL said: 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 '# MySQL dump DROP TABLE IF EXISTS wx_categories' at line 1. Query: # MySQL dump DROP TABLE IF EXISTS wx_categories;

Thanks

Julius
Quote Reply
Re: [julius2007] Mysql Error restoring Wordpress In reply to
Hi,

Can you paste the top of the backup file you made? Looks like there are some weird characters in it.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mysql Error restoring Wordpress In reply to
Hi,

1) I made a backup on the server)

Code:
# MySQL dump
# Generated by MySQLMan 1.09 (http://gossamer-threads.com/scripts/)
# Host: localhost Database: rester_wordpress
#--------------------------------------------------------
#
# Table structure for table 'wx_categories'
#
DROP TABLE IF EXISTS wx_categories;
CREATE TABLE wx_categories (
cat_ID bigint(20) DEFAULT '' NOT NULL auto_increment,
cat_name varchar(55) DEFAULT '' NOT NULL ,
category_nicename varchar(200) DEFAULT '' NOT NULL ,
category_description longtext DEFAULT '' NOT NULL ,
category_parent bigint(20) DEFAULT '0' NOT NULL ,
category_count bigint(20) DEFAULT '0' NOT NULL ,
link_count bigint(20) DEFAULT '0' NOT NULL ,
posts_private tinyint(1) DEFAULT '0' NOT NULL ,
links_private tinyint(1) DEFAULT '0' NOT NULL ,
PRIMARY KEY (cat_ID),
KEY category_nicename (category_nicename)
);
#
# Dumping data for table 'wx_categories'
#
INSERT INTO wx_categories VALUES('1','Varie','varie','varie','0','1750','0','0','0');
INSERT INTO wx_categories VALUES('2','Links','links','','0','0','0','0','0');

2) I downloaded it to my pc
3) I replaced all
Code:
DEFAULT ''

with nothing

4) I Uploaded the modified file

Code:
# Generated by MySQLMan 1.09 (http://gossamer-threads.com/scripts/)
# Host: localhost Database: rester_wordpress
#--------------------------------------------------------
#
# Table structure for table 'wx_categories'
#
DROP TABLE IF EXISTS wx_categories;
CREATE TABLE wx_categories (
cat_ID bigint(20) NOT NULL auto_increment,
cat_name varchar(55) NOT NULL ,
category_nicename varchar(200) NOT NULL ,
category_description longtext NOT NULL ,
category_parent bigint(20) DEFAULT '0' NOT NULL ,
category_count bigint(20) DEFAULT '0' NOT NULL ,
link_count bigint(20) DEFAULT '0' NOT NULL ,
posts_private tinyint(1) DEFAULT '0' NOT NULL ,
links_private tinyint(1) DEFAULT '0' NOT NULL ,
PRIMARY KEY (cat_ID),
KEY category_nicename (category_nicename)
);
#
# Dumping data for table 'wx_categories'
#
INSERT INTO wx_categories VALUES('1','Varie','varie','varie','0','1750','0','0','0');
INSERT INTO wx_categories VALUES('2','Links','links','','0','0','0','0','0');
and it gave me the error.
Quote Reply
Re: [julius2007] Mysql Error restoring Wordpress In reply to
Hi,

Does it make a difference if you remove all the commented bits? i.e

# MySQL dump
# Generated by MySQLMan 1.09 (http://gossamer-threads.com/scripts/)
# Host: localhost Database: rester_wordpress
#--------------------------------------------------------
#
# Table structure for table 'wx_categories'
#

..etc

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Mysql Error restoring Wordpress In reply to
Hi Andy,

It always gave those strange characters on the first line, doesn't matter what line it is.

Testing many times I understood that happens if I save the file in UTF-8.
If I save the file in ANSI the restore goes fine.

Why this?

Thanks.