5.1.1 Procedure 3: Installing the Application

Table 5-1 Procedure 3: Installing the Application

STEP # This procedure installs the MySQL application on the server.Check off (✓) each step as it is completed. Boxes have been provided for this purpose under each step number. SHOULD THIS PROCEDURE FAIL, CONTACT MY ORACLE SUPPORT AND ASK FOR ASSISTANCE.

1.

☐

Linux server: Create the DB administrator user

Login on query server as root user.

# cd /usr/sbin
# ./groupadd -g 1007 mysql
# ./useradd -u 1001 -g 1007 -s /bin/sh mysql
# passwd mysql
passwd:	Changing password for mysql
New password: <password for the mysql user>
Re-enter password: <password for the mysql user>

2.

☐

Linux server: Create mysql1 directory if not

exists

# mkdir /usr/mysql/mysql1

Note: If mysql directory exists in /usr directory, directly create mysql1 directory, otherwise create mysql directory if not exists, then create mysql1 directory.

3.

☐

Linux server: If Installing MySQL using DVD, otherwise skip this step

Insert the Installation Media into the DVD drive of Linux server. Run the following command:

# cd /cdrom/cdrom0

Go to step 5.

4.

☐

Linux server: Mount the ISO if installing MySQL using ISO

First copy the MySQL iso to /tmp directory of query server. Run the following commands:

# mkdir /mnt/iso
# mount -o loop <Name of ISO> /mnt/iso

Example:

# mount -o loop LSMSQS.linux-14.1.0.0.0_141.3.0.iso /mnt/iso
Output similar can be expected and ignored:
mount: /mnt/iso: WARNING: device write-protected, mounted read-only.

5.

☐

Linux server: Install MySQL package

# cd /mnt/iso
# ./install_mysql_linux

Output similar to the following displays:

Performing installation of MySQL commercial version 8.4

6.

☐

Linux server:

Copy .sql files to create DB and

Tables on Query

server

# cp *.sql /usr

7.

☐

Linux server: Unmount the ISO if installed

MySQL using ISO. Otherwise skip this step

After completing the installation of MySQL, unmount the iso:

# cd /
# umount /mnt/iso

8.

☐

Linux server: Eject the media if installed MySQL using DVD. Otherwise skip this step

After completing the installation of MySQL, eject the DVD and return the media to its case:

# cd /
# eject cdrom

9.

☐

Linux server: Check ownership and permissions of mysql1 directory

#

If the ownership is anything other than mysql:mysql, change it using the following command:

# chown mysql:mysql /usr/mysql/mysql1

If the permission is anything other than 755, change it using the following command:

# chmod 755 /usr/mysql/mysql1

Verify once more that the ownership has been changed.

# ls -ltr /usr

10.

☐

Linux server :

Modify MySQL configuration file

# vi /etc/my.cnf

Remove the content of my.cnf and copy the following in my.cnf.

# The following options will be passed to all MySQL
# clients
[client]
port = 3306
socket = /tmp/mysql.sock
default-character-set = latin1
[mysqld]
datadir = /usr/mysql/mysql1
port = 3306
socket = /tmp/mysql.sock
server-id = 4
max_allowed_packet = 1M
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
#query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
#thread_concurrency = 8
default-storage-engine=myisam
default_tmp_storage_engine=myisam
character-set-server = latin1
log-error
log_error_verbosity=3
net_read_timeout=30
max_allowed_packet=32M
replica_net_timeout=120
replica_skip_errors=1062
replicate-ignore-db=ResyncDB
replicate-wild-ignore-table=ResyncDB.%
replicate-ignore-db=logDB
replicate-wild-ignore-table=logDB.%
#replicate-ignore-db=supDB
replicate-ignore-table=supDB.DbConfig
replicate-wild-ignore-table=supDB.%Key
replicate-ignore-table=supDB.LsmsUser
replicate-ignore-table=supDB.LsmsUserSpid
replicate-ignore-table=supDB.Authorization
replicate-ignore-table=supDB.EbdaProcessList
replicate-wild-ignore-table=supDB.%Measurements
replicate-ignore-table=supDB.AlarmFilter
replicate-ignore-table=supDB.AlarmInfo
replicate-ignore-table=supDB.EmsInterface
replicate-ignore-db=mysql
replicate-wild-ignore-table=mysql.%
replicate-ignore-db=ReplTestDB
replicate-wild-ignore-table=ReplTestDB.%
replicate-ignore-db=performance_schema
replicate-wild-ignore-table=performance_schema.%
replicate-ignore-db=information_schema
replicate-wild-ignore-table=information_schema.%
explicit_defaults_for_timestamp
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
relay-log=queryserver-relay-bin
sql-mode='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'
#default_authentication_plugin=mysql_native_password 
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

Note:

  • The following tables and Databases can be ignored depending upon user requirements.

    #replicate-ignore-db=ResyncDB
    #replicate-wild-ignore-table=ResyncDB.%
    #replicate-ignore-db=supDB
    #replicate-ignore-table=supDB.DbConfig
    #replicate-ignore-table=supDB.LsmsUser
    #replicate-ignore-table=supDB.LsmsUserSpid
    #replicate-ignore-table=supDB.Authorization
    #replicate-ignore-table=supDB.EbdaProcessList
    #replicate-ignore-table=supDB.AlarmFilter
    #replicate-ignore-table=supDB.EmsInterface
    replicate-ignore-db=performance_schema
    #replicate-wild-ignore-table=performance_schema.%
  • Rest of the measurement tables that are ignored by default will remain ignored. Those cannot be included even if user wants to. If the user wants to wants to replicate those tables, remove or comment out only the line: replicate- ignore-table=supDB.%Measurements from my.cnf file. The Replication DB is also ignored.To include the database, remove or comment out only the line: replicate-ignore-db=ResyncDB from my.cnf file. When these are done, the customer must get new snapshots every time any OCELAP is added to the OCLSMS system.

  • Modify the text or statement as per your choice.

11.

☐

Linux server : Set permissions of my.cnf file

Run the following command to set the permissions of my.cnf.

# chmod 644 /etc/my.cnf

12.

☐

Linux server: Change ownership and permissions of files in mysql1

Make sur /usr/mysql/mysql1 directory is empty:

# ls -lrt /usr/mysql/mysql1/
If the above command gives any output run below command
# rm -rf /usr/mysql/mysql1/*

13.

☐

Linux server : Initialise database

# su mysql
# cd /usr/bin
# /usr/sbin/mysqld --initialize --datadir=/usr/mysql/mysql1/ --skip-mysqlx

Note: WARNING observed: Could not write to config file /usr/my-new.cnf: Permission denied in case of linux machine. This error can be ignored.

# exit

14.

☐

Linux server: Stop MySQL if

running

  • Check if mysql process is running:

    # ps -ef | grep mysql

  • If it is not running, directly go to next step of this procedure. If it is running, stop MySQL.

    # cd /usr/bin
    # ./mysqladmin shutdown -p
    # Enter password:
    # <Query server's MySQL root user password>

If the password is unknown, use the following command:

# kill <pid of mysqld_safe> <pid of mysqld>

Verify that no MySQL process is running using the following command:

# ps -eaf | grep mysql

15.

☐

Linux server:

Reset the password

  • Change to directory /usr/bin

    # cd /usr/bin

  • Reset the password using the following commands:

    # su mysql
    # /usr/sbin/mysqld --skip-grant-tables &
    # ./mysql
    mysql> FLUSH PRIVILEGES;
    mysql> alter user root@localhost identified by '<Enter password>';
    mysql> UPDATE mysql.user SET password_expired = 'N' WHERE USER = 'root';
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)
    mysql> exit;
  • Stop MySQL.

    # ./mysqladmin shutdown -p
    # Enter password:
    # <Query server's MySQL root user password>

If unable to shutdown mysql using above command, use the following command:

# kill <pid of mysqld_safe> <pid of mysqld>

  • Restart MySQL

    # /usr/sbin/mysqld --basedir=/usr --skip-replica-start
    &

16.

☐

Linux server : Installation Complete

Installation and configuration are now complete. Go to next step in Table 5.

End of Procedure

THIS COMPLETES THE INSTALLATION