Mariadb Installation

1. Install Mariadb 10.11 server in new rhel9 destination server.

                Create MariaDB.repo under /etc/yum.repos.d   with the below data.



 

# MariaDB 10.11 RedHatEnterpriseLinux repository list - created 2024-02-22 10:17 UTC

# https://mariadb.org/download/

[mariadb]

name = MariaDB

# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.

# baseurl = https://rpm.mariadb.org/10.11/rhel/$releasever/$basearch

baseurl = https://mirrors.gigenet.com/mariadb/yum/10.11/rhel/$releasever/$basearch

# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB

gpgkey = https://mirrors.gigenet.com/mariadb/yum/RPM-GPG-KEY-MariaDB

gpgcheck = 1

 

2. After the file is in place, install and start MariaDB with:

                sudo dnf install MariaDB-server MariaDB-client

3. You can start the service and check the status.

systemctl enable mariadb.service --now



                systemctl status mariadb



It should show Active running.

4. Loginto the Mariadb server with empty password and set the password.

                




cmd 1: alter user 'root'@'localhost' identified by "Password";

cmd 2: flush privileges;

 

Relogin with new password to verify.

Now do the Mariadb configuration as per current environment.

1.      Stop the mariadb service

a.      systemctl stop mariadb

2.      Take the backup of mariadb configuration file.

Path to server.cnf:

cd /etc/my.cnf.d/

 



3.      Paste below variables in the server.cnf file under [mysqld] section.

Note: Don’t change datadir, socket and pid-file values

 

[mysqld]

server-id = 1

sql_mode=ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

 

user=mysql

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

symbolic-links=0

skip-name-resolve

open_files_limit=2430

default-storage-engine=MyISAM

skip-innodb

low_priority_updates=1

expire_logs_days=3

log-warnings = 2

log-error=/var/lib/mysql/mariadb_err_CREDORDADMDB.log

ft_min_word_len=3

sort_buffer_size=1M

join_buffer_size=32M

read_buffer_size=1M

read_rnd_buffer_size=4M

myisam_sort_buffer_size=64M

tmp_table_size=64M

key_buffer_size=256M

thread_cache_size=16K

query_cache_size=16M

max_allowed_packet=256M

max_connections=256

4.      Start the service and make sure it should be Active running.

systemctl start mariadb

systemctl status mariadb

 

5.      Now create Application user (cbcecred_newcred), dev_reader users

 

CREATE USER `appuser`@`%` IDENTIFIED BY  ‘password’;

 

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, EXECUTE, SHOW VIEW ON `db_name`.* TO `appuser`@`%`;


CREATE USER `dev_reader`@`%` IDENTIFIED BY  ‘password’;

grant select,show view on db_name.* to 'dev_reader';

flush privileges;


Comments

Popular Posts