Set up MySQL Workbench on your computer

Business Benefits

Store and retrieve data using objects like tables and views.


Download and install MySQL Workbench on your computer.

  1. To install MySQL, go to MySQL :: MySQL Community Downloads and install the latest version for Mac, Windows or Linux.
  2. To install MySQL Workbench go to MySQL :: Download MySQL Workbench and install the latest version for Mac, Windows or Linux.
  3. Click on the executable file and follow the default settings to complete the installation of MySQL and MySQL Workbench.

Set up MySQL Workbench to connect to the Amazon RDS database using the connection credentials.

  1. Open MySQL Workbench on your computer.
  2. Click on the + icon to set up a new connection.
  3. In the New Connection window, enter:
    • Connection Name: A descriptive name for the connection.
    • Hostname: 127.0.0.1 for a local database, or the URL of an external database: for example, hg21k8gff.aws.amazon.com.
    • Port: 3306
    • Username: username for the database admin account that you created when setting up the database.
    • Password: password for the database admin account.
    • Default Schema: Leave blank or if you know the schema name, enter it here.
  4. Click on Test Connection to verify the details entered are correct. You should see a success message.

Create a new schema (database) that can be used to create tables and database objects to store and retrieve data.

Once you have successfully tested the connection, click on Connect to launch the MySQL Workbench. Open the Editor and enter the create database command. Give the database any name you prefer.

CREATE DATABASE mynewdb;

```Under the ***SCHEMAS*** menu on the side menu bar, your new database should be visible. If you do not see the database, click on the refresh icon.

![](https://cxl.com/institute/wp-content/uploads/2021/03/image-18.png)


## Create objects like tables within your new database, using the MySQL Workbench visual tool.

Common objects are tables, views, stored procedures and functions.

1. Click on the ***>*** icon to expand the database objects view.
    ![](https://cxl.com/institute/wp-content/uploads/2021/03/image-19.png)
2. To create a table, right-click on ***Tables*** and select ***Create Table...***.
    ![](https://cxl.com/institute/wp-content/uploads/2021/03/image-20.png)

Similarly, you can create views, stored procedures or functions.


## Set up your preferred layouts, text fonts and accessibility of visual editor tabs in the Settings window.

1. Click on ***MySQLWorkbench*** > ***Preferences*** in the menu bar.
    ![](https://cxl.com/institute/wp-content/uploads/2021/03/image-21.png)
2. Set your coding and editor preferences.
    ![](https://cxl.com/institute/wp-content/uploads/2021/03/image-22.png)