AppCode 2023.1 Help

Connect to MySQL with named pipes

Named pipes provide a way for communication among processes that run on the same machine. By using named pipes, you can send your data without having the performance penalty that involves the network stack.

Just like you have a server that listens to an IP address and port for incoming requests, a server can also set up a named pipe that can listen for requests. In both cases, the client process must know the address or a pipe name to which it should send the request.

The default pipe name for the MySQL server is \\.\pipe\MySQL.


Step 1. Enable named pipes for the MySQL server

Verify that named pipes are enabled

  • To ensure that named pipes are enabled, run the following code: SHOW GLOBAL VARIABLES LIKE 'named_pipe'.

    If the named_pipe variable has the ON value, skip Step 1.

    Verify that named pipes are enabled

Enable named pipes during server installation

  1. Run the installation wizard of the MySQL server.

  2. On the Type and Networking dialog, select the Named Pipe checkbox. You can change the pipe name or leave the default value.

  3. Finish all the steps of the installation wizard and start the MySQL server.

    Enable named pipes during server installation

Enable named pipes in my.ini

  1. Open the my.ini configuration file in a text editor.

  2. Add the enable-named-pipe parameter to the mysqld section. Consider the following example of the mysqld section:

    [mysqld] # The next three options are mutually exclusive to SERVER_PORT below. # skip-networking enable-named-pipe # shared-memory # shared-memory-base-name=MYSQL # The Pipe the MySQL Server will use socket=MYSQL
  3. Save changes and restart the MySQL server.

How to find my.ini and my.cnf?

  • In the command line, run mysql --help. Scroll down to the end of the Options section.

    List of options and default settings location in the command line

Step 2. Configure a connection in AppCode

  1. In the Database tool window ( View | Tool Windows | Database), click the Data Source Properties icon The Data Source Properties icon.

  2. In the Data Sources and Drivers dialog, click the Add icon (The Add icon) and select MySQL.

  3. Check if there is a Download missing driver files link at the bottom of the data source settings area. As you click this link, AppCode downloads drivers that are required to interact with a database. The IDE does not include bundled drivers in order to have a smaller size of the installation package and to keep driver versions up-to-date for each IDE version.

    You can specify your drivers for the data source if you do not want to download the provided drivers. For more information about creating a database connection with your driver, see Add a user driver to an existing connection.

  4. On the Advanced tab, find the serverTimezone parameter in the list of options. Double-click the Value cell and type your server timezone (for example, UTC).

  5. Click the General tab.

  6. In the Host field, type the following text: (protocol=pipe)(path=\\.\pipe\MySQL), where MySQL is the pipe name.

    Alternatively, in the Connection type list, select Unix Socket and type or select the path to the pipe: \\.\pipe\MySQL.

  7. To ensure that the connection to the data source is successful, click the Test Connection link.

  8. (Optional) If you are connecting to a data source that contains a lot of databases and schemas, in the Schemas tab, select the schemas that you need to work with.

  9. Click OK to create the data source.

Integration with MySQL
Last modified: 21 February 2023