Error 1046 3d000 At Line 22
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 of this site About Us Learn more about Stack error 1046 3d000 at line 1 no database selected Overflow the company Business Learn more about hiring developers or posting ads with us Stack mysql error 1046 3d000 no database selected Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community no database selected mysql workbench of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up mySQL Workbench Importing up vote 1 down vote favorite I was trying to import it but i mysql workbench import from dump project folder no database selected 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 mysql-workbench share|improve this question edited Jun 11 '14 at 15:40 kmas 4,822102747 asked Feb 7
No Database Selected Mysql Command Line
'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?? @Punter015 ? –harraypotter Feb 7 '14 at 13:06 @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. –Punter015 Feb
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
Mysql Workbench Import Dump
company Business Learn more about hiring developers or posting ads with us Stack Overflow error 1044 (42000): access denied for user Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 error 1049 (42000): unknown database million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error 1046 No database Selected, how to resolve? up vote 136 down vote favorite 22 Error SQL query: -- -- http://stackoverflow.com/questions/21628318/mysql-workbench-importing Database: `work` -- -- -------------------------------------------------------- -- -- Table structure for table `administrators` -- CREATE 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 http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve steph 687253 5 In case anyone is interested, you can also specify the database name via the CLI command without editing 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 e
Status: Closed Impact on me: None Category:MySQL Workbench: Administration Severity:S3 https://bugs.mysql.com/bug.php?id=75514 (Non-critical) Version:6.2.4.12437 build 2426 (64bits) OS:Microsoft Windows (7) Assigned to: https://www.daniweb.com/programming/databases/threads/317208/import-with-mysql-workbench-5-2-oss View Add Comment Files Developer Edit Submission View Progress Log Contributions [15 Jan 2015 12:20] Russ Brumbaugh Description: Reports ERROR 1046 (3D000) at line 22: No database selected How to repeat: Start Import again [15 Jan 2015 12:40] no database Miguel Solorzano Thank you for the bug report. Are you able to provide a dump file which fails with the reported error?. Thanks. [15 Jan 2015 12:51] Russ Brumbaugh This is one of 38 files that reported the error on importAttachment: lcso_knin_cord_fuse_casing.sql (application/octet-stream, text), 3.65 KiB.
[15 no database selected Jan 2015 17:37] Miguel Solorzano Thank you for the feedback. Failed with the reported error even when a schema was set as default schema. [16 May 2015 1:52] Philip Olson Posted by developer: Fixed as of the upcoming MySQL Workbench 6.3.4 release, and here's the changelog entry: After completing a successful "Import from Dump Project Folder" operation, clicking "Import again" would fail with ERROR 1046. Thank you for the bug report. Legal Policies Your Privacy Rights Terms of Use Contact Us Portions of this website are copyright © 2001, 2002 The PHP Group Page generated in 0.044 sec. using MySQL 5.7.12-enterprise-commercial-advanced-log Content reproduced on this site is the property of the respective copyright holders.It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party. © 2016, Oracle Corporation and/or its affiliatesKb, date 22-2-2010, time 18:06) I use MySQL Workbench 5.2 OSS Revision 6091 I have database TEST with table NAW I use the i use the following statement to export table NAW C:\mysqldump.exe --user=XXX --password=XXX --host=localhost test naw > c:\MybackupNAW.SQL This export file Creation of the file goes well! No i want to import the MybackupNAW.SQL with MySQL Workbench Start MySQL Workbench MySQL Workbench Server administration Import from disk import from self-contained File then i select MybackupNAW.SQL Click button Start Import Then i get this error: ERROR 1046 (3D000) at line 22: No database selected Operation failed with exitcode 1 10:54:45 Import of C:\MybackupNAW.sql has finished with 1 errors If i create with MySQL Workbench een export file MybackupNAW2.sql with the same database and table. Then the import works fine in MySQL Workbench !!! I see a difference between to export files: I the first lines of the export file with is created by MySQL Workbench is see this: CREATE DATABASE IF NOT EXISTS `test` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `test`; -- MySQL dump 10.13 Distrib 5.1.40, for Win32 (ia32) -- -- Host: localhost Database: test -- ------------------------------------------------------ -- Server version 5.1.47-community I the first lines of the export file with is created by mysqldump.exe is see this -- MySQL dump 10.13 Distrib 5.1.40, for Win32 (ia32) -- -- Host: localhost Database: test -- ------------------------------------------------------ -- Server version 5.1.47-community The problem is that is miss the first line "CREATE DATABASE IF NOT EXISTS......" in my export file. Want if i put this line in export file want i created with mysqldump.exe then the import file works well in MySQL Workbench . My question is how do I get this line automatically in my export file if I use mysqldump.exe statement! Thanks for the reply, Andre dre-logics -1 128 post