# RazorSQL

## Query, Edit, Browse, and Manage Databases

- razorsql.com
- Contact

# MySQL Connection Help

RazorSQL can connect to MySQL via either JDBC or ODBC. RazorSQL ships with JDBC drivers for MySQL. Users can connect via ODBC by setting up an ODBC data source for MySQL on their machine via the Windows data sources control panel. See below for more information on each of these connection types.

Another option for connecting is via the PHP bridge. The bridge allows users to connect to remote MySQL databases that do not allow remote access. This is often the case with web hosting providers. The web hosts provide access to the MySQL database, but only locally from the web server. See the link below for more information on the bridge.

Before trying the connection to MySQL, it should be noted that if you are connecting to MySQL from a remote machine, you will need to grant access to the user and host/ip address you are using to connect to MySQL. MySQL uses the HOSTS table to determine whether a connection is allowed. The following command can be used to grant a user access:
GRANT ALL PRIVILEGES ON [database_name].* to '[user]'@'[hostname]' identified by '[password]'

Connecting to MySQL via JDBC
Connecting to MySQL via ODBC
Connecting to MySQL via the PHP Bridge

## Connecting to MySQL via JDBC

RazorSQL provides two JDBC driver options for connecting to MySQL. RazorSQL ships with the MariaDB JDBC drivers that are compatible with both MySQL and MariaDB. This is the recommended way to connect to MySQL. RazorSQL does not ship with the MySQL JDBC Connector/J drivers because of licensing restrictions. However, RazorSQL provides an auto-install process that installs MySQL JDBC drivers with little input from the user. The version of the driver RazorSQL uses is the version most appropriate to be able to connect to the widest range of MySQL versions. If manually downloading the JDBC driver, you may want to pick the driver version most appropriate to your MySQL version.

The information needed to connect to MySQL via JDBC is the login information for your MySQL database, the host or ip address of the MySQL server, the port that MySQL is listening on (the default is 3306), and the name of the database you will be working with.

## Connecting to MySQL via ODBC

MySQL provides an ODBC driver that users can use to connect to MySQL from a Windows machine. An ODBC data source needs to be configured on the user's machine before connecting. ODBC drivers for MySQL can be downloaded from dev.mysql.com.

For more information about setting up an ODBC data source, see the following link:

ODBC Setup

## Manual MySQL JDBC Information

If manually configuring your connection for JDBC, see the following for JDBC driver class and JDBC URL format. Manual JDBC Information