Connect To Local/Remote Database And Create Data With MySQL Workbench

Show you how to connect database and create data with MySQL Workbench step by step

Mia
3 min readJul 31, 2020

Install MySQL Workbench

If you don’t have MySQL Workbench, please download here. Double click the DMG file to open and follow the instructions to install.

Download MySQL Workbench

Connect To Local Database

Connect to local database
Connection settings

Create Database

Create a new schema
Create a new schema
Create successful

Create a student table in the Query 1 file:

use tomcat_test;
CREATE TABLE `student` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`student_name` varchar(30) DEFAULT NULL,
`student_gender` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
)
Create Student table query
Execute the query
Create successful

Insert some data into student table, still using Query 1 file or you can create a new file:

use tomcat_test;
INSERT INTO student VALUES(1, 'Ariana', 'Female');
INSERT INTO student VALUES(2, 'Shawn', 'Male');
INSERT INTO student VALUES(3, 'Taylor', 'Female');
INSERT INTO student VALUES(4, 'Billie', 'Female');
Insert data query
Select data query

Connect To Remote Database

Please refer to this tutorial.

Why I use Standard TCP/IP over SSH instead of Standard TCP/IP method? Because I close my 22 port on my remote server and use another port for connection.

Create a new connection

This password is your login password of the remote server.

Test Connection

Click OK to add fingerprint.

Test Connection

This password is MySQL password on your remote server.

Test Connection
Test Connection

More explaination could be found in the References.

References

--

--