Skip to content
Advertisement

mysql workbench No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar

I’m learn sql for web design. I am using MySql WorkBench, as stated in the title I’m wondering if there something in sql code is missing.

Given error: 14:59:45 CREATE TABLE branch ( branch_id int(11) NOT NULL, branch_name varchar(45) NOT NULL, branch_phone varchar(45) NOT NULL, branch_email varchar(45) NOT NULL, branch_address varchar(100) NOT NULL, branch_gst_registration varchar(45) NOT NULL, branch_fax varchar(45) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 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. 0.000 sec

Advertisement

Answer

that means you have no Database created. You should create database first. The query will be like this:

After you create your database, you can double click the database that you have created in a left panel (The header name is “SCHEMAS”).

If you are facing this issue when you have created a database, you can try this query:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement