Posts

Showing posts from June, 2022

Export Large CSV file into Mysql database

-- To export large CSV file into MySQL database, first you need to create that table (empty). -- Remove (comment) "strict_trans_tables" sql_mode from your mysql configuration (my.cnf in linux and      my.ini in windows). --  Run MySQL command line client from the start menu. --  The console will open, provide MySQL password. --  select your database          use <name_of_your_database>; --  Execute below command:           LOAD DATA INFILE 'D:\\Data.csv' IGNORE INTO TABLE your_table_name fields terminated                     BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'  LINES TERMINATED BY '\r\n'; --  IGNORE keyword in above statement will ignore the errors and rows in csv that have errors and            export remaining rows in table. -- If your csv don't have any errors and mis...

MySQL load large sql file And Export large table into CSV

 To load a large SQL file into the database (or as database). -- In Windows Run MySQL command line client from the start menu: -- console will open, provide MySQL password -- select your database use <name_of_your_database>; -- run below command provide your SQL file path source <path_of_your_.sql> For example: source F:\iConsult Work\Tipp - Trade Information Portal\3years_TradeStat_FullData.sql -- In linux upload that SQL file in public_html from cpanel, then copy the path of that file from cron job -- go/run terminal from cpanel, then connect the database with 'mysql -u user_name -p' command. -- then select your database with 'use your_database' command -- and then execute the below command after changing the path after source keyword. For example: source /home/dhalabga/public_html/tiger_data_backup_tiger_force_backup.sql To export / load large table data into file(csv) -- This will export large table data into CSV, but before this, you have to set secure_...