error 1046 no database selected source
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 error 1046 (3d000): no database selected developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Error 1046 3d000 At Line 22 No Database Selected
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; no database selected mysql error 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`#1046 - No Database Selected Import
-- 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 steph 687253 5 In case anyone is interested, you can also specify the database name via the CLI no database selected mysql workbench import 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 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 tahere for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
No Database Selected Php
and policies of this site About Us Learn more about Stack OverflowError 1046 (3d000) No Database Selected Grant
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation error code 1046 in mysql workbench 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 each other. Join them; it http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve only takes a minute: Sign up Error #1046 - No database selected SQL import on XAMPP up vote 15 down vote favorite 2 I am trying to import the SQL database from my Drupal production site into a sandbox testing site on my local machine. I currently use XAMPP on my machine here at work. I have downloaded my db http://stackoverflow.com/questions/11438427/error-1046-no-database-selected-sql-import-on-xampp aipiadxxm_if9DHdr.sql and then I go to the phpMyAdmin on http://localhost/phpmyadmin/index.php then to -> Import. After I import the db I get this Error: SQL query: -- -- Database: `aipiadxxm_if9DHdr.sql` -- -- -------------------------------------------------------- -- -- Table structure for table `if9d_access` -- CREATE TABLE IF NOT EXISTS `if9d_access` ( `aid` int( 11 ) NOT NULL AUTO_INCREMENT , `mask` varchar( 255 ) NOT NULL default '', `type` varchar( 255 ) NOT NULL default '', `status` tinyint( 4 ) NOT NULL default '0', PRIMARY KEY ( `aid` ) ) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =1; MySQL said: Documentation #1046 - No database selected What is causing this error message: #1046 - No database selected ? mysql sql drupal phpmyadmin xampp share|improve this question edited Aug 12 '13 at 1:33 Eric Leschinski 46.3k23221190 asked Jul 11 '12 at 17:46 accraze 54341034 1 It looks like the .sql file is just the table. Try creating the database in phpmyadmin, then importing the file as a table. –PeaBucket Jul 11 '12 at 18:14 add a comment| 1 Answer 1 active oldest votDu kan ändra inställningen nedan. Learn more You're viewing YouTube in Swedish. You can change this preference below. Stäng Ja, behåll den Ångra Stäng Det här videoklippet är inte tillgängligt. VisningsköKöVisningsköKö Ta bort allaKoppla från Läser in ... Visningskö https://www.youtube.com/watch?v=ZciWnmcf7fU Kö __count__/__total__ Ta reda på varförStäng Fix #1046 - No database selected itcs program PrenumereraPrenumerantSäg upp269269 Läser in ... Läser in ... Arbetar ... Lägg till i Vill du titta på det här igen senare? Logga in om http://wisercoder.com/how-to-fix-the-1046-no-database-selected-error-in-phpmyadmin/ du vill lägga till videoklippet i en spellista. Logga in Dela Mer Rapportera Vill du rapportera videoklippet? Logga in om du vill rapportera olämpligt innehåll. Logga in 22 747 visningar 73 Gillar du videoklippet? Logga in och gör no database din röst hörd. Logga in 74 7 Gillar du inte videoklippet? Logga in och gör din röst hörd. Logga in 8 Läser in ... Läser in ... Läser in ... Rankning kan göras när videoklippet har hyrts. Funktionen är inte tillgänglig just nu. Försök igen senare. Publicerades den 24 apr. 2015how to fix ERROR : #1046 - No database selected MySQL said: Documentation#1046 - No database selected Kategori Spel Licens Standardlicens för YouTube Visa mer Visa no database selected mindre Läser in ... Annons Automatisk uppspelning När automatisk uppspelning är aktiverad spelas ett föreslaget videoklipp upp automatiskt. Kommer härnäst MySQL Tutorial for Beginners - 1 - Creating a Database and Adding Tables to it - Längd: 8:50. primetubervideos 652 205 visningar 8:50 1046 Error in SQL In phpMyAdmin[Solved] - Längd: 1:34. Zaroon bin hadi 254 visningar 1:34 How to Fix No Database Selected Problem in MySQL - Längd: 1:54. Codescoder Program 758 visningar 1:54 IMPORTAR EXPORTAR BASE DATOS SQL PHPMYADMIN - Längd: 8:00. APRENDIZ WEBMASTER 7 940 visningar 8:00 SERVIDOR WEB CON XAMPP CONFIGURACION DEL PUERTO 80 - Längd: 15:12. Jose Muñoz 17 600 visningar 15:12 PHP and MySQL with MySQLi: Getting results (Part 4/9) - Längd: 16:09. Codecourse 78 615 visningar 16:09 how to import and export data base in sql 2015 - Längd: 10:52. indian highway 260 visningar 10:52 Error 1064 when restoring a mysql dump - Längd: 1:20. Adarsh Agarwal 470 visningar 1:20 "No Database Selected" Error During The SQL File Import - Längd: 1:44. TemplateMonsterCo 3 022 visningar 1:44 Connect to MySQL with PHP in XAMPP / Create a new database - Längd: 6:41. Ken Swartwout 308 745 visningar 6:41 What is Database & SQL? - Längd: 6:20. Guru99 463 694 visningar 6:20 How to Import MySQL Database into phpMyAdmin in wamp server or cpanel - Längd: 1:30. Sooraj Mohan 26 272 visningar 1:30 MySQL - CREATE Database C
"#1046: No database selected" error when trying to import a .sql file in phpMyAdmin. Solution #1: Before importing In phpMyAdmin, click on the Export tab from the home page of phpMyAdmin, without selecting any database. phpMyAdmin will then include instructions to create and select the database when you import it. This solution does not apply to most shared hosts, since they won't allow you to create a database from phpMyAdmin. Solution #2: The alternative fix Unlike solution #1, this one also works on shared hosts. Create the new database on your server, then write down the name. Open your .sql file with a text editor Insert the following line right before the first CREATE TABLE instruction in your .sql file: USE your_database_name_here; Save your file, then import it in phpMyAdmin. SQL Tagged database, errors, mysql, phpmyadmin, sql ← How to get an Integer from a Java resultset How to properly validate email addresses in Java → 21 comments on “How to fix the "#1046: No database selected" error in phpMyAdmin” carle November 13, 2013 at 11:34 pm many thanks! save my life! Reply Sam June 3, 2014 at 2:08 pm What i get when i export my database is a notepad file format showing mywebname.sql instead of the normal sql file for upload to liveserver….please help as i dont know what could be wrong. Reply Nicolas Bouliane June 3, 2014 at 3:05 pm Upload that file in the import form Reply Manish Atri November 19, 2013 at 7:43 am Thanks a lot Buddy Reply Juanita Alcachofa December 5, 2013 at 6:32 pm Muy bueno, me sirvió. Reply Ivan January 3, 2014 at 11:07 pm Thank you! Solution #2 worked for me! Reply Pizo January 13, 2014 at 10:41 pm Thank you! Reply Mr January 21, 2014 at 11:54 pm Just wanted to add, since your solution led me to the answer : It's all because there is an existing database of the hosting company and they won't allow you to open one yourself, but rather suit yours into theirs. The solution therefore is to 1.export your database in sql format from phpmyadmin localhost 2.open that file with notepad++ 3.edit the first lines to this CREATE DATABASE IF NOT EXISTS hosting_db01 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE hosting_db01; where ‘hosting_db01′ is the name of the hosting database, instead of your database 4.spread the luuuv Good luck - worked for me and thanx again Reply eiyfa18 June 5, 2014 at 12:54 am hi, i am really a beginners of this kind of thi