Primary Server

On your Primary server, perform the following actions:

  1. Install both the “mariadb” and “mariadb-server” rpm packages if they do not exist on your system.

Apply any required dependencies as well

# yum install mariadb mariadb-server

  1. Verify that your local disk partition is still mounted at /datakeeper/lib/mysql via the “df” command
  1. If this is a fresh MySQL install, initialize a sample MySQL database:

# /usr/bin/mysql_install_db --datadir=/datakeeper/lib/mysql --user=mysql

  1. Ensure that all files in your MySQL data directory (/datakeeper/lib/mysql) have correct permissions and ownership

 # chown -R mysql:mysql /datakeeper/lib/mysql

# chmod 755 /datakeeper/lib/mysql

  1. Finally, manually start the MySQL daemon from the command line.

# mysqld_safe --user=mysql --socket=/datakeeper/lib/mysql/mysql.sock --port=3306 --datadir=/datakeeper/lib/mysql &

  1. Verify MySQL is running by connecting with the mysql client:

To specify the socket run the following command.

mysql --socket=/datakeeper/lib/mysql/mysql.sock

[root@LinuxPrimary mysql]# mysql

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 1

Server version: 5.5.68-MariaDB MariaDB Server

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)] > exit

Bye

[root@LinuxPrimary mysql]#

  1. Perform the following steps.

a. Launch mysql, using mysql, with the following command: mysql mysql --socket=/datakeeper/lib/mysql/mysql.sock

b. Inside of the program ran: update user set Password=PASSWORD (‘<new password>’) where User=’root’

c. Then ran: flush privileges;

  1. Verify your new password:

# mysql mysql --socket=/datakeeper/lib/mysql -u root -p

(Enter new password.)

#exit

  1. Create a MySQL configuration file. We will place this in the same shared directory (/datakeeper/lib/mysql/my.cnf)

# vi /datakeeper/lib/mysql/my.cnf

Example

# cat /datakeeper/lib/mysql/my.cnf

[mysqld]

datadir=/datakeeper/lib/mysql

socket=/datakeeper/lib/mysql/mysql.sock

pid-file=/datakeeper/lib/mysql/mysqld.pid

user=root

port=3306

# Default to using old password format for compatibility with mysql 3.x

# clients (those using the mysqlclient10 compatibility package).

old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;

# to do so, uncomment this line:

# symbolic-links=0

[mysqld_safe]

log-error=/datakeeper/log/mysqld.log

pid-file=/datakeeper/run/mysqld/mysqld.pid

[client]

user=root

password=new password

  1. Delete the original MySQL configuration file, located in /etc

# rm /etc/my.cnf

Secondary Server

On your Secondary Server:

  1. Install both the “mariadb” and “mariadb-server” rpm packages if they do not exist on your system.

Apply any required dependencies as well

# yum install mariadb mariadb-server

  1. Delete the original MySQL configuration file, located in /etc

# rm /etc/my.cnf

  1. There is no need to perform any of the additional steps taken on the Primary Server.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment