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 13th February 2007, 17:27
latcarf latcarf is offline
Senior Member
 
Join Date: Jul 2005
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL Dumps

I followed the instuctions for dumping databases and then restoring them but I keep getting
Code:
mysql> gallery_db < /root/gallery_db.sql;
ERROR 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 'gallery_db < /root/gallery_db.sql' at line 1
mysql>
I can't help but think this is a setup issue since from Suse 10.1 to 10.2 it worked but now from Suse 10.1 to Debian Sarge it isn't working.

Am I overlooking something?
Reply With Quote
Sponsored Links
  #2  
Old 13th February 2007, 20:23
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

Yep, you're mixing shell and mysql commandlines.
For shell usage:
Code:
mysql -u user -p password gallery_db < /root/gallery_db.sql
For mysql usage:
Code:
# mysql
mysql> use gallery_db;
mysql> source /root/gallery_db.sql;
Reply With Quote
  #3  
Old 13th February 2007, 20:41
latcarf latcarf is offline
Senior Member
 
Join Date: Jul 2005
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for the help! I understand now... I did it from shell and got this error
Code:
server1:~# mysql -u root -psend4help911 gallery_db < /root/db_gallery.sql
ERROR 1064 at line 23: 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 'DEFAULT CHARSET=latin1 COMMENT='Used to store albums'' at line
server1:~#
I followed it to the file and the line but I have no idea what it is telling me is wrong. Since there were 60K plus characters I shortened it up to a couple lines below the line the error describes!
Code:
-- MySQL dump 10.10
--
-- Host: localhost    Database: db_gallery
-- ------------------------------------------------------
-- Server version	5.0.18

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `albums`
--

DROP TABLE IF EXISTS `albums`;
CREATE TABLE `albums` (
  `aid` int(11) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `description` text NOT NULL,
  `visibility` int(11) NOT NULL default '0',
  `uploads` enum('YES','NO') NOT NULL default 'NO',
  `comments` enum('YES','NO') NOT NULL default 'YES',
  `votes` enum('YES','NO') NOT NULL default 'YES',
  `pos` int(11) NOT NULL default '0',
  `category` int(11) NOT NULL default '0',
  `thumb` int(11) NOT NULL default '0',
  `keyword` varchar(50) default NULL,
  `alb_password` varchar(32) default NULL,
  `alb_password_hint` text,
  PRIMARY KEY  (`aid`),
  KEY `alb_category` (`category`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Used to store albums';

--
-- Dumping data for table `albums`
--
Reply With Quote
  #4  
Old 13th February 2007, 20:43
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

What's the output of
Code:
mysql -V
on the system you try to import the data on?
Reply With Quote
  #5  
Old 13th February 2007, 21:00
latcarf latcarf is offline
Senior Member
 
Join Date: Jul 2005
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ah ha!
Code:
server1:~# mysql -V
mysql  Ver 12.22 Distrib 4.0.24, for pc-linux-gnu (i386)
server1:~#
and the system the dump came off of
Code:
server1:~# mysql -V
mysql  Ver 14.12 Distrib 5.0.17, for suse-linux (i686) using readline 5.1
server1:~#
Can Debian use mysql5? and if so will
Code:
apt-get dist-upgrade mysql
work?
Reply With Quote
  #6  
Old 13th February 2007, 21:11
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

It's not that easy
To install MySQL 5 (and perhaps PHP5), you might want to have a look at http://www.debian-administration.org/articles/357. You need backports to get Sarge up to speed. Or wait for the soon to be ready next Debian release, or switch to Ubuntu.

As always: Linux offers a variety of choices.
Reply With Quote
  #7  
Old 13th February 2007, 21:35
latcarf latcarf is offline
Senior Member
 
Join Date: Jul 2005
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by martinfst
It's not that easy
To install MySQL 5 (and perhaps PHP5), you might want to have a look at http://www.debian-administration.org/articles/357. You need backports to get Sarge up to speed.
lol... it's never easy but I seem to be having a hard enough time already to be taking on another challenge!
Quote:
Originally Posted by martinfst
Or wait for the soon to be ready next Debian release, or switch to Ubuntu.

As always: Linux offers a variety of choices.
I could never get a bootable iso for Ubuntu. Every time I downloaded, burned, and booted, it would boot to DOS as
Code:
[CR DOS]A:
and while I could switch to the cd drive when I typed in "start" which seemed to be the executable for loading Ubuntu the screen would echo that the program could not be installed from DOS. I used the same box, burner, etc for Debian and Suse which both worked.

How does Ubuntu differ from Debian? I am still dependent on GUI and Debian is dependent on Gnome and having used KDE in Suse I prefer KDE.
Reply With Quote
  #8  
Old 13th February 2007, 21:47
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

Quote:
I could never get a bootable iso for Ubuntu. Every time I downloaded, burned, and booted, it would boot to DOS as
Code:

[CR DOS]A:

and while I could switch to the cd drive when I typed in "start" which seemed to be the executable for loading Ubuntu the screen would echo that the program could not be installed from DOS. I used the same box, burner, etc for Debian and Suse which both worked.
Did you download the images from the Ubuntu site? I never had any problems downloading / burning ISO images for Ubuntu.
Quote:
How does Ubuntu differ from Debian? I am still dependent on GUI and Debian is dependent on Gnome and having used KDE in Suse I prefer KDE.
A very bold statement would be: Ubuntu is one version ahead of Debian. It uses the testing branch of Debian and the add some specifics from there. If you are a KDE fan, there's Kunbutu http://www.kubuntu.org/index.php
Reply With Quote
  #9  
Old 14th February 2007, 03:27
latcarf latcarf is offline
Senior Member
 
Join Date: Jul 2005
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by martinfst
Did you download the images from the Ubuntu site? I never had any problems downloading / burning ISO images for Ubuntu.A very bold statement would be: Ubuntu is one version ahead of Debian. It uses the testing branch of Debian and the add some specifics from there. If you are a KDE fan, there's Kunbutu http://www.kubuntu.org/index.php
I downloaded the kubuntu image and the same thing happens... when I boot to it it goes into Caldera DOS. I can get to the cd drive and see the files but can't do anything from DOS with them.
Reply With Quote
  #10  
Old 14th February 2007, 08:20
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
 
Default

How did you burn the CD? You need to burn it as a bootable iso image. All burning sw (at least the ones I know) have special options to burn these type of iso images.
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
virtual mail boxes setup satimis Server Operation 3 25th January 2007 18:32
Messed up ISPConfig-2.2.8 Upgrade Morons Installation/Configuration 4 29th November 2006 12:17
MySQL Cluster On FC5 : error while unpacking from engine asyadiqin HOWTO-Related Questions 7 28th October 2006 17:37
I'm dying! m u r Installation/Configuration 41 17th September 2006 13:44
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 17:00.


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