0

If I'm using phpmyadmin to manage mysql database, what settings should I use to export only two rows of data that I'll be importing to another table with the same name that contains many other rows?

I used the quick option, but I'm getting an error that table already exists and nothing gets imported.

If I use the default custom option with the default settings, I get the same error message.

So, what's the best settings to use to export settings that I'm going to import to another table?

4
  • are those tables in different databases? – nbk Jun 6 '20 at 22:42
  • these are wordpress databases in two different servers. I'm just trying to transfers settings for a plugin to the new database. thanks, – mhweb Jun 6 '20 at 22:44
  • I think I figured out, I ended up opening the .sql dump and I copied the INSERT INTO statement with the data. I pasted into the SQL tab of phpmyadmin, and I ran the query and the data imported successfully. Is this approach OK? – mhweb Jun 6 '20 at 22:59
  • yes i showed you as answer another posiibilities – nbk Jun 6 '20 at 23:04
1

You have two possibilities.

  1. use the export at the botton of the table, after selecting you data with the correct data

see phpmyadmin picture

  1. use SELECT INTO OUTfile

LIKE

SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt'
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
  FROM test_table WHERE n= 1;

Please check the limitations in the link for secure_file_priv

You can after import it via phpmyadmin or use LOAD DATA Statement

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.