Create new database in mysql workbench
Here are the steps to create a new database in MySQL Workbench:
Step 1: Open MySQL Workbench
Launch MySQL Workbench on your computer. You can find it in your Start menu (Windows) or Applications folder (Mac).
Step 2: Connect to the MySQL Server
In the MySQL Workbench window, click on the "Database" button in the toolbar or navigate to "File" > "New Database" (or press Ctrl+Shift+N on Windows or Command+Shift+N on Mac).
In the "Connect to Server" dialog box, enter the following information:
- Host: The hostname or IP address of your MySQL server (e.g.,
localhost
or127.0.0.1
). - Username: The username you use to connect to the MySQL server (e.g.,
root
). - Password: The password for the specified username.
- Port: The port number used by the MySQL server (default is usually
3306
).
Click "OK" to connect to the server.
Step 3: Create a New Database
In the "Database" window, click on the "Create a new database" button or navigate to "Database" > "Create a new database" (or press Ctrl+Shift+N on Windows or Command+Shift+N on Mac).
In the "Create a new database" dialog box, enter the following information:
- Database name: Enter a name for your new database (e.g.,
mynewdb
). - Collation: Choose a collation for your database (e.g.,
utf8_general_ci
). - Encoding: Choose an encoding for your database (e.g.,
utf8
).
Click "Create" to create the new database.
Step 4: Verify the Database Creation
Once the database is created, you should see a confirmation message in the "Database" window. You can also verify the database creation by clicking on the "Schema" button in the toolbar and selecting the new database from the list.
That's it! You have successfully created a new database in MySQL Workbench.