# Install `Connector/J`

__*CLASSPATH and Connector/J*__
+ `Connector/J` version: 5.1.36 or later
+ Download the `Connector/J JAR`:
  + Deploy to **`$JAVA_HOME/lib/ext`**  
    + or
  + **`classpath`** settings 
    + Use the**`-cp`** option with **`java`** or **`javac`**, for example, in a Linux environment:
        + **`javac -cp .:mysql-connector-java-version.jar`** 
        + **`java –cp .:mysql-connector-java-version.jar`** 
      + or
    + Configure the **`CLASSPATH`** environment variable, for example, in a Linux environment:
        + **`export CLASSPATH=/path/to/mysql-connector-java-version.jar:$CLASSPATH`** 

------------------------------------------------------------
The TiDB server is compatible with MySQL 5.7, and it is recommended that the client use 5.1.36 or later

After extracting the Connector/J driver, you must tell the Java runtime environment where to find its JAR file. You can do this in one of two ways:

The simplest way is to copy the JAR file into /lib/ext in the Java installation directory. When you execute a Java program, this directory is checked automatically. 

Or you can specify the classpath by using one of the following methods:

Specify the –cp option when compiling or running your Java program.

Set the CLASSPATH environment variable. The second example in the slide shows how to do this.

Tools like Maven can simplify a lot regarding setting up classpath, but this course will not discuss Maven.
