Error 1046 Sqlstate 3d000 Er_no_db_error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss error 1046 no database selected phpmyadmin the workings and policies of this site About Us Learn more no database selected error in php about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow error 1046 (3d000) no database selected grant Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Error Code 1046 In Mysql Workbench
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: -- -- Database: `work` -- -- -------------------------------------------------------- -- -- Table structure for table `administrators` -- CREATE TABLE IF NOT EXISTS `administrators` ( `user_id` varchar( 30 ) NOT NULL , no database selected mysql workbench import `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 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 commen
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 no database selected mysql command line about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
#1046 - No Database Selected Wordpress
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
No Database Selected Mysqli
each other. Join them; it only takes a minute: Sign up MySQL Error: #1046 - No database selected up vote 1 down vote favorite I ran into an issue using MySQL 5.5 running on xampp (Version 1.8.1). I kept http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve receiving the "#1046 - No database selected" error when trying to add a table to a database via the console window. I had made sure the database was selected "USE database_name;", however I was still receiving the same error. I double checked and found all privileges for the user were enabled. Frustrated, I "Uncheck All" then "Check All" global privileges. I logged out, restarted server services, closed the browser, restarted server services, opened browser, and logged in. http://stackoverflow.com/questions/17126677/mysql-error-1046-no-database-selected Now I am able to create tables via the console. It appears to me resetting the privileges fixed the issue. Can anyone tell me if this is a known bug, if I got lucky, or missed the point completely? Documentation I found concerning this error was mostly for importing a database and using the "Use Database_Name;" to ensure the database was indeed selected. However I don't believe this was the issue. Please Note: While trying to create new databases I am once again receiving the #1046 error. The method I mentioned above was a fluke and is not allowing me to create any new tables inside a new database. However I am still able to work with the first database I created. mysql share|improve this question edited Jun 18 '13 at 2:43 asked Jun 15 '13 at 18:27 user2038001 11125 add a comment| 3 Answers 3 active oldest votes up vote 7 down vote I know this is a very late answer but for the benefit of anyone coming across this error, it might also pop up when the database name includes a dash. If so you need to put backticks around the database name, like so: GRANT ALL ON `database-name`.* TO 'username'@'localhost'; The error message is not very helpful as it suggest you need to select a database in order to grant privileges to a user. share|improve
Meyer Claus Meyer Pro Student 2,523 Points Problems with Mysql file (1046 - No database selected) Error SQL https://teamtreehouse.com/community/problems-with-mysql-file-1046-no-database-selected 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 no database 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 no database selected 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