Open topic with navigation

# Set Up a MySQL Database on Windows

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

To set up a MySQL HPE 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 HPE Media Server:

   1. Open the configuration or options file for the MySQL server (usually named `my.ini`).
   2. So that HPE 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 HPE Media Server installation directory. This script sets up the database schema that HPE 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 HPE 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 HPE 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. HPE 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 HPE Media Server to connect to the database (see Configure HPE Media Server).

© 2016 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close Send Documentation Feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm