This documentation is for WSO2 IoT Server 3.1.0. View the documentation for the latest release.
Page Comparison - Setting up MySQL (v.3 vs v.4) - IoT Server 3.1.0 - WSO2 Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download and install MySQL on your computer. 

    Info

    For instructions on installing MySQL on MAC OS, go to Homebrew.

    Code Block
    sudo apt-get install mysql-server mysql-client
  2. Start the MySQL service. If you are using Linux, use the following command:

    Code Block
    sudo /etc/init.d/mysql start
  3. Log in to the MySQL client as the root user (or any other user with database creation privileges).

    Code Block
    mysql -u root -p
  4. Enter the password when prompted.

    Info

    In most systems, there is no default root password. Press the Enter key without typing anything if you have not changed the default root password.

  5. In the MySQL command prompt, create the database using the following command:

    Code Block
    create database <DATABASE_NAME>; 

    For example: 

    Code Block
    create database regdb;
    Info
    titleAbout using MySQL in different operating systems

    For users of Microsoft Windows, when creating the database in MySQL, it is important to specify the character set as latin1. Failure to do this may result in an error (error code: 1709) when starting your cluster. This error occurs in certain versions of MySQL (5.6.x) and is related to the UTF-8 encoding. MySQL originally used the latin1 character set by default, which stored characters in a 2-byte sequence. However, in recent versions, MySQL defaults to UTF-8 to be friendlier to international users. Hence, you must use latin1 as the character set as indicated below in the database creation commands to avoid this problem. Note that this may result in issues with non-latin characters (like Hebrew, Japanese, etc.). The database creation command should be as follows:

    Code Block
    mysql> create database <DATABASE_NAME> character set latin1;

    For users of other operating systems, the standard database creation commands will suffice. For these operating systems, the database creation command should be as follows:.

    Code Block
    mysql> create database <DATABASE_NAME>;
  6. Give authorization of the database to the regadmin user as follows:

    Code Block
    GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin";
  7. Once you have finalized the permissions, reload all the privileges by executing the following command:

    Code Block
    FLUSH PRIVILEGES;
  8. Log out from the MySQL prompt by executing the following command:

    Code Block
    quit;

...