Jump to content


Photo

MYSQL Error Help (Newbie)


  • Please log in to reply
4 replies to this topic

#1 kreek

kreek
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 September 2006 - 03:18 AM

I exported a database but when I imported it it gave me an error message such as "Database already exists" so I edited the file manually and erased the part CREATE DATABASE kreek_db something like that and now I have errors and I can't undo it the error is:

SQL query:

-- phpMyAdmin SQL Dump
-- version 2.8.0-rc1
-- http://www.phpmyadmin.net
--
-- Host: sql2.pandela.com
-- Generation Time: Sep 22, 2006 at 02:06 AM
-- Server version: 4.1.18
-- PHP Version: 5.1.2
--
SQL query:

-- phpMyAdmin SQL Dump
-- version 2.8.0-rc1
-- http://www.phpmyadmin.net
--
-- Host: sql2.pandela.com
-- Generation Time: Sep 22, 2006 at 02:06 AM
-- Server version: 4.1.18
-- PHP Version: 5.1.2
--
CREATE DATABASE `kreek_db` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;



MySQL said: 

#1064 - 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 '
CREATE DATABASE `kreek_db` DEFAULT CHARACTER SET latin1 COLLATE latin1_swed' at line 1

MySQL said: 

#1064 - 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 '
CREATE DATABASE `kreek_db` DEFAULT CHARACTER SET latin1 COLLATE latin1_swed' at line 1

#2 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 22 September 2006 - 05:51 AM

You said that you erase "CREATE DATABASE ...", but the error mentions that line.  Are you sure you erased it?

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 22 September 2006 - 10:02 AM

You can also add the "IF NOT EXISTS".
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 kreek

kreek
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 September 2006 - 11:15 PM

Than I added it again. But I know I screwed up somewhere because when I first erased it I didn't undo it than later I pasted the create part from another database and edited it. I don't know nothing about mysql and now I can't even get this data back on the database.

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 25 September 2006 - 03:12 AM

Huh?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users