Reason for appearance:
- Delete a selected database in the workbench operation,
- Click the first "+SQL" in the upper left corner (create a new sql tab for executing queries)
- Open the .sql file or paste the sql statement and execute
- 报错: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.
Reason explanation:
Literal translation: Error code: 1046. Unselected database By double-clicking its name in the SCHEMAS list in the sidebar, select the default DB to be used.
In fact, it is because the selected database was deleted before, but a default database was not selected to manipulate the data before the new Query came in
Solution operation:
- Double-click the database to be operated in the list
- Execute sql statement
- Success, refresh it to see the execution result in the selected database