What is MySQL JDBC connection string?
Syntax
Here is the generic syntax MySQL JDBC connection string:
jdbc:mysql://host:port/database_name
- Host can be an IPv4 or an IPv6 host name string. When not specified, a localhost will be used.
- Port is the listening port number of MySQL, the default port is 3306, and it is 33060 for a connection using the X Protocol. When not specified, the default port will be used.
- If you do not specify the database you want to connect, the connection is made with no default database.
Example
Connecting to a MySQL database at localhost, default listening port 3306, and the database name is employees, the JDBC connection string will be:
jdbc:mysql://localhost:3306/employees
Need a good GUI tool for databases? TablePlus provides a native client that allows you to access and manage Oracle, MySQL, SQL Server, PostgreSQL and many other databases simultaneously using an intuitive and powerful graphical interface.
Not on Mac? Download TablePlus for Windows.
Need a quick edit on the go? Download for iOS