academind / sql-complete-guide-code

SQL command snapshots and slides for our complete SQL course (https://acad.link/sql)
165 stars 97 forks source link

ERROR on create Database #1

Open AhmadrezaMozaffary opened 2 years ago

AhmadrezaMozaffary commented 2 years ago

Hi, I have an issue with create database with sql command in VScode, Could you please help me ?

I do this : CREATE DATABASE talently;

and it returns this error: Request connection/GetChildrenForTreeItemRequest failed with message: ER_BAD_DB_ERROR: Unknown database 'default'

I tried to change th DB name to talently but I saw the same resault :(

ahm1371ahm commented 1 year ago

That's because your database system does not hold a database called default. Before connecting to your database in VSCode, you should create a database named 'talently' in your database system's CLI or GUI tools. For example, if you use MySQL, you may open MySQL Workbench and create a database there by this command:

CREATE DATABASE talenly;

Then go to VSCode and try to connect to your database again (by means of SQLTools plugin). Similarly, if you desire to use PostgreSQL, you should open pgAdmin and create a database there by the command above.