Error 1046 3d000 No Database Selected Import
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies error 1046 3d000 at line 22 no database selected of this site About Us Learn more about Stack Overflow the company error 1046 3d000 at line 1 no database selected Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges error 1046 3d000 mysql Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: no database selected mysql workbench Sign up mySQL Workbench Importing up vote 1 down vote favorite 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"
Mysql Workbench Import Operation Failed With Exit Code 1
--host=127.0.0.1 --user=root --port=3306 --default-character-set=utf8 ERROR 1046 (3D000) at line 22: No database selected mysql-workbench share|improve this question edited Jun 11 '14 at 15:40 kmas 4,822102747 asked Feb 7 '14 at 12:52 harraypotter 46127 1 Google "mysql no database selected" of course. –Gimby Feb 7 '14 at 12:55 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted 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. share|improve this answer edited Feb 7 '14 at 13:12 answered Feb 7 '14 at 13:02 Punter015 75639 where should I put the code
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers
Mysql Workbench Import From Dump Project Folder No Database Selected
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x no database selected mysql command line Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it how to import sql file in mysql workbench only takes a minute: Sign up Error 1046 No database Selected, how to resolve? up vote 136 down vote favorite 22 Error SQL query: -- -- Database: `work` -- -- -------------------------------------------------------- -- -- Table structure for table `administrators` -- CREATE http://stackoverflow.com/questions/21628318/mysql-workbench-importing TABLE IF NOT EXISTS `administrators` ( `user_id` varchar( 30 ) NOT NULL , `password` varchar( 30 ) NOT NULL ) ENGINE = InnoDB DEFAULT CHARSET = latin1; MySQL said: #1046 - No database selected need some help here. sql mysql mysql-error-1046 share|improve this question edited Oct 23 '10 at 18:21 OMG Ponies 198k36356415 asked Oct 23 '10 at 18:19 steph 687253 5 In case anyone is interested, you can also specify the database name via the CLI command without editing http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve the import file. mysql -u root -p databasename < import.sql –Sam Dufel Nov 24 '14 at 15:36 what happened to me was: create a schema, filled in the name of the database, then it says "fail, no database selected". reopen workbench, i see database that i have just failed to created. Then I choose the database that i have just created, and open a .sql file and run, with both create database and use database statements, it complains "fail no database selected" again. reopen workbench, the tables are all built. MAC system, workbench 6.3.3 –Tiina Jun 9 at 9:12 add a comment| 13 Answers 13 active oldest votes up vote 212 down vote You need to tell MySQL which database to use: USE database_name; before you create a table. In case the database does not exist, you need to create it as: CREATE DATABASE database_name; followed by: USE database_name; share|improve this answer edited Feb 24 '13 at 0:02 Piero 2,881946102 answered Oct 23 '10 at 18:21 codaddict 251k50362442 2 In my case, I had used mysqldump to export a database and was running into this upon import. I just had to edit the exported sql file to add these two commands to the top of it. –bh5k Oct 11 '12 at 17:01 Thanks! This is what I needed. I had a script to create my database and tables but the tables weren't getting crea
Community Podcasts MySQL.com Downloads Documentation Section Menu: MySQL Forums :: MySQL Workbench :: importing table dump from another machine New Topic Advanced Search Re: importing table dump from another machine Posted by: Monte Milanuk () Date: November 16, 2010 02:18PM Hello Mike, Where http://forums.mysql.com/read.php?152,394747,394850 I seem to be running aground is when I'm in that 'Import From Disk' dialog https://bytes.com/topic/mysql/answers/841578-importing-database and I select the sql file (just for this example lets say I'm using the world.sql file for the sample db 'world') and click 'Start Import'... WB responds: "ERROR 1046 (3D000) at line 22: No database selected" Fine. So I open the script in a text editor and add "USE world;" to the beginning and run it again: "ERROR 1049 (42000) no database at line 7: Unknown database 'world'" Prior to this I (re)read the 'Getting Started' tutorial in the MySQL Workbench manual, and worked through the examples described therein with no issues***. I went back, created a new EER model, named the schema 'world', set up the db connection, went through the 'forward engineer' business with no error messages, etc. and though I was good to go. Now things get more interesting... it appears that somewhere along the no database selected way I managed to get WB to use the right db. I was trying different things in the Database->Query, Database->Forward Engineer menus, but I can't say which thing it was that did it :( The good news is,now it doesn't return any errors when I try to import the sql file: "12:02:41 Import of E:\Documents\Computers\sample SQL databases\world-db\world.sql has finished" But still nothing shows up under the EER model 'world' - no tables, nothing. I double checked from the mysql console and that db *is* there, tables and all. I really like the overall look and feel of Workbench, but so far I'm more frustrated with it than I can put into words. How did: mysql -u root -p CREATE DATABASE world; USE world; SOURCE world.sql; get to be such an ordeal? ***No issues other than the EER diagram was borderline useless because of black headers on all the table objects render them completely unreadable. Navigate:Previous Message•Next Message Options:Reply•Quote Subject Views Written By Posted importing table dump from another machine 1845 Monte Milanuk 11/15/2010 11:47PM Re: importing table dump from another machine 833 Mike Lischke 11/16/2010 02:29AM Re: importing table dump from another machine 3243 Monte Milanuk 11/16/2010 02:18PM Re: importing table dump from another machine 1063 Mike Lischke 11/18/2010 03:01AM Sorry, you can't reply to this topic. It has been closed. powered by phorum Content
and get tips & solutions from a community of 418,502 IT Pros & Developers. It's quick & easy. Importing a database P: 61 Alien I just managed to use mysqldump to dump a database into a text file. Now I uploaded it into my server where i want to import it. I tried looking up in google and came up with this command: mysql -p --user=web16u1 < workready.txt where web16u1 is my databse username and workready.txt is the file that contains all the CREATE TABLE stuff as output of mysqldump command. I got the following error: -bash-3.2$ mysql -p --user=web16u1 < workready.txt Enter password: ERROR 1046 (3D000) at line 22: No database selected I can easily see the problem but how do I modify the command to make it include the database name? Sep 28 '08 #1 Post Reply Share this Question 2 Replies 100+ P: 310 coolsti I just managed to use mysqldump to dump a database into a text file. Now I uploaded it into my server where i want to import it. I tried looking up in google and came up with this command: where web16u1 is my databse username and workready.txt is the file that contains all the CREATE TABLE stuff as output of mysqldump command. I got the following error: I can easily see the problem but how do I modify the command to make it include the database name? You could do this two ways. One is just to add the database name to the command line mysql command: Expand|Select|Wrap|Line Numbers mysql-p--user=web16u1databasename