SSH import mysql database


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SSH import mysql database
# 1  
Old 07-12-2012
SSH import mysql database

Hi all,

I am trying to import a database in putty with the syntax:
Code:
mysql –u database_username –p database_name < filename.mysql

As you can see in the screenshot it asks me for the database password - which suggests that the syntax is correct - but then after I enter the password it gives the syntax error message =
Code:
ERROR 1064 (42000): 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 line 1.

I can't see what is wrong with the syntax - any suggestions please?


Thank you

Moderator's Comments:
Mod Comment Please view this code tag video for how to use code tags when posting code and data.
SSH import mysql database-import-errorjpg

Last edited by Juc1; 07-12-2012 at 12:16 PM..
# 2  
Old 07-12-2012
It is complaining about the content of filename.mysql

We would have to see that file in order to help
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 07-12-2012
Quote:
Originally Posted by jim mcnamara
It is complaining about the content of filename.mysql

We would have to see that file in order to help
@ Jim - thanks for your help. Having looked at the mysql file I can see it is corrupt. The error message about syntax confused me - a more accurate and helpful error message might have directed me (as you did) to the mysql file.

Thanks Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Using bash script : How to Import data from a dsv file into multiple tables in mysql

HI I have a dsv file that looks like: <<BOF>> record_number|id_number|first name|last name|msisdn|network|points|card number|gender 312|9101011234011|Test Junior|Smith|071 123 4321|MTN|73|1241551413214444|M 313|9012023213011|Bob|Smith|27743334321|Vodacom|3|1231233232323244|M... (4 Replies)
Discussion started by: tera
4 Replies

2. Shell Programming and Scripting

Data to import the database as snippets

Hi all, I don't know if this the right place to post my question to get some ideas on how to done this. I have a text files extracted from OCR that need to have snippets to be import to database as snippet table which have columns "snippet, date, title" I dont know if shell scripts can do it... (11 Replies)
Discussion started by: lxdorney
11 Replies

3. Shell Programming and Scripting

How to backup a particular Database in MYSQL?

Hi All, Thanks in Advance!! How to backup a particular Databases..through Bash script!! For example i have 6 databases; Anish linux Software Questions Rhce Google these are the databases i have from that i want to take "Anish" and "questions" database backup regularly.... (4 Replies)
Discussion started by: anishkumarv
4 Replies

4. UNIX for Dummies Questions & Answers

Import dump to database

Hi... I have dump in unix machine...How can I this import dump to Oracle database? Many thanks in advance. (2 Replies)
Discussion started by: agarwal
2 Replies

5. Shell Programming and Scripting

Mysql import problem

Dear folks, i am importing a database since yesterday that is innodb tablespace, the space of dump file is 4GB, almost 24 pass out it is not yet complete. What should i do to import it fastly. I have disable foreign key check because it have some issues so thats why i am importing it with source... (2 Replies)
Discussion started by: learnbash
2 Replies

6. UNIX for Dummies Questions & Answers

Connect MySQL database from Unix

How to connect a MySQL database from unix using unix shell scripting ( people are using perl scrpt to connect the same database). I want to access a MySQL database through a shell script (4 Replies)
Discussion started by: apsprabhu
4 Replies

7. Shell Programming and Scripting

Loading values into a MYSQL database

Where to start? Ok, I need to pick up a Worldpay exchange rates file from a url such as: https://select.worldpay.com/wcc/info?op=rates&instId=12345&op=rates-today the http response returns a exchange rates file with content-type "text/plain" content as below: #Exchange rates for... (2 Replies)
Discussion started by: kshelluser
2 Replies
Login or Register to Ask a Question