In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
The main content of this article is to explain "the error of the old version of mysql: ERROR 1046 (3D000): No database selected (BUG) how to solve", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "the error report of the old version of mysql: ERROR 1046 (3D000): No database selected (BUG) how to solve it"!
When the developer is given a sql, you need to do batch update for each library of the project. After writing it in the script, you will find a failure and report an error during execution.
ERROR 1046 (3D000): No database selected, the specified library name was found and a question was raised.
After confirming that the library name has been specified, then rewrite it into select and do a query, and find that the error is still reported.
If we take a closer look at sql, we can find that the writing of unhex function is not rigorous, that is, the parentheses are not followed closely.
That is, you need to replace unhex () with unhex ().
I went on to do a test and found that the error message was the same, but irrelevant:
Since the function is written irregularly, how does it have to do with whether or not to choose the database?
Mysql > SELECT NOW ()
ERROR 1046 (3D000): No database selected
Confirm the DB version:
Mysql > SELECT version ()
+-- +
| | 5.0.51a-24+lenny2-log |
+-- +
1 row in set (0.00 sec)
The ancient version, which is estimated to have more bug, has been tested with a new version of mysql5.5:
It is found that the error is normal:
Mysql > SELECT NOW ()
ERROR 1305 (42000): FUNCTION now does not exist
Probably guessed to be a BUG from the old version (mysql5.0). 5.1 No test was done.
However, no matter whether it is the old version or the new version, the error will be reported if the function name is not followed by parentheses, but the error thrown by 5.0 is so strange that people can't understand it.
Of course, adding "IGNORE_SPACE" to sql_mode can ignore such issues, but it is not recommended:
Mysql > SELECT VERSION ()
+-- +
| | VERSION () |
+-- +
| | 5.0.51a-24+lenny2-log |
+-- +
1 row in set (0.00 sec)
Mysql > SELECT NOW ()
ERROR 1046 (3D000): No database selected
Mysql > SHOW VARIABLES LIKE 'sql_mode'
+-+ +
| | Variable_name | Value |
+-+ +
| | sql_mode |
+-+ +
1 row in set (0.00 sec)
Mysql > SET @ @ session.sql_mode='IGNORE_SPACE'
Query OK, 0 rows affected (0.00 sec)
Mysql > SELECT NOW ()
+-+
| | NOW () |
+-+
| | 2016-03-18 02:00:14 |
+-+
1 row in set (0.00 sec)
At this point, I believe you have a deeper understanding of "the error of the old version of mysql: ERROR 1046 (3D000): No database selected (BUG) how to solve it", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.