I have a sql file generated by “mysqldump –all-databases” . There are many databases in it. What I want to do is to update my local database but only a specific one, not all. I tried to use “mysql -database=db_name < file.sql” but it updated all databases. Is there a way to skip all databases except the one that I want.
I have a sql file generated by mysqldump –all-databases . There are many databases
Share
You can try doing:
This will only execute the
SQLcommands for the specified database and will skip the commands for all other databases. The-o(“one database”) option is critical to this working as expected (it tellsmysqlto ignore statements related to other databases).dump.sqlis the result of executingmysqldump --all-databases