Contact us Login LIVE DEMO FREE TRIAL

Deployment of databases

Databases

Databases server

  • Version: MySQL Server 5.5.x, see preparation for deployment
  • MySQL has to be started at a start of the operating system and must work constantly
  • For convenience you can add the .my.cnf file to the user’s home directory with the following contents:
      [client]
      user = root
      password = secretpass

    It allows to connect as root to MySQL without entering the password

  • Time zones have to be imported. Documentation at MySQL’s site: http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html In Linux timezones can be imported using mysql_tzinfo_to_sql utility:
  $ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p<PASSWORD> mysql

To use UTC timezone add line to /etc/my.cnf (this is VERY important for normal functioning of application):

default-time-zone      ='UTC'

in [mysqld] section.
And restart the MySQL instance:

/etc/init.d/mysql restart

You can check settings with the following commands in mysql:

  select now(); -- should return the current time in UTC
  SET time_zone = 'Europe/Moscow';
  select now(); -- should return the current time in Moscow
  • sql-mode STRICT_TRANS_TABLES must be turned off.

Databases deployment

Debian

  1. Change directory to dist/db
     $ cd dist/db
  2. Run configuration script config.sh
     $ ./config.sh
     Password for MySQL user 'java': 'pass1'
     Password for MySQL user 'api-user': 'pass2'
     service_id = 1
     service_pass = 'pass3'

    Thus the script generate and insert password to sql scripts. Configuration will be saved in file config (can be saved in other place). Passwords pass1, pass2 and pass3  will be printed, keep in mind because these data will need for further installation. To read previously generated passwords execute the script again.

    If you want to regenerate password run script again with  ‘-f’ option:

     $ ./config.sh -f
  3. Start an init-db.sh script and enter root’s password
     $ ./init-db.sh
     Enter mysql user name [root]:
     Enter mysql user password:
     Initializing db..
     Successful finished.

    The script create DBs (google and tracking schemes will be created), users (java and api-user) and also make initializing of databases.

    If some errors occured during the script is working, before restarting the script, you must fix problems and manually remove already created DBs and MySQL users schemes. Something like this:

     DROP SCHEMA google;
     DROP SCHEMA tracking;
     DROP USER 'java'@'localhost';
     DROP USER 'api-user'@'localhost';

Under Windows or if the previous way doesn’t work (Manual way)

  1. Generate 3 passwords using, for instance, apg utility: $JAVA_PASS, $API_PASS and $SERVICE_PASS.
  2. Create google and tracking schemes, executing the following MySQL commands:
     CREATE DATABASE google CHARACTER SET utf8 COLLATE utf8_general_ci;
     CREATE DATABASE tracking CHARACTER SET utf8 COLLATE utf8_general_ci;
  3. Load a skeleton of databases
    $ mysql < db/google.sql 
    $ mysql < db/models.sql
    $ mysql < db/panel_rights.sql
    $ mysql < db/operators.sql
    $ mysql < db/codes.sql
    $ mysql < db/plugins_records.sql
    $ mysql < db/quartz_tables_mysql_innodb.sql
  4. Create java and api-user with passwords that have been kept in mind earlier $JAVA_PASS and $API_PASS:
     CREATE USER 'java'@'localhost' IDENTIFIED BY '$JAVA_PASS';
     GRANT USAGE ON *.* TO 'java'@'localhost'
       WITH MAX_QUERIES_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
     GRANT SELECT, INSERT, UPDATE, DELETE, TRIGGER, CREATE VIEW, SHOW VIEW, EXECUTE, LOCK TABLES
       ON `tracking`.* TO 'java'@'localhost';
     GRANT SELECT, INSERT, UPDATE, DELETE, TRIGGER, CREATE VIEW, SHOW VIEW, EXECUTE, LOCK TABLES
       ON `google`.* TO 'java'@'localhost';
    
     CREATE USER 'api-user'@'localhost' IDENTIFIED BY '$API_PASS';
     GRANT USAGE ON *.* TO 'api-user'@'localhost'
       WITH MAX_QUERIES_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
     GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, TRIGGER, CREATE VIEW, SHOW VIEW, EXECUTE, DROP, ALTER, LOCK TABLES
       ON `tracking`.* TO 'api-user'@'localhost';
     GRANT SELECT, INSERT, UPDATE, DELETE, TRIGGER, CREATE VIEW, SHOW VIEW, EXECUTE, LOCK TABLES
       ON `google`.* TO 'api-user'@'localhost';
  5. Add a service to the db with the corresponding password($SERVICE_PASS):
     INSERT INTO `google`.`services` VALUES ('1', '$SERVICE_PASS', 'Standalone', '', 'Standalone', '0.00', '', '', '', '', 'Active', 'service');

If you have more questions please contact our support team

Contacts

USA: +1 858 815 9045

Mexico: +52 334 1642158

UK: +44 808 1641499

Germany: +49 1573 5988250

Russia: +7 495 223 0427

Log in

Login

[clean-login]

CLOSE
Register

[clean-login-register]

CLOSE
Loading...