Error 1046 No database Selected how to resolve

0 votes
Error SQL query:
-- 
-- Database: `work` 
-- 
-- -------------------------------------------------------- 
-- 
-- Table structure for table `administrators` 
-- 
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


I need some help here to solve this ERROR. 

Feb 23 in Others by Rahul
• 8,980 points
155 views

1 answer to this question.

0 votes

I can help you with this doubt as the same error occurred for me when I tried to import a database created from before. In order to fix this issue, start with Creating a new database, then use it by use command and try it again. This has helped me!! Have shared a screenshot below for better understanding:-

enter image description here

answered Feb 23 by Aditya
• 7,280 points

Related Questions In Others

0 votes
0 answers

how to resolve

Started by user admin Running as SYSTEM Building on ...READ MORE

Oct 5, 2021 in Others by Ajinkya
• 120 points
22 views
0 votes
1 answer

How to solve "Error: Apache shutdown unexpectedly"?

To answer your question, as this port ...READ MORE

answered Feb 10 in Others by Rahul
• 8,980 points
855 views
0 votes
1 answer
0 votes
0 answers

How is it possible for DynamoDB to support both Key-Value and Document database properties at the same time

As per DynamoDB's documentation, it supports both ...READ MORE

Apr 5 in Others by Kichu
• 19,040 points
61 views
0 votes
1 answer
0 votes
1 answer

How to change the default value and to alter a column in sql?

Hi, You can try this: ALTER TABLE foobar_data CHANGE ...READ MORE

answered Jun 24, 2019 in Big Data Hadoop by Gitika
• 65,850 points
341 views
0 votes
1 answer

What is an index in SQL?

An index is used to speed up ...READ MORE

answered Feb 3 in Database by Vaani
• 7,020 points
42 views
0 votes
1 answer

Ordering by the order of values in a SQL IN() clause

Use MySQL's FIELD() function: SELECT name, description, ... FROM ... WHERE id ...READ MORE

answered Feb 4 in Database by Neha
• 8,560 points
388 views
0 votes
1 answer

How to fix "Headers already sent" error in PHP

The functions that send and modify the ...READ MORE

answered Feb 17 in Others by Aditya
• 7,280 points
174 views
0 votes
1 answer

How to create an HTML button that acts like a link

To answer your doubt, the plain HTML ...READ MORE

answered Feb 17 in Others by Aditya
• 7,280 points
99 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP