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
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.
Connect To Local Database
Create Database
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`)
)
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');
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.
This password is your login password of the remote server.
Click OK
to add fingerprint.
This password is MySQL password on your remote server.
More explaination could be found in the References.