Reputation: 111
I was trying to import it but i am encountering some errors.
this is my error:
08:49:13 PM Restoring dbDB (contact) Running: mysql --defaults-extra-file="/tmp/tmpdwf14l/extraparams.cnf" --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 --comments ERROR 1046 (3D000) at line 22: No database selected
Operation failed with exitcode 1 08:49:13 PM Restoring dbDBB (course) Running: mysql --defaults-extra-file="/tmp/tmpMW20Fb/extraparams.cnf" --host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 ERROR 1046 (3D000) at line 22: No database selected
Upvotes: 2
Views: 31902
Reputation: 1786
Error:
You have not selected the default target schema in which to import the data from dump
Create a schema/database in MySQL and select that database in MySQL Workbench while importing data from Dump.
Or
You can edit the dump file and append a SQL statement at the start with some thing like this
create database test;
use test;
Solution as per the dump file of user:
--
-- Table structure for table `course`
--
Write the code as :
create database test1;
use test1;
--
-- Table structure for table `course`
--
This should do.
Upvotes: 7
Reputation: 722
The error is because you havent selected any database; In the dump right below create schema 'database_name'
(or create database 'database_name') add this : use 'database_name';
Replace the database_name with your DB name;
Upvotes: 1