[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[],[],null,["# Unpackaged JDBC drivers\n\n| The instructions on this page apply to customer-hosted Looker deployments only. For Looker-hosted deployments, your Looker instance should be pre-configured for you. If you see any problems, reach out to your Looker analyst.\n| **These instructions are intended to be used only with the dialects that are specified in the following table. They are not intended to be used to install any other unsupported JDBC drivers into Looker to connect to other databases.** Attempts to install JDBC drivers other than the listed drivers may not work and are not eligible to receive technical support from Looker.\n\nConfiguring Looker to use unpackaged JDBC drivers\n-------------------------------------------------\n\nFor some of [Looker's supported dialects](/looker/docs/dialects#setting_up_your_database), the JDBC driver cannot be packaged in the Looker JAR file for licensing-related reasons. In these cases, you must install the JDBC driver on your Looker server and then configure Looker to register the unpackaged driver as described on this page.\n\nAll dialects with a value of \"No\" under \"Supported?\" require unpackaged JDBC driver installations:\n\nPrerequisites\n-------------\n\nTo connect Looker to a database that requires an unpackaged JDBC driver, you will need the following:\n\n- Command line access to your Looker server.\n- The JDBC driver as a JAR file. The dialect's specific documentation may have instructions on where to download this file; otherwise, it is assumed that you have access to the JAR file needed.\n- The **driver symbol** for your dialect. A driver symbol is a string value that Looker uses internally to match the dialect to the driver. The examples on this page use the generic value `driver_symbol`. See the Looker documentation for each dialect for the symbols that Looker uses to register JDBC drivers to dialects.\n- The YAML **driver entry** for your dialect to be added to the `custom_jdbc_config.yml` configuration file. See the [Driver entries in the YAML configuration file](#driver_entries) section on this page for more information.\n\n### Driver entries in the YAML configuration file\n\nHere is an example [driver entry](#prerequisites) in the `custom_jdbc_config.yml` file: \n\n - name: driver_symbol\n dir_name: driver_symbol\n module_path: com.dialect.jdbc.DialectDriver\n override_jdbc_url_subprotocol: driver_subprotocol # optional\n\nWhen writing the driver entry for your dialect:\n\n- The file `custom_jdbc_config.yml` is YAML-based, which means that indentation and spacing matter.\n- The `name` and `dir_name` attributes must be the driver symbol that Looker uses for your dialect when registering JDBC drivers.\n- It is possible to use the attribute `file_name` instead of `dir_name` containing the relative path from `custom_jdbc_drivers` to the JDBC driver JAR file. `dir_name` is recommended because it promotes keeping multiple drivers isolated to their own directories and reduces the chance of Java classes colliding.\n- The `module_path` property will depend on the specific JDBC driver. It should be the fully qualified path to the Java *driver class* . This example uses a generic value, but to find the specific `module_path` the driver uses consult its documentation on how to *register* the driver class.\n- The `override_jdbc_url_subprotocol` is an optional argument that is used to override the subprotocol that is used in the JDBC string that Looker sends to the database. A typical JDBC string will look like this:\n\n jdbc:mysql://localhost:3306/database_name[?propertyName1][=propertyValue1]\n\nWhere `mysql` is the JDBC subprotocol being used.\n\nIf you specify `override_jdbc_url_subprotocol: driver_subprotocol`, then this JDBC string will become: \n\n jdbc:driver_subprotocol://localhost:3306/database_name[?propertyName1][=propertyValue1]\n\nThis option is required if you need to use an unpackaged JDBC driver that requires a URL subprotocol other than Looker's default URL subprotocol. For the most part, this is not necessary unless the dialect's documentation explicitly says that it is. [MongoBI](/looker/docs/db-config-mongodb) is an example of a dialect that requires this option.\n\nInstalling unpackaged JDBC drivers\n----------------------------------\n\n1. Change to the Looker application base directory. This example uses `looker` the as the base directory.\n\n cd looker\n\n2. Create a directory called `custom_jdbc_drivers`. This is the top-level directory for all unpackaged JDBC driver installations. The path to this directory should be `looker/custom_jdbc_drivers`\n\n mkdir custom_jdbc_drivers\n\n3. In the `custom_jdbc_drivers` directory, create a subdirectory named with your dialect's [driver symbol](#looker_driver_symbols). This example uses the generic value `driver_symbol`. The resulting path to the directory will look like `looker/custom_jdbc_drivers/driver_symbol`\n\n cd custom_jdbc_drivers\n mkdir driver_symbol\n\n4. Place the JDBC driver files for your dialect into this directory. The method for this depends on where your dialect's driver can be found and uploaded onto the server, but be sure that the relevant JAR file(s) are inside the `driver_symbol` directory: `looker/custom_jdbc_drivers/driver_symbol/`\n\n For example: `looker/custom_jdbc_drivers/driver_symbol/DialectDriver.jar`\n \u003e How you move the necessary files onto the Looker server will vary based on where you get the driver files and your preference for file transferring. Examples of commands for transferring files into this directory include `wget`, `scp`, and `curl`.\n5. Change the directory to the Looker application directory, and create a configuration file named `custom_jdbc_config.yml`. The path to this file should be `looker/custom_jdbc_config.yml`. This file will contain the information that Looker needs to locate and register the custom JDBC driver.\n\n cd looker\n vim custom_jdbc_config.yml\n\n6. Add a new entry for your dialect into the `custom_jdbc_config.yml` configuration file. See the [Driver entries in the YAML configuration file](#driver_entries) section on this page for information on driver entries.\n\n - name: driver_symbol\n dir_name: driver_symbol\n module_path: com.dialect.jdbc.DialectDriver\n\n7. Create or update the file [`lookerstart.cfg`](/looker/docs/startup-options) so that the Looker application starts up with the unpackaged JDBC driver configuration. The path to this file should be `looker/lookerstart.cfg`. Add the option `--use-custom-jdbc-config`. If there are other options, append this to the end of the Looker startup options:\n\n LOOKERARGS=\"--use-custom-jdbc-config\"\n\n \u003e If you have `LOOKERARGS` set somewhere other than `lookerstart.cfg`, like in an environment variable, you may add this startup flag there. Alternatively, you can set `LOOKERARGS=\"${LOOKERARGS} --use-custom-jdbc-config\"` so that the existing values will be expanded into this file.\n8. Restart the Looker application. In this command, use the name of your Looker startup script, such as `./looker` or `./looker.sh`\n\n ./looker restart\n\n or\n `none\n ./looker stop\n ./looker start`\n\n### Multiple unpackaged JDBC drivers\n\nIf you need to configure more than one dialect to use unpackaged JDBC drivers, the process described in the [Installing unpackaged JDBC drivers](#installing_custom_jdbc_drivers) section still applies. The `custom_jdbc_drivers` directory will have multiple `dialect` subdirectories with their own driver JARs, and the `custom_jdbc_config.yml` file will have multiple entries: \n\n ls looker/custom_jdbc_drivers\n\n driver_symbol_1 driver_symbol_2\n\n ls looker/custom_jdbc_drivers/driver_symbol_1\n\n Dialect1Driver.jar\n\n - name: driver_symbol_1\n dir_name: driver_symbol_1\n module_path: com.dialect.jdbc.Dialect1Driver\n\n - name: driver_symbol_2\n dir_name: driver_symbol_2\n module_path: com.dialect.jdbc.Dialect2Driver"]]