Set Up a MySQL Database on Windows

To use Media Server with a MySQL database, you must download and install a MySQL server and ODBC driver, and configure Media Server to connect to the database through the driver.

To set up a MySQL Media Server database on Windows

  1. Download and install a MySQL server and MySQL Connector/ODBC (which contains the Unicode driver). During installation, set up a user account with superuser privileges. For instructions, refer to the MySQL documentation on www.mysql.com.

    NOTE:

    Once installed, the MySQL server appears in the Services tab in Windows Task Manager.

  2. Configure the database server for use with Media Server:

    1. Open the configuration or options file for the MySQL server (usually named my.ini).
    2. So that Media Server can send large amounts of binary data (images) to the database, set the configuration parameter max_allowed_packet=1073741824.
    3. Save and close the configuration file.
  3. Add the MySQL bin directory path to the PATH environmental variable.

    NOTE:

    This step enables you to use the command mysql to start the mysql command-line tool from the Windows Command Prompt. If the directory path is not added to the PATH variable, you must specify the mysql.exe file path in the Command Prompt to start psql.

  4. Open the mysql command line tool:

    1. In the Windows Command Prompt, run the command:

      mysql -u userName -p
    2. Enter your password when prompted.
  5. Run a CREATE DATABASE command to create a new database. Specify the following database settings.

    Database name Any name.
    Character set Must be Unicode–either UTF8 or UCS2.
    Collation Any that is compatible with the encoding.

    For example:

    CREATE DATABASE myDatabase CHARACTER SET utf8 COLLATE utf8_unicode_ci;
  6. Run the my.sql script provided in the Media Server installation directory. This script sets up the database schema that Media Server requires.

    1. Close the mysql command-line tool:

      quit
    2. In the Windows Command Prompt, run the following command:

      mysql -u userName -p -v -D databaseName -e "source path/my.sql"

      where,

      userName is the MySQL user name.
      databaseName is the name of the database you created in Step 2.
      path is the path to the my.sql file.
      NOTE:

      Running the script non-interactively from the terminal ensures that the script terminates if an error occurs.

    3. Enter your password when prompted.
  7. Grant privileges to the user that Media Server will connect as. Required privileges are:

    Database Create Temporary Tables
    All tables Select, Insert, Update, Delete
    All functions and stored procedures Execute

    If security is not a consideration, grant all privileges.

    1. Start the mysql command-line tool:

      mysql
    2. Run the GRANT commands:

      GRANT CREATE TEMPORARY TABLES ON databaseName.* TO userName;
      GRANT SELECT, INSERT, UPDATE, DELETE ON databaseName.* TO userName;
      GRANT EXECUTE ON databaseName.* TO userName;

      where,

      databaseName is the name of the database you created in Step 2.
      userName is the user name that Media Server will connect as.
    3. Close the mysql command-line tool:

      quit
  8. Open the Data Sources (ODBC) program:

    1. In the Windows Control Panel, click System and Security.

      The System and Security window opens.

    2. Click Administrative Tools.

      The Administrative Tools window opens.

    3. Double-click Data Sources (ODBC).

      The ODBC Data Source Administrator dialog box opens.

  9. In the User DSN tab, click Add... .

    The Create New Data Source dialog box opens.

  10. Select the MySQL ODBC Unicode driver from the list and click Finish.

    The MySQL Connector/ODBC Data Source Configuration dialog box opens.

  11. Complete the Connection Parameters fields:

    Data Source Name The data source name (DSN). Choose any string. Media Server can use this string to connect to the database server.
    Description

    An optional description for the data source.

    TCP/IP Server

    The IP address or hostname of the server that the database server is installed on.

    Port The port to use to communicate with the database server.
    User The user name to connect to the database server with.
    Password The password for the user account that connects to the database server.
    Database The name of the database that you created in Step 2.
  12. Click Test to test the connection.

    The Connection Test box opens containing a message describing whether the connection was successful. If the connection failed, use the information in the message to resolve any issues.

  13. Click OK to close the Connection Test box.

  14. In the MySQL Connector/ODBC Data Source Configuration dialog box, click OK to close the dialog box.

  15. In the ODBC Data Source Administrator dialog box, click OK to close the dialog box.

  16. You can now configure Media Server to connect to the database (see Configure Media Server).

_HP_HTML5_bannerTitle.htm