I am using : WampServer 2.2, Apache Version :2.2.21, PHP Version : 5.3.8, MySQL Version :5.5.16, PhpMyadmin Version: 3.4.5...
I have face Problem Of Importing CSV file-(size 13MB*), Error File is Too large... phpMyadmin allow only 2MB file size ...
So Separate files with 1.83MB file size...then also it does not work ???
And also tell me , How to automatic create table through CSV file ...?
In the Format list, select CSV. Changing format-specific options. If the csv file is delimited by a character other than a comma or if there are other specifications to the csv files, we can change it in this portion. Click Go to start importing the csv file and the data will be successfully imported into MySQL.
If you want to create a new database for the SQL file, you can do it with the following command: mysql> CREATE DATABASE DatabaseName; To create a MySQL user and assign a new password to it, run the following command: mysql> CREATE USER 'DatabaseUser'@'localhost' IDENTIFIED BY 'password';
Why dont you try to import file using MySQL Console?
I think, you will not face any problem this way. You will not need to split the file into chunks. Just take care of syntax.
load data infile 'c:/filename.csv' into table tablename fields terminated by ',';
For details about syntax, refer Load Data Infile on official documentation.
For example, refer this and this.
Hope it helps!!!
LOAD DATA INFILE 'your.csv'
INTO TABLE android_dev
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;
include the csv file in your database folder,i.e., <root>\mysql\data\DATABASE_NAME
I'd suggest you look at Data Transformer (disclaimer - I'm its developer). It can convert CSV/JSON/XML to SQL. The generated SQL contains "insert" statements for each line and a "create table" statement.
The app works offline and your data never leaves your computer.
You can get it from the Mac App Store or the Microsoft Store.
How to automatic create table through CSV file ...?
I wrote a csv2mysql command. It scans the entier CSV file to determine appropriate column types and outputs a CREATE TABLE statement and (optionally) INSERT INTO statements for the data.
It's at
https://github.com/artfulrobot/csv2mysql
(you can just download the bin/csv2mysql
executable (Linux) or you can run the main csv2mysql.php file if you download the source and run composer install
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With