Mysql Error 1046 3d000
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 Overflow the company Business Learn no database selected mysql more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
No Database Selected Mysql Php
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, error 1046 no database selected phpmyadmin helping each other. Join them; it only takes a minute: Sign up Error 1046 No database Selected, how to resolve? up vote 137 down vote favorite 22 Error SQL query: -- -- Database: `work` -- -- -------------------------------------------------------- -- error 1046 (3d000) no database selected grant -- 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 199k37360417 asked Oct 23 '10 at 18:19 steph 692253 5 In case anyone is interested, you
No Database Selected Mysql Workbench Import
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 216 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,991946102 answered Oct 23 '10 at 18:21 codaddict 252k50362443 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
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 error code 1046 in mysql workbench About Us Learn more about Stack Overflow the company Business Learn more about no database selected mysql command line hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
No Database Selected Mysqli
Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR 1046 (3D000): http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve No database selected while creating user up vote 0 down vote favorite When I create a admin user with: GRANT ALL ON * TO my_name@localhost IDENTIFIED BY 'my_passwd' WITH GRANT OPTION I received the error message "ERROR 1046 (3D000): No database selected". mysql mysql-error-1064 share|improve this question edited Nov 19 '14 at 14:12 Lars 1,186823 asked Nov 19 '14 at 13:56 user2823470 312 add a http://stackoverflow.com/questions/27018653/error-1046-3d000-no-database-selected-while-creating-user comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted You should be saying it like below by qualifying it with database name. Check MySQL Documentation for more information. GRANT ALL ON db_name.* So for your case, GRANT ALL ON db1.* TO my_name@localhost IDENTIFIED BY 'my_passwd' WITH GRANT OPTION; share|improve this answer answered Nov 19 '14 at 13:59 Rahul 43.4k63462 or for all databases use GRANT ALL ON *.* ... –Lars Nov 19 '14 at 14:04 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged mysql mysql-error-1064 or ask your own question. asked 1 year ago viewed 6794 times active 1 year ago Related -2Syntax Error in Create Function2Importing using MySQL WorkBench… error ERROR 1046 (3D000)0Error Updating Database with PHP0You have an error in your SQL syntax while doing a basi
Aug 2014 15:49 Reporter: Flavian C Email Updates: Status: Verified Impact on me: None Category:MySQL Server: Parser Severity:S3 (Non-critical) Version:5.5.26 5.6.19 OS:Any Assigned to: https://bugs.mysql.com/bug.php?id=73590 Triage: Needs Triage: D4 (Minor) View Add Comment Files Developer Edit Submission View Progress Log Contributions [14 Aug 2014 17:56] Flavian C Description: If we use multi-join inside a https://teamtreehouse.com/community/problems-with-mysql-file-1046-no-database-selected join the update query asks for DB name ERROR 1046 (3D000): No database selected How to repeat: Im getting no database select when using JOIN inside a JOIN. no database UPDATE DB1.TABLE1 as a JOIN (SELECT * FROM DB1.TABLE2 as b,(SELECT * DB1.TABLE2) as c WHERE b.col1 = c.col1) ea JOIN (SELECT SUM(d.size) FROM DB1.TABLE2 as d WHERE d.col1=xx) ef ON a.col1=ea.col1 and a.col1=ef.col1 set xxxx Also if ea alias join if we convert the inside join to subquery it works properly but takes a performance hit. i.e no database selected UPDATE DB1.TABLE1 as a JOIN (SELECT * FROM DB1.TABLE2 as b WHERE b.col1 = (SELECT c.col1 DB1.TABLE2 as c)) ea JOIN (SELECT SUM(d.size) FROM DB1.TABLE2 as d WHERE d.col1=xx) ef ON a.col1=ea.col1 and a.col1=ef.col1 set xxxx [14 Aug 2014 18:00] Sveta Smirnova Thank you for the report. Please specify which exact minor version of MySQL server you use and provide output of SHOW CREATE TABLE for all involved tables. [14 Aug 2014 18:28] Flavian C Just for test case you can do: Do not do " use dbname " login into mysql : execute the following CREATE TABLE flavian.`test1` ( `col1` int(3) DEFAULT NULL, `col2` int(3) DEFAULT NULL, `col3` int(3) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; CREATE TABLE flavian.`test2` ( `col1` int(3) DEFAULT NULL, `col2` int(3) DEFAULT NULL, `col3` int(3) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; mysql> update flavian.test1 a JOIN (select * from flavian.test2 b, (select * from flavian.test2 c where c.col1=1 limit 1) d where b.col1=d.col1) ea JOIN (select sum(e.col2) from flavian.test2 e where e.col1=1) ef set a.
Meyer Claus Meyer Pro Student 2,523 Points Problems with Mysql file (1046 - No database selected) Error SQL query: CREATE TABLE sizes ( id INT( 11 ) NOT NULL AUTO_INCREMENT , size VARCHAR( 32 ) COLLATE utf8_unicode_ci DEFAULT NULL , order INT( 11 ) NOT NULL , PRIMARY KEY ( id ) ) ENGINE = INNODB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =5; MySQL said: Documentation 1046 - No database selected No good, if you get problems just importing a file! Problem is that I cant write "Create table" 1 Answer Petros Sordinas 15,723 Points Petros Sordinas Petros Sordinas 15,723 Points about 2 years ago You have to tell SQL which database you are using Either : USE database_name; or if the database does not exist CREATE DATABASE database_name USE database_name; Claus Meyer Pro Student 2,523 Points Claus Meyer Claus Meyer Pro Student 2,523 Points 2y ago THANKS, I got it to work now... Oki, my database name is: movikcrewhunter USE movikcrewhunter; CREATE TABLE sizes ( id int(11) Posting to the forum is only allowed for members with active accounts. Please sign in or sign up to post. Our mission is to bring affordable, technology education to people everywhere, in order to help them achieve their dreams and change the world. Our Company About Us Contact Us Community Treehouse Stories Student Perks Treehouse Blog Affiliate Program Careers Topics HTML CSS Design JavaScript Ruby PHP WordPress iOS Android Development Tools Business Tracks Web Design Web Development Rails Development PHP Development iOS Development Android Development WordPress Development Starting a Business Treehouse Blog About Treehouse Privacy Policy Terms & Conditions © 2016 Treehouse Island, Inc. Sign in Email Address Password I forgot my password Sign in