Create a new database on ubuntu from workbench

Here are the steps to create a new database on Ubuntu using MySQL Workbench:

Prerequisites:

  1. 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.
  2. 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

  1. Open a terminal on your Ubuntu system.
  2. Type mysql-workbench and press Enter to launch MySQL Workbench.

Step 2: Connect to the MySQL Server

  1. In the MySQL Workbench window, click on the "Database" button in the top-left corner.
  2. Select "Connect to Database" from the dropdown menu.
  3. 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
  4. Click "OK" to connect to the MySQL server.

Step 3: Create a New Database

  1. In the MySQL Workbench window, click on the "Database" button in the top-left corner.
  2. Select "Create New Database" from the dropdown menu.
  3. 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")
  4. Click "Create" to create the new database.

Step 4: Verify the New Database

  1. In the MySQL Workbench window, click on the "Database" button in the top-left corner.
  2. Select "Show All Databases" from the dropdown menu.
  3. 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.