Error 1046 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 of this site About Us Learn more about Stack Overflow the
Error 1046 (3d000): No Database Selected
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions error code 1046 no database selected Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million error 1046 no database selected mysql workbench 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: -- --
No Database Selected Mysql Error
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 steph
No Database Selected Mysql Php
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 edit the ex
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 or posting ads with no database selected mysql workbench import us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack
Error 1046 (3d000) No Database Selected Grant
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: Sign #1046 - no database selected wordpress up phpMyadmin database import error #1046 - No database selected up vote 6 down vote favorite 2 I have an sql file that i exported from phpmyadmin on another computer. I tried to import the file on this computer and I get http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve this error: Error SQL query: -- -- Database: `phplogin` -- -- -------------------------------------------------------- -- -- Table structure for table `people` -- CREATE TABLE IF NOT EXISTS `people` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT , `name` VARCHAR( 25 ) NOT NULL , `age` INT( 11 ) NOT NULL , `testvar` VARCHAR( 5 ) NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =3; MySQL said: #1046 - No database selected mysql database import phpmyadmin share|improve this http://stackoverflow.com/questions/6880511/phpmyadmin-database-import-error-1046-no-database-selected question edited Dec 23 '14 at 16:00 default locale 6,47692947 asked Jul 30 '11 at 1:31 user780483 71181527 add a comment| 2 Answers 2 active oldest votes up vote 29 down vote The error is because you either didn't select a database on the left side to import to, and/or you didn't create the empty database first. Create a database in phpMyAdmin called "phplogin", select it on the left side, and then run the import. share|improve this answer answered Aug 3 '11 at 0:17 Clowerweb 841912 3 Any idea how to do this in a phpMyAdmin configuration that only logs into a specific database? (Thus there is no DB to select on the left, only tables.) –Old McStopher Jun 19 '14 at 1:01 Also, what if there was no database to select in the first place? I made an entire export of my entire phpmyadmin collection, and reformatted my computer. When I try to import the file, I get the same message. I need it to create the database tables for me, as I can't go through and add each one exactly as it was.. Why didnt this get included in the export? –Lee Apr 6 at 12:43 add a comment| up vote 2 down vote Append the following line to the beginning of your sql file CREATE DATABASE phplogin; These problems can be resolved by exporting the SQL file while being outside the database.Then phpmyadmin automatically appends the above statement to the SQL file s
"#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 http://wisercoder.com/how-to-fix-the-1046-no-database-selected-error-in-phpmyadmin/ 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 http://dba.stackexchange.com/questions/24371/how-to-import-a-sql-file-in-mysql 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; no database 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 no database selected 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 thing. can you provide me an example of doing that? because when i try your suggestion ab
log in tour help Tour Start 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 or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How to import a .sql file in MySQL? up vote 16 down vote favorite 5 I am trying to import a .sql file using MySQL Workbench and I get this error: ERROR 1046 (3D000) at line 28: No database selected I have first created an empty database called with the same name as the .sql file but it doesn't work. I have also tried to do it with the mysql command client using: mysqldump -u root database > file.sql But it says a have an error in my SQL syntax. Furthermore, I don't know the path where I have to set the file.sql. mysql mysqldump import share|improve this question edited Oct 25 '12 at 4:01 RolandoMySQLDBA 107k15138274 asked Sep 14 '12 at 11:43 Barbara Dreamer migrated from stackoverflow.com Sep 16 '12 at 1:27 This question came from our site for professional and enthusiast programmers. add a comment| 7 Answers 7 active oldest votes up vote 22 down vote Export: mysqldump -u username –-password=your_password database_name > file.sql Import: mysql -u username –-password=your_password database_name < file.sql share|improve this answer edited Apr 15 at 19:51 answered Sep 14 '12 at 11:46 juergen d 37139 6 There has to be no space between -p and password –tombom Sep 14 '12 at 11:47 What if I don't have a password? –Barbara Dreamer Sep 14 '12 at 11:57 Then skip password parameter. –Kazimieras Aliulis May 31 '13 at 10:35 Piping (mysqldump db -uuser -ppass|mysql new_db -uuser -ppass) removes the need to use an intermediate file. –Pacerier Oct 12 '15 at 10:05 The database has to