mysqlmysql-error-1046

Importing using MySQL WorkBench... error ERROR 1046 (3D000)


Scenario: building a RoR enviroment locally for development. Production is on EngineYard / GitHub. All now working ok, except DB isn't importing.

I have a .sql file that i've taken from my prod EY site. Now i need to import it to my MySQL locally. I'm using Workbench (as i'm new to this), but getting error below.

Please help?

08:07:43 Restoring /home/james/Downloads/Futology.sql Running: mysql --defaults-extra-file="/tmp/tmpAVeE58/extraparams.cnf" --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments < "/home/james/Downloads/Futology.sql" ERROR 1046 (3D000) at line 22: No database selected

Operation failed with exitcode 1 08:07:43 Import of /home/james/Downloads/Futology.sql has finished with 1 errors


Solution

  • Not used Workbench too much however it's easy enough to do from command line have a look at this (below phpMyAdmin instructions)

    The command you're after is: mysql -u #username# -p #database# < #dump_file#