2

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

1
  • 1
    Google "mysql no database selected" of course. Commented Feb 7, 2014 at 12:55

2 Answers 2

7

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;

Select the default target schema

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.

Sign up to request clarification or add additional context in comments.

3 Comments

@Pink000 Open up the dump file and append those lines at first. Or if you are using MySQL Workbencg you can create a database and then select it in the default target schema (as shown above in the picture). that would be easier for you.
THanks! i did it, but i have a question. Why is it happening only to me, when my classmates just do the same and not encounter any error? Have I missed something?
@Pink000 See the updated answer, Your friend might have created a new database to import the dump file or would have used a existing database to import the dump file. No Biggie. [Do mark the solution as answer if it has served your purpose for others to benefit]
1

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;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.