Configuring MySQL

To set up and use MySQL for Push delivery, follow the instructions below, skipping the steps you have already completed. We are going to use Debian and Ubuntu Linux distributions for our examples, but the principles apply to any operating system:

  1. Update your operating system. Refer to your system's specific instructions for this step. Debian and Ubuntu users can do it using:

    sudo apt-get update

  2. Install MySQL on your system. The exact commands used for that purpose will differ from one operating system to another. Debian and Ubuntu users will issue the following command:
    sudo apt-get install mysql-server

    Unless you want to build a custom installation of MySQL, do not build MySQL from the sources. Use system-specific MySQL packages instead. For more help, refer to your system's documentation and the MySQL installation guide.

    If the installation fails, check that your OS update was successful and try again.

  3. Add the following line to /etc/my.cnf:

    port = 3306

    The port parameter can be set to other values, as long as they fall within the allowed TCP port range (1-65535, but not 0). If the default port 3306 cannot be used, set it to any value from 1024 to 65535 that is not used.

  4. Set MySQL to listen on DataSift's Push IP addresses by editing /etc/my.cnf.

    Alternatively, you can set it to listen on any address by adding this line to /etc/my.cnf:

    bind-address = 0.0.0.0

  5. Save the changes and restart MySQL:

    sudo /etc/init.d/mysqld stop && sudo /etc/init.d/``mysqld`` start

  6. Check that MySQL is working and that you can reach it from the outside. You can do that with telnet on a computer connected to the public internet:

    telnet mysql.example.com:3306

    The server should respond with a message similar to the one shown below:

    Connected to db.example.com. Escape character is '^]'.

  7. Type the following command:

    ping

  8. Hit the Enter/Return key. The server should respond with the following message:

    +PONG

    This confirms that you can send commands to a remote MySQL server and receive responses.

  9. Type the following command:

    quit

  10. Hit the Enter/Return key. The server should respond with the following message:

    +OK

    The telnet client will then exit with the following message:

    Connection closed by foreign host.