Mysql Grant Error 1046 3d000 No Database Selected
Contents |
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 error 1046 (3d000) no database selected mysql 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 with us Database Administrators no database selected mysql command line 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
No Database Selected Mysql Php
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 Error 1046 Mariadb: No database selected up vote 3 down vote favorite 1 GRANT ALL ON my-database.* TO my-user@10.0.0.1 IDENTIFIED error 1046 3d000 no database selected change password BY 'password'; ERROR 1046 (3D000): No database selected Ok, I have created a database with a "-" on the name (did the same thing on the user)... then when I try to set the grants on it the database wont work. If I use the base the error is different MariaDB [(none)]> use my-base Database changed MariaDB [my-base]> GRANT ALL ON 'my-base'.* TO 'my-user'@'10.0.0.1' IDENTIFIED BY 'password'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''my-base'.* TO 'my-user'@'10.0.0.1' IDENTIFIED BY 'password'' at line 1 MariaDB [my-base]> mariadb share|improve this question edited Mar 8 at 22:54 RolandoMySQLDBA 108k15139276 asked Oct 19 '12 at 14:27 maniat1k 1702516 1 In regards to the second error if you set your database, if you're not running in ANSI-quote sql_mode, ' doesn't escape a database object. Use the back tick ` –Derek Downey Oct 19 '12 at 15:03 1 Slight correction to myself...ANSI_QUOTES affects the double-quotes for escaping...single-quot
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
#1044 - Access Denied For User
developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Error 1044 (42000): Access Denied For User
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join error 1046 citrix them; it only takes a minute: 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` http://dba.stackexchange.com/questions/27245/error-1046-mariadb-no-database-selected -- 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 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 http://stackoverflow.com/questions/4005409/error-1046-no-database-selected-how-to-resolve 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 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 dat
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 https://bugs.mysql.com/bug.php?id=25863 Windows (Windows XP Pro SP2) Assigned to: Jon Olav Hauglid Tags: error, global, grant, No database selected Triage: Triaged: D3 (Medium) View Add Comment Files Developer Edit Submission https://sraji.wordpress.com/2011/08/10/how-to-reset-mysql-root-password/ 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 no database given an error message "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: no database selected Serer Host: localhost User: root Password: [myrootpwd] Default Schema: [leave 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.
necessary to give its root password Since i forgot its root password, i ended up with the following error Error: ERROR 1045 (28000): Access denied for user ‘root'@'localhost' (using password: NO) Then i followed the below steps to reset it Steps: 1. [root@venus ~]# service mysqld stop Stopping mysqld: [ OK ] 2. [root@venus ~]# mysqld_safe -skip-grant-tables & [1] 3735 3. [root@venus ~]# 110809 10:43:22 mysqld_safe Logging to ‘/var/log/mysqld.log'. 110809 10:43:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 4. [root@venus ~]# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.56 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type ‘help;' or ‘\h' for help. Type ‘\c' to clear the current input statement. 5. mysql> UPDATE user SET password=PASSWORD("slash123″)WHERE user="root"; ERROR 1046 (3D000): No database selected ( Note: Here "slash123" is my mysql root password ) 6. mysql> show databases; +-------------+ | Database | +-------------+ | information_schema | | django | | drupal | | mysql | | student | | test | +-------------+ 6 rows in set (0.34 sec) 7. mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with - A Database changed 8. mysql> UPDATE user SET password=PASSWORD("slash123″)WHERE user="root"; Query OK, 3 rows affected (1.07 sec) Rows matched: 3 Changed: 3 Warnings: 0 9. mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) 10. mysql> quit Bye 11. [rajee@venus ~]$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.56 Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type ‘help;' or ‘\h' for help. Type ‘\c' to clear the current i