Import multiple large sql dump mysql - mysql

I want to import several .sql files into database using source command (mysql command line). But when I get this error:
source E:\Progs\Backups\DBs\file01.sql
ERROR:
Unknown command '\P'.
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 'sourc
e E:\Progs' at line 1
....
I used source command to import large files hundreds times but now I can not understand what I'm doing wrong. This is my system(I'm using XAMPP (Basis Package) version 1.7.3 :
Windows 7x64
MySQL 5.1.41 (Community Server) with PBXT engine 1.0.09-rc
Any help would be appreciated.
Thanks!
Edit:
I tried this one, but same error:
source 'E:\Progs\Backups\DBs\file01.sql'

MySQL sees the \P in E:\Progs as a command. Because that command does not exist, it complains.
Forward slashes are understood in many cases. Try:
source E:/Progs/Backups/DBs/file01.sql

Related

Error code: 1064 in MySQL when create SOURCE?

I want to use my SQL'book_data2' file from the desktop E drive as a 'SOURCE'. But I am getting an error code 1064 in MySQL workbench. Could you help me for that issue? I am giving the code and action output below.
Code:
SOURCE E:\DataPractice\Practice\book_data2.sql;
Action Output:
Error Code: 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 'SOURCE E:\DataPractice\Practice\book_data2.sql' at
line 1 0.000 sec
There are a number of commands that are supported by the mysql client (that is, the command-line client, not MySQL Workbench), but they are parsed in the client, not sent to the server as SQL statements. The MySQL Server does not recognize these commands.
It can be confusing, but remember both the client and the server may process commands. You just have to read the documentation to learn which commands are in the list of client-only commands:
https://dev.mysql.com/doc/refman/8.0/en/mysql-commands.html
(Except USE, which is recognized by both mysql client and server, just to make sure there's an exception to every rule!)
If you want to use MySQL Workbench to "source" an SQL file, in other words load a file, read the SQL commands in that file, and execute them, Workbench does support this action, but they call it Data Import/Restore. It's documented here: https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-management.html

Unable to import tables from MySQL

I need to import few tables from MySQL to MSSQL. Below are the steps I followed in SSIS
1). Open the SQL Server Import/Export Wizard.
2). Source connections defined as per the MySQL ODBC Connector.
3). Destination defined as per MSSQL SQL authentication.
now when i try to run the package, i get the following error
"you have an error in your sql syntax; check the manual that corresponds right syntax"
On digging deep into the issue, i found that it is trying to fetch items using a query
Select * from "table"
How do i avoid double quotes? I know it is something to do with ANSI_QUOTES, but how do I set ANSI_QUOTES property
In the file ProgramData\MySQL\MySQL Server 5.6\my.ini edit the "sql-mode" property.
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,ANSI_QUOTES"
^

#1064 error in importing database php mysql localhost

I have backup of my live site's database. I want to run it on localhost. I tried to import the back up database that I craeted in phpmyadmin/localhost. But I am getting error something like this:
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 '
"http://www.w' at line 1
Can Any one help me....
This doesn't look like an SQL file, but as Krister Andersson suggested, you should post a few lines so we can see exactly what you are dealing with. How did you create the backup? What file type does it claim to be (is there an extension on the file)?

Getting Error 1064 when trying to import db file

ERROR 1064 (42000) at line 33892 in file: 'contarproducts.sql': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''\r\n \r\n
How can I resolve this issue?
Your help will be much appreciated.
1) You have this tagged as MySQL but then you seem to be running MariaDB, those aren't the same thing.
2) If there's an error in your SQL (which is what this is saying) and this SQL file was exported from the database it seems as though copying or moving the file cut it off and it didn't finish copying. If the file doesn't get fully copied and the end of the file looks like SELECT * FRO then that will be a syntax error.
Try re-exporting the file before importing it again.

importing .sql3 and csv file into mysql workbench

This is may be foolish question. But i cant find the answer of this problem anywhere.
i have a .sql3 and a .csv file i want do import functionality in my mysql workbench using any of these file.
right now i dont have any tables and shemas in my mysql
when i am importing my demo.csv or demo.sql3 files in my workbench its showing an error like
ERROR 1064 (42000) at line 1: 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 'SQLite format 3' at line 1
I am on ubuntu
can anyone help me out from this problem
thanks in advance
For reading csv data into MySQL LOAD DATA is probably the best way to go. There's a plugin in MySQL WOrkbench for importing CSV data but it requires an existing result set.