473,765 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with command: mysql -u root -p < localhost.sql

113 New Member
Hi,

I'm trying to import a mysqldump of all the databases from one server to another. First I attempted to use phpMyAdmin, I exported using the export to file option (drop database and drop tables selected) and then tryed to paste the resulting file (8mb into the text input field) not the brightest of moves i admit. That failing I then tryed this command from the command console (windows server 2003):

Expand|Select|Wrap|Line Numbers
  1. C:\mysql\binmysql -u root -p < localhost.sql
Having placed the localhost.sql (sql dump file) in the c:/mysql/bin directory.

This is the error that is output:

Expand|Select|Wrap|Line Numbers
  1. C:\mysql\bin>mysql -u root -p < localhost.sql
  2. Enter password: ********
  3. ERROR 1064 at line 21: You have an error in your SQL syntax.  Check the manual t
  4. hat corresponds to your MySQL server version for the right syntax to use near 'E
  5. NGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 AUTO_INCR
  6.  
and this is the relevant sql from the dump:

Expand|Select|Wrap|Line Numbers
  1. CREATE DATABASE `adam_db`;
  2. USE adam_db;
  3.  
  4. # --------------------------------------------------------
  5.  
  6. #
  7. # Table structure for table `about`
  8. #
  9.  
  10. CREATE TABLE `about` (
  11.   `about_id` mediumint(9) NOT NULL auto_increment,
  12.   `text` text NOT NULL,
  13.   UNIQUE KEY `about_id` (`about_id`)
  14. ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  15.  
Does anyone know where I am going wrong?

I am using MySQL version 4.0.12-nt, phpMyAdmin 2.5.3-rc1 and PHP 5.1.2.

Thanks!

Chromis
Jun 18 '08 #1
1 4517
chromis
113 New Member
Ok found the problem, the version of the database I was trying to copy in was slightly newer.

Thanks anyway,

Chromis
Jun 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
3924
by: | last post by:
I issued the mysql command Grant all on *.* to myid@localhost identified as "mypw"; and recieved the error message ERROR 1045: Access denied for user" '@localhost' (Using password: NO) I am running mysql on my own machine which is not networked.
0
1772
by: Nick Keeling | last post by:
--=_48167406.4627091C Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I am a MySQL newbie with a post installation problem. I have Linux Red Hat 9 with MySQL 4.0. After installing MySQL, I can not for the life of me get the mysql daemon to run. My installation directory is /usr/local/mysql but it wants to open a database from /var/lib/mysql. Obviously something is not set right. Any help would be greatly...
14
2208
by: Jim Sabatke | last post by:
When I installed MySQL (SuSE 9.0) and first started it, it told me that I needed to set a password for machine.domain.name. I tried following the directions, but it would only setup a password for "localhost". Is this normal? I am having problems with software connecting to the database. -- Jim Sabatke
0
2945
by: Steve | last post by:
Hi, Yesterday I signed up for another dedicated linux server with the hosting company I use and I am having problems getting MySQL 4.1.3 working on it. I've tried just about everything I can think of to login via the MySQL client but get a variation of the following error every time: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
6
14596
by: Paul Deverson | last post by:
I'm a newbie to MySQL and am really confused about when I should be using the Command Line Client and when the DOS prompt. I'm using Windows XP and I've just installed MySQL 4.1.10. I can use the Command Line Client to logon as 'root'. It prompts me for a password and then I can create databases, etc. from the mysql prompt. However, if I wanted to logon as a different user, I'm not sure how to do it.
5
4313
by: MLH | last post by:
I'm supposed to set a password for the MySQL root user. The output of mysql_install_db instructed me to run the following commands... /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd I did. It did not work. Here's the error: /usr/bin/mysqladmin: connect to server at 'appserver' failed error: 'Host 'appserver.crci.com' is not allowed to connect to this MySQL server' Another command I'm supposed to run also resulted in an...
5
4571
by: news.telia.net | last post by:
Hi! I have a question. I have installed php and mysql on an apache-server on windows and I can't connect to the server. I tried to create a database (since I am trying to learn howto). My manual said I should write this at the shell: c:\mysql\bin>mysqladmin -u root creare mindb I did this and got this error:
2
3100
by: dev2746 | last post by:
Hi :-)..............., I am having a problem with mysqldump with mysql 5.0.27 installed on a win xp pro sp2. I just want to do a simple backup of all my databases. I have xp installed in the D drive and the mysql datafiles in a folder "MySQL Datafiles" in the F drive. This is my problem: I go to this location "D:\Program Files\MySQL\MySQL Server 5.0\bin" from the command prompt and type:
2
3058
by: Taras_96 | last post by:
Hi everyone, I'm trying to run a number of commands stored within a sql file from within php using mysqli::query. The syntax I'm using is: source C:\data\projects\forum s\src/../tests_common/tableSnapshots/1_users.sql The command works fine from the mysql command line client, but when I try to run this with the mysqli query function, I get the following
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.