Error Code 1046 Mysql
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 mysql error code 1064 about Stack Overflow the company Business Learn more about hiring developers or posting ads mysql error 1046 (3d000) with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow
Mysql Error 1046 (3d000) At Line 22 No Database Selected
is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error Code 1046: No database Selected up vote 0 down vote favorite
Mysql 1046 Error On Import
I wrote a stored procedure (sp_archivev3) on MySQl Workbench which is as follows. Basically, Inserting values from one database to another. -- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored by the server -- -------------------------------------------------------------------------------- DELIMITER $$ CREATE DEFINER=`MailMe`@`%` PROCEDURE `sp_archivev3`() BEGIN INSERT INTO send.sgev3_archive(a_bi, b_vc, c_int, d_int, e_vc, f_vc, g_vc, h_vc, i_dt, j_vc, k_vc, l_vc, m_dt, n_vch, o_bit) SELECT a_bi, no database selected mysql php b_vc, c_int, d_int, e_vc, f_vc, g_vc, h_vc, i_dt, j_vc, k_vc, l_vc, m_dt, n_vch, o_bit FROM send.sgev3 WHERE m_dt BETWEEN '2014-06-09' AND CURDATE(); END When I run call sp_archivev3(); , I get an error with an error code 1046: No database selected SELECT the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar. Please let me know what's wrong with my stored procedure. mysql stored-procedures share|improve this question asked Jun 12 '14 at 17:35 rocky 1051312 Is send the DB name or the table name? DB name should come first –Eran Jun 12 '14 at 17:43 send is a db name. –rocky Jun 12 '14 at 17:47 Then are you trying to copy data between different tables in the same DB? –Eran Jun 12 '14 at 17:49 Yes, that's correct. –rocky Jun 12 '14 at 17:53 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted The problem is that MySQL doesn't know which procedure named sp_archivev3 is supposed to be executed; MySQL doesn't know which database to look in. (Stored programs are objects in a specific database, just like tables are objects in a specific database.)
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
Error 1046 No Database Selected Phpmyadmin
about Stack Overflow the company Business Learn more about hiring developers or posting ads no database selected mysql workbench import with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow error 1046 (3d000) no database selected grant is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error Code: 1046. No database selected Select up vote -1 down vote http://stackoverflow.com/questions/24190575/error-code-1046-no-database-selected favorite What seems to be wrong with my DB Error ? Im very new to SQL. Thanks <3 /* Navicat MySQL Data Transfer Source Server : Localhost Source Server Version : 50141 Source Host : localhost:3306 Source Database : tabulaDb Target Server Type : MYSQL Target Server Version : 50141 File Encoding : 65001 Date: 2011-02-10 23:56:02 */ SET FOREIGN_KEY_CHECKS=0; -- Table structure for characters DROP TABLE IF EXISTS http://stackoverflow.com/questions/27329099/error-code-1046-no-database-selected-select characters; CREATE TABLE characters ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(64) NOT NULL, slotID tinyint(4) NOT NULL, userID int(11) NOT NULL, gender tinyint(4) NOT NULL, raceID tinyint(4) NOT NULL, classID tinyint(4) NOT NULL, ad1_classId int(11) NOT NULL, ad1_hue int(10) unsigned NOT NULL, ad2_classId int(11) NOT NULL, ad2_hue int(10) unsigned NOT NULL, ad3_classId int(11) NOT NULL, ad3_hue int(10) unsigned NOT NULL, ad4_classId int(11) NOT NULL, ad4_hue int(10) unsigned NOT NULL, ad5_classId int(11) NOT NULL, ad5_hue int(10) unsigned NOT NULL, ad6_classId int(11) NOT NULL, ad6_hue int(10) unsigned NOT NULL, ad7_classId int(11) NOT NULL, ad7_hue int(10) unsigned NOT NULL, ad8_classId int(11) NOT NULL, ad8_hue int(10) unsigned NOT NULL, ad9_classId int(11) NOT NULL, ad9_hue int(10) unsigned NOT NULL, ad10_classId int(11) NOT NULL, ad10_hue int(10) unsigned NOT NULL, ad11_classId int(11) NOT NULL, ad11_hue int(10) unsigned NOT NULL, ad12_classId int(11) NOT NULL, ad12_hue int(10) unsigned NOT NULL, ad13_classId int(11) NOT NULL, ad13_hue int(10) unsigned NOT NULL, ad14_classId int(11) NOT NULL, ad14_hue int(10) unsigned NOT NULL, ad15_classId int(11) NOT NULL, ad15_hue int(10) unsigned NOT NULL, ad16_classId int(11) NOT NULL, ad16_hue int(10) unsigned NOT NULL, ad17_classId int(11) NOT NULL, ad17_hue int(10) unsigned NOT NULL, ad18_classId int(11) NOT NULL, ad18_hue int(10) unsigned NOT NULL, ad19_classId int(11) NOT NULL, ad19_hue int(10) unsigned NOT NULL, a
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