Create a new database on ubuntu from workbench
Here are the steps to create a new database on Ubuntu using MySQL Workbench:
Prerequisites:
- MySQL Workbench is installed on your Ubuntu system. If not, you can install it by running the command
sudo apt-get install mysql-workbench
in the terminal. - You have a MySQL server running on your Ubuntu system. If not, you can start the server by running the command
sudo service mysql start
in the terminal.
Step 1: Launch MySQL Workbench
- Open a terminal on your Ubuntu system.
- Type
mysql-workbench
and press Enter to launch MySQL Workbench.
Step 2: Connect to the MySQL Server
- In the MySQL Workbench window, click on the "Database" button in the top-left corner.
- Select "Connect to Database" from the dropdown menu.
- In the "Connect to Database" window, enter the following information:
- Host:
localhost
(or the hostname of your MySQL server) - Port:
3306
(the default port for MySQL) - Username:
root
(or the username of the MySQL user you want to use) - Password: Enter the password for the MySQL user you selected
- Host:
- Click "OK" to connect to the MySQL server.
Step 3: Create a New Database
- In the MySQL Workbench window, click on the "Database" button in the top-left corner.
- Select "Create New Database" from the dropdown menu.
- In the "Create New Database" window, enter the following information:
- Database name: Enter the name of the new database you want to create (e.g., "mynewdb")
- Collation: Select the collation for the database (e.g., "utf8_general_ci")
- Encoding: Select the encoding for the database (e.g., "utf8")
- Click "Create" to create the new database.
Step 4: Verify the New Database
- In the MySQL Workbench window, click on the "Database" button in the top-left corner.
- Select "Show All Databases" from the dropdown menu.
- Verify that the new database you created is listed in the database list.
That's it! You have successfully created a new database on Ubuntu using MySQL Workbench.