1

I follow this guide to export column

http://stackoverflow.com/questions/4486743/how-do-i-export-particular-column-in-mysql-using-phpmyadmin

my Sql table is : ID , Name , description , url ,tag ,category_id .......................

So i want to export column name and to translate all names to different language the problem is How to import column name back to same table but with changes ? for examp :

Id =1 name = hello    after import -> Id =1 name = Здравей
Id =2 name = Bye      after import -> Id =2 name = чао

that i want to happen after the import .

2 Answers 2

2

One way to do is create a temp table, import your modified info to it and update the first table joining the two. later on, delete the temp table.

Do something like this:

  • Create a query to display only id and name fields from table1.
  • Export the results to a sql file.
  • Translate the names into Russian and save the file.
  • Create a new table (like tmpTable) with two fields named the same as the ones you exported.
  • Import the sql file into newly created tmpTable.
  • Build the INSERT query joining the two tables,like:

UPDATE table1 JOIN tempTable ON table1.id = tempTable.id SET table1.name = tempTable.name

Sign up to request clarification or add additional context in comments.

3 Comments

ok but i dont see in to the import menu how can i navigate to import my file to table_x where is column name if i understand you right
Were you able to export the columns you wanted to translate?
Create the appropiate query in phpMyAdmin, like SELECT id, name FROM table1. In the result page, go down and select export
1

You can use LOAD DATA INFILE to bulk load the 800,000 rows of data into a temporary table, then use multiple-table UPDATE syntax to join your existing table to the temporary table and update the quantity values.

For example:

CREATE TEMPORARY TABLE your_temp_table LIKE your_table;

LOAD DATA INFILE '/tmp/your_file.csv'
INTO TABLE your_temp_table
FIELDS TERMINATED BY ','
(id, product, sku, department, quantity); 

UPDATE your_table
INNER JOIN your_temp_table on your_temp_table.id = your_table.id
SET your_table.quantity = your_temp_table.quantity;

DROP TEMPORARY TABLE your_temp_table;

https://stackoverflow.com/a/10253773/4238757

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.