Tuesday, January 25, 2022

[FIXED] How to add a specific database from mysqldump

Issue

I need to copy specific record from 1 database. The problem is that i can't find the way to insert only one database from mysqldump file.

  1. File is too big to even try open it in txt editor.

  2. File is too big to upload it in phpmyadmin

    I aslo could't find how to do it in mysql console (only how to add 1 database from database.sql file, but in current case i am using mysqldump, so that won't work).

I am using wamp on localhost.

Any ideas?


Solution

You can use,

mysql -u username -p -D reqd_database --one-database < database.sql

This will source only the SQL queries that apply to the chosen database.



Answered By - franklinsijo

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.