Installing MySQL in Windows

Install and configure a MySQL database

The following instructions are intended only for computers that are running Windows®.

Before you begin:

Download and install Microsoft® .NET Framework 3.5 or later from www.microsoft.com/downloads/.

  1. Download and run the latest Windows® MSI Installer Essentials for MySQL® Community Server 5.1 from www.mysql.com.
  2. In the setup wizard, click the Typical setup type and follow the instructions on the screen.
  3. Select the Configure MySQL Server now check box and click Finish.
  4. In the configuration wizard, follow the instructions on the screen and use the default configuration settings, except for the following settings:
    1. For the approximate number of concurrent connections to the server, click Online Transaction Processing (OLTP).
    2. For the default character set, click Best Support for Multilingualism.
    3. For the Windows options, click the Include Bin Directory in Windows PATH check box.
  5. If you plan on using the BlackBerry® Push Service SDK setup application on a computer other than the computer where you installed MySQL, perform the following actions:
    1. On the computer where you plan to run the setup application, download the Windows ZIP archive option for MySQL Community Server 5.1 from www.mysql.com and extract the files.
    2. In the location where you extracted the files, navigate to the bin folder and copy the filepath.
    3. Append the filepath that you copied to the value for the PATH environment variable.

Create a server instance

  1. Download and install the MySQL Workbench from www.mysql.com.
  2. On the Home screen for the MySQL® Workbench, in the Server Administration section, click New Server Instance.
  3. In the Create New Server Instance Profile wizard, follow the instructions on the screen and use the default configuration settings except for the settings described in steps 4-6.
  4. To specify the host machine for the database server, select the localhost option and click Next.
  5. To create the database connection, in the parameters tab, perform the following actions:
    1. Leave the values in the Hostname, Port, and Username field to the default values (localhost, 3306, and root).
    2. In the Password field, click Store In Vault and type the password that you specified when you installed and configured the MySQL database.
    3. Leave the Default Schema field blank.
    4. Click Next.
  6. To specify the operating system of the host machine, do the following:
    1. Select Windows.
    2. Select the Windows MySQL 5.1 Installer Package that's applicable to you.
  7. On the Complete Setup screen, type pushsdk or any desired name for the server instance.

Configure the server instance

  1. On the Home screen for the MySQL® Workbench, in the Server Administration section, double-click the server instance you created.
  2. On the Configuration tab, click the Advanced tab.
  3. Select the SQL Mode check box.
  4. To have the database behave like a traditional SQL database management system, replace the existing content of the field with "TRADITIONAL".
  5. Click Apply twice.
  6. On the Startup tab, click Stop Server.
  7. When the Run As prompt appears, clear the Protect my computer and data from unauthorized program activity check box and click OK.
  8. After the server stops, click Start Server to allow the new configuration to take effect.
  9. When the Run As prompt appears, clear the Protect my computer and data from unauthorized program activity check box and click OK.

Create the database schema

  1. On the Home screen for the MySQL® Workbench, in the SQL Development section, double-click the database connection that you created when you created the server instance for the database.
  2. Right-click the Object Browser section, and click Create Schema.
  3. In the Name field, specify a schema name (for example, pushsdk).
  4. In the Collation drop-down list, select a default collation type. If you use UTF-8, for a case sensitive collation type, specify utf8_bin. For a case-insensitive collation type, specify utf8_general_ci.
  5. Click Apply twice.
  6. Click Finish to apply the changes to the server instance.
  7. To close the new_schema window, click Close.

Create a user account for the database schema

The user account that you set up in this task is the user account that you use to access the database tables through a Push Initiator.

  1. On the Home screen for the MySQL® Workbench, in the Server Administration section, double-click the server instance that you created.
  2. Click the Accounts tab and click Add Account.
  3. Click the Login tab and specify a login name and password for the user.
  4. In the Limit Connectivity to Hosts Matching field, type one or more names and host machines that the user can connect from (for example, localhost).
  5. Click Apply.
  6. On the Schema Privileges tab, in the Users column, click the user account you created.
  7. Click Add Entry.
  8. In the Host section, select the Selected host option.
  9. In the Selected Host drop-down list, click the host machine that you want to define the privileges for (for example, localhost).
  10. In the Schema section, select the Selected schema option.
  11. In the Selected schema list, click the database schema that you created and that you want to define the privileges for.
  12. Click OK.
  13. Click Select "ALL" to assign the user all privileges for this database schema.
  14. Click Save Changes.

Create a new connection to the database schema

  1. On the Home screen for the MySQL Workbench, in the SQL Development section, click New Connection.
  2. In the Connection Name field, type a name for the connection.
  3. In the Hostname field, type the name of the host machine that the server instance is installed on (for example, localhost).
  4. In the Port field, type 3306.
  5. In the Username field, type the username of the user that you created for the database schema.
  6. In the Password field, click Store In Vault.
  7. Type the password of the user that you created for the database schema.
  8. In the Default Schema field, type the name of the database schema that you created.
  9. Click OK.

Was this information helpful? Send us your comments.