Mysql Query Browser No Database Selected Error
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 more about hiring developers or posting ads error 1046 (3d000) no database selected mysql with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the #1046 - no database selected import 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: no database selected php Sign up Error 1046 No database Selected, how to resolve? up vote 137 down vote favorite 22 Error SQL query: -- -- Database: `work` -- -- -------------------------------------------------------- -- -- Table structure for table `administrators` -- CREATE TABLE IF NOT EXISTS `administrators` error 1046 (3d000) no database selected grant ( `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 can also specify the database name via the CLI command without editing the import file. mysql -u root -p
No Database Selected Mysql Workbench Import
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:01 Thanks! This is what I needed. I had a script to create my database and tables but the tables weren't getting created because I needed to insert the USE tablename command. –ckpepper02 Apr 21 '14 at
Επιλέξτε τη γλώσσα σας. Κλείσιμο Μάθετε περισσότερα View this message in English Το YouTube εμφανίζεται στα Ελληνικά. Μπορείτε να αλλάξετε αυτή την
No Database Selected Mysql Command Line
προτίμηση παρακάτω. Learn more You're viewing YouTube no database selected mysqli in Greek. You can change this preference below. Κλείσιμο Ναι, θέλω error code 1046 in mysql workbench να τη κρατήσω Αναίρεση Κλείσιμο Αυτό το βίντεο δεν είναι διαθέσιμο. Ουρά παρακολούθησηςΟυράΟυρά παρακολούθησηςΟυρά Κατάργηση όλωνΑποσύνδεση Φόρτωση... http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve Ουρά παρακολούθησης Ουρά __count__/__total__ Fix #1046 - No database selected itcs program ΕγγραφήΕγγραφήκατεΚατάργηση εγγραφής272272 Φόρτωση... Φόρτωση... Σε λειτουργία... Προσθήκη σε... Θέλετε να το δείτε ξανά αργότερα; Συνδεθείτε για να προσθέσετε το βίντεο σε playlist. Σύνδεση Κοινή https://www.youtube.com/watch?v=ZciWnmcf7fU χρήση Περισσότερα Αναφορά Θέλετε να αναφέρετε το βίντεο; Συνδεθείτε για να αναφέρετε ακατάλληλο περιεχόμενο. Σύνδεση 23.455 προβολές 74 Σας αρέσει αυτό το βίντεο; Συνδεθείτε για να μετρήσει η άποψή σας. Σύνδεση 75 7 Δεν σας αρέσει αυτό το βίντεο; Συνδεθείτε για να μετρήσει η άποψή σας. Σύνδεση 8 Φόρτωση... Φόρτωση... Φόρτωση... Η δυνατότητα αξιολόγησης είναι διαθέσιμη όταν το βίντεο είναι ενοικιασμένο. Αυτή η λειτουργία δεν είναι διαθέσιμη αυτήν τη στιγμή. Δοκιμάστε ξανά αργότερα. Δημοσιεύτηκε στις 24 Απρ 2015how to fix ERROR : #1046 - No database selected MySQL said: Documentation#1046 - No database selected Κατηγορία Παιχνίδια Άδεια Τυπική άδεια YouTube Εμφάνιση περισσότερων Εμφάνιση λιγότερων Φόρτωση... Δια
Reporter: Stephen Gornick Email Updates: Status: Closed Impact on me: None Category:MySQL Server: Parser Severity:S3 (Non-critical) Version:5.0.27 OS:Microsoft Windows (Windows XP Pro https://bugs.mysql.com/bug.php?id=25863 SP2) Assigned to: Jon Olav Hauglid Tags: error, global, grant, No https://www.sitepoint.com/community/t/no-database-selected-mysql-error/5244 database selected Triage: Triaged: D3 (Medium) View Add Comment Files Developer Edit Submission View Progress Log Contributions [26 Jan 2007 10:45] Stephen Gornick Description: If I connect without specifying a default schema, and then attempt to grant permissions globally, I am given an error message "No database no database selected". However this is allowed in the Linux version of query-browser. Additionally, the documentation specifically says: "If you specify ON * and you have not selected a default database, the privileges granted are global." http://dev.mysql.com/doc/refman/5.0/en/grant.html How to repeat: Launch query browser. In the Query Browser connect dialog box, enter: Serer Host: localhost User: root Password: [myrootpwd] Default Schema: [leave no database selected blank] Click OK button. In the query entry field, GRANT ALL ON * TO STEVE; Click Execute button. Status bar will show: "The query could not be executed." The Messages window at bottom will show under Description column: "No database selected" Suggested fix: Allow global grants even when no schema is selected, just like the Linux version of the query browser does. [26 Jan 2007 11:19] Miguel Solorzano Thank you for the bug report. This is server or documentation issue, the same happens with the mysql.exe client. Changing category. http://dev.mysql.com/doc/refman/5.0/en/grant.html "You can assign global privileges by using ON *.* syntax or database-level privileges by using ON db_name.* syntax. If you specify ON * and you have selected a default database, the privileges are granted in that database. (Warning: If you specify ON * and you have not selected a default database, the privileges granted are global.)" C:\mydb>bin\mysql -uroot -P3307 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 5.0.27-community-nt MySQL Community Edition (GPL) Typ
the error below in red: You are connectedrunning query:INSERT INTO domains(domain, sex, mail) values('website', 'male/female', 'email')INSERT error : No database selected I can access this db in mysql console & phpmyadmin as the root user with no password.All privileges is granted to the root user. Here is my php code, "; } $query = "INSERT INTO domains(domain, sex, mail) values('website', 'F', 'mail')"; print "running query:
\$query
\"; mysql_query($query, $connect) or die ("INSERT error: ".mysql_error()); mysql_close($connect); ?> All help appreciated! AnthonySterling 2009-07-13 09:30:17 UTC #2 Does the following work? kingr 2009-07-13 09:51:05 UTC #3 SilverBulletUK said: Does the following work? php
$rConn = mysql_connect('localhost', 'root');
if((false === is_resource($rConn)) || (false === mysql_select_db('p24', $rConn)))
{
echo mysql_error();
exit;
}
if(false === mysql_query("INSERT INTO domains (domain, sex, mail)VALUES('website', 'F', 'mail')"))
{
echo mysql_error();
exit;
}
mysql_close($rConn);
?>
thanks for the rapid response. No, now i get this Unknown database 'p24' Seems like i cant access the db...anymore suggestions AnthonySterling 2009-07-13 10:01:28 UTC #4 OK, what do you get with the following code... ', $aRecord['database'], '
', $aRecord['database'