Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 31st July 2006, 10:06
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,266
Thanks: 82
Thanked 24 Times in 20 Posts
Default problems importing a database into mysql

Quote:
h898552:/var/www# mysql -h localhost -u root -p****** web3_db1 < web3_db1.sql
ERROR 1064 at line 12: 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 'NOT NULL,
PRIMARY KEY (id),
KEY ip (ip(15))
) TYPE=MyISAM'
h898552:/var/www#
trying to export a db from one server and import on another. both servers are debian 3.1 and running MySQL version 4.0.24
Reply With Quote
Sponsored Links
  #2  
Old 31st July 2006, 10:21
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

Could you show this last block from the dump (the last line ending with "NOT NULL")?
Reply With Quote
  #3  
Old 31st July 2006, 10:24
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,266
Thanks: 82
Thanked 24 Times in 20 Posts
Default

here is the sql dump right from the start:

I just realized this part only concerns one plugin, which I could easily take out from my dump, I will try without that part.

Quote:
-- MySQL dump 9.11
--
-- Host: localhost Database: web3_db1
-- ------------------------------------------------------
-- Server version 4.0.24_Debian-10sarge2-log

--
-- Table structure for table `bad_behavior`
--

DROP TABLE IF EXISTS bad_behavior;
CREATE TABLE bad_behavior (
id int(11) NOT NULL auto_increment,
ip text NOT NULL,
date datetime NOT NULL default '0000-00-00 00:00:00',
request_method text NOT NULL,
request_uri text NOT NULL,
server_protocol text NOT NULL,
http_headers text NOT NULL,
request_entity text NOT NULL,
key text NOT NULL,
PRIMARY KEY (id),
KEY ip (ip(15))
) TYPE=MyISAM;

--
Reply With Quote
  #4  
Old 31st July 2006, 10:37
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

the old problem, when using reserved words in column names, and thei are not wrapped ind ` (backtick) as the normal mySQL Syntax is.... good example for that when germans design their tables is "alter"...

So just change
Quote:
key text NOT NULL
to

Quote:
`key` text NOT NULL
Reply With Quote
  #5  
Old 31st July 2006, 10:43
Ovidiu Ovidiu is offline
Senior Member
 
Join Date: Sep 2005
Posts: 1,266
Thanks: 82
Thanked 24 Times in 20 Posts
 
Default

thx for analyzing the problem, I have no clue about mysql, this whole structure is wordpress (a plugin for it created that problem :-)

I seem to have succeeded by deleting that old plugin and its tables and all of its data that it created inside the DB.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 17:58
Having Problems loging into Mysql Database Ubuntu 6.06 Perfect Setup badgerbox76 Installation/Configuration 2 21st June 2006 23:00
Mysql password problems lerra Installation/Configuration 25 24th February 2006 12:33
Cant connect to MYSQL database from Dreamweaver toyito Installation/Configuration 5 1st February 2006 16:52
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 16:04


All times are GMT +2. The time now is 06:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.