Monday, August 21, 2023

MySQL DB Creation using rpm method not using repo

Steps to perform fresh install of MySQL in CentOS (applicable to RHEL or Oracle Linux as well) x64

1) Collect the basic details as to what are you trying to do?


a. Install MySQL?
Ans: Yes
b. With vendor support or community edition?
Ans: Community edition
c. Which version?
Ans: 8.0.x
d. Which platform?
Ans: Centos 7.x x64 (RHEL or OEL)
e. Is the candidate MySQL under support now and is supported in the candidate platform?
Ans: Yes
f. How do you want to install?
Ans: rpm

2) Based on the option chosen:


a. rpm based install
1. Download the rpms from (by choosing the corresponding options) https://dev.mysql.com/downloads/mysql/
b. Transfer the rpms thus downloaded to the server (either do a winscp or share it via NAS)
c. Decompress and untar the rpm files
d. Install the rpms as shown below...

Prereqs: libaio

sudo yum install mysql-community-{server,client,client-plugins,icu-data-files,common,libs}-*

note: if installing as root, skip sudo command.

Actual Install log:

root@vcentos79-postgres-1:/tmp/mysql-rpm-bin[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr
total 2015240
-rw-r--r--. 1 7155 31415   16755300 Jun 25 04:06 mysql-community-client-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415    3745824 Jun 25 04:06 mysql-community-client-plugins-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415     681724 Jun 25 04:06 mysql-community-common-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415  528347988 Jun 25 04:07 mysql-community-debuginfo-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415    1947800 Jun 25 04:07 mysql-community-devel-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415    4217912 Jun 25 04:07 mysql-community-embedded-compat-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415    2344364 Jun 25 04:07 mysql-community-icu-data-files-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415    1563264 Jun 25 04:07 mysql-community-libs-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415     685312 Jun 25 04:08 mysql-community-libs-compat-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415   67410132 Jun 25 04:08 mysql-community-server-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415   25637968 Jun 25 04:08 mysql-community-server-debug-8.0.34-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415  378442676 Jun 25 04:10 mysql-community-test-8.0.34-1.el7.x86_64.rpm
-rwxr-xr-x. 1 root root  1031792640 Aug 20 13:10 mysql-8.0.34-1.el7.x86_64.rpm-bundle.tar
drwxrwxrwt. 8 root root         149 Aug 20 13:11 ..
drwxr-xr-x. 2 root root        4096 Aug 20 13:28 .

root@vcentos79-postgres-1:/tmp/mysql-rpm-bin[root@vcentos79-postgres-1 mysql-rpm-bin]# yum install mysql-community-{server,client,client-plugins,icu-data-files,common,libs}-*

Loaded plugins: fastestmirror
Examining mysql-community-server-8.0.34-1.el7.x86_64.rpm: mysql-community-server-8.0.34-1.el7.x86_64
Marking mysql-community-server-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-server-debug-8.0.34-1.el7.x86_64.rpm: mysql-community-server-debug-8.0.34-1.el7.x86_64
Marking mysql-community-server-debug-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-client-8.0.34-1.el7.x86_64.rpm: mysql-community-client-8.0.34-1.el7.x86_64
Marking mysql-community-client-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-client-plugins-8.0.34-1.el7.x86_64.rpm: mysql-community-client-plugins-8.0.34-1.el7.x86_64
Marking mysql-community-client-plugins-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-client-plugins-8.0.34-1.el7.x86_64.rpm: mysql-community-client-plugins-8.0.34-1.el7.x86_64
Marking mysql-community-client-plugins-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-icu-data-files-8.0.34-1.el7.x86_64.rpm: mysql-community-icu-data-files-8.0.34-1.el7.x86_64
Marking mysql-community-icu-data-files-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-common-8.0.34-1.el7.x86_64.rpm: mysql-community-common-8.0.34-1.el7.x86_64
Marking mysql-community-common-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-libs-8.0.34-1.el7.x86_64.rpm: mysql-community-libs-8.0.34-1.el7.x86_64
Marking mysql-community-libs-8.0.34-1.el7.x86_64.rpm to be installed
Examining mysql-community-libs-compat-8.0.34-1.el7.x86_64.rpm: mysql-community-libs-compat-8.0.34-1.el7.x86_64
Marking mysql-community-libs-compat-8.0.34-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.68-1.el7 will be obsoleted
---> Package mysql-community-client.x86_64 0:8.0.34-1.el7 will be installed
---> Package mysql-community-client-plugins.x86_64 0:8.0.34-1.el7 will be installed
---> Package mysql-community-common.x86_64 0:8.0.34-1.el7 will be installed
---> Package mysql-community-icu-data-files.x86_64 0:8.0.34-1.el7 will be installed
---> Package mysql-community-libs.x86_64 0:8.0.34-1.el7 will be obsoleting
---> Package mysql-community-libs-compat.x86_64 0:8.0.34-1.el7 will be obsoleting
---> Package mysql-community-server.x86_64 0:8.0.34-1.el7 will be installed
--> Processing Dependency: net-tools for package: mysql-community-server-8.0.34-1.el7.x86_64
Determining fastest mirrors
..
---> Package mysql-community-server-debug.x86_64 0:8.0.34-1.el7 will be installed
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.25.20131004git.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================
 Package                        Arch   Version                  Repository                                           Size
==========================================================================================================================
Installing:
 mysql-community-client(B         x86_64 8.0.34-1.el7             /mysql-community-client-8.0.34-1.el7.x86_64          79 M
 mysql-community-client-plugins(B x86_64 8.0.34-1.el7             /mysql-community-client-plugins-8.0.34-1.el7.x86_64  20 M
 mysql-community-common(B         x86_64 8.0.34-1.el7             /mysql-community-common-8.0.34-1.el7.x86_64          10 M
 mysql-community-icu-data-files(B x86_64 8.0.34-1.el7             /mysql-community-icu-data-files-8.0.34-1.el7.x86_64 3.9 M
 mysql-community-libs(B           x86_64 8.0.34-1.el7             /mysql-community-libs-8.0.34-1.el7.x86_64           7.5 M
     replacing  mariadb-libs.x86_64 1:5.5.68-1.el7
 mysql-community-libs-compat(B    x86_64 8.0.34-1.el7             /mysql-community-libs-compat-8.0.34-1.el7.x86_64    3.6 M
     replacing  mariadb-libs.x86_64 1:5.5.68-1.el7
 mysql-community-server(B         x86_64 8.0.34-1.el7             /mysql-community-server-8.0.34-1.el7.x86_64         295 M
 mysql-community-server-debug(B   x86_64 8.0.34-1.el7             /mysql-community-server-debug-8.0.34-1.el7.x86_64   120 M
Installing for dependencies:
 net-tools                      x86_64 2.0-0.25.20131004git.el7 base                                                306 k
Transaction Summary
==========================================================================================================================
Install  8 Packages (+1 Dependent package)
Total size: 540 M
Total download size: 306 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.25.20131004git.el7.x86_64.rpm  0% [                                     ]  0.0 B/s |    0 B  --:--:-- ETA 
net-tools-2.0-0.25.20131004git.el7.x86_64.rpm                                                      | 306 kB  00:00:00       Erasing    : 1:mariadb-libs-5.5.68-1.el7.x86_64                                                                   10/10 
  Verifying  : mysql-community-server-8.0.34-1.el7.x86_64                                                            1/10 
  Verifying  : mysql-community-client-plugins-8.0.34-1.el7.x86_64                                                    2/10 
  Verifying  : mysql-community-server-debug-8.0.34-1.el7.x86_64                                                      3/10 
  Verifying  : mysql-community-icu-data-files-8.0.34-1.el7.x86_64                                                    4/10 
  Verifying  : net-tools-2.0-0.25.20131004git.el7.x86_64                                                             5/10 
  Verifying  : mysql-community-common-8.0.34-1.el7.x86_64                                                            6/10 
  Verifying  : mysql-community-libs-8.0.34-1.el7.x86_64                                                              7/10 
  Verifying  : mysql-community-libs-compat-8.0.34-1.el7.x86_64                                                       8/10 
  Verifying  : mysql-community-client-8.0.34-1.el7.x86_64                                                            9/10 
  Verifying  : 1:mariadb-libs-5.5.68-1.el7.x86_64                                                                   10/10 
Installed:
  mysql-community-client.x86_64 0:8.0.34-1.el7            mysql-community-client-plugins.x86_64 0:8.0.34-1.el7           
  mysql-community-common.x86_64 0:8.0.34-1.el7            mysql-community-icu-data-files.x86_64 0:8.0.34-1.el7           
  mysql-community-libs.x86_64 0:8.0.34-1.el7              mysql-community-libs-compat.x86_64 0:8.0.34-1.el7              
  mysql-community-server.x86_64 0:8.0.34-1.el7            mysql-community-server-debug.x86_64 0:8.0.34-1.el7             
Dependency Installed:
  net-tools.x86_64 0:2.0-0.25.20131004git.el7                                                                             
Replaced:
  mariadb-libs.x86_64 1:5.5.68-1.el7                                                                                      
Complete!
]0;root@vcentos79-postgres-1:

Post install validation:

[root@vcentos79-postgres-1 mysql-rpm-bin]# rpm -qa|grep -i libaio
libaio-0.3.109-13.el7.x86_64

[root@vcentos79-postgres-1 mysql-rpm-bin]# rpm -qa|grep -i mysql
mysql-community-common-8.0.34-1.el7.x86_64
mysql-community-libs-compat-8.0.34-1.el7.x86_64
mysql-community-client-plugins-8.0.34-1.el7.x86_64
mysql-community-client-8.0.34-1.el7.x86_64
mysql-community-icu-data-files-8.0.34-1.el7.x86_64
mysql-community-server-debug-8.0.34-1.el7.x86_64
mysql-community-libs-8.0.34-1.el7.x86_64
mysql-community-server-8.0.34-1.el7.x86_64
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]# id mysql
uid=27(mysql) gid=27(mysql) groups=27(mysql)

[root@vcentos79-postgres-1 mysql-rpm-bin]# grep -i mysql /etc/passwd
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/false <<< notice the account mysql cant login. Since it is only a user account to keep up with binary permission.
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/bin|tail
-rwxr-xr-x.  1 root root   7739568 Jun 22 13:51 mysql
-rwxr-xr-x.  1 root root   6537048 Jun 22 13:51 my_print_defaults
-rwxr-xr-x.  1 root root   6841208 Jun 22 13:51 myisampack
-rwxr-xr-x.  1 root root   6771432 Jun 22 13:51 myisamlog
-rwxr-xr-x.  1 root root   6823752 Jun 22 13:51 myisam_ftdump
-rwxr-xr-x.  1 root root   6932360 Jun 22 13:51 myisamchk
-rwxr-xr-x.  1 root root   6583552 Jun 22 13:51 lz4_decompress
-rwxr-xr-x.  1 root root   6696224 Jun 22 13:51 innochecksum
-rwxr-xr-x.  1 root root   6779904 Jun 22 13:51 ibd2sdi
dr-xr-xr-x.  2 root root     24576 Aug 20 13:34 .

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/bin/my*

-rwxr-xr-x. 1 root root    7669 Jun 22 13:22 /usr/bin/mysqldumpslow
-rwxr-xr-x. 1 root root    4368 Jun 22 13:22 /usr/bin/mysqld_pre_systemd
-rwxr-xr-x. 1 root root 7539888 Jun 22 13:51 /usr/bin/mysql_upgrade
-rwxr-xr-x. 1 root root 6471328 Jun 22 13:51 /usr/bin/mysql_tzinfo_to_sql
-rwxr-xr-x. 1 root root 6603920 Jun 22 13:51 /usr/bin/mysql_ssl_rsa_setup
-rwxr-xr-x. 1 root root 7444280 Jun 22 13:51 /usr/bin/mysqlslap
-rwxr-xr-x. 1 root root 7424792 Jun 22 13:51 /usr/bin/mysqlshow
-rwxr-xr-x. 1 root root 7414056 Jun 22 13:51 /usr/bin/mysql_secure_installation
-rwxr-xr-x. 1 root root 8026832 Jun 22 13:51 /usr/bin/mysqlpump
-rwxr-xr-x. 1 root root 7510368 Jun 22 13:51 /usr/bin/mysql_migrate_keyring
-rwxr-xr-x. 1 root root 7422208 Jun 22 13:51 /usr/bin/mysqlimport
-rwxr-xr-x. 1 root root 7507440 Jun 22 13:51 /usr/bin/mysqldump
-rwxr-xr-x. 1 root root 6551848 Jun 22 13:51 /usr/bin/mysql_config_editor
-rwxr-xr-x. 1 root root 7439304 Jun 22 13:51 /usr/bin/mysqlcheck
-rwxr-xr-x. 1 root root 7891984 Jun 22 13:51 /usr/bin/mysqlbinlog
-rwxr-xr-x. 1 root root 7429928 Jun 22 13:51 /usr/bin/mysqladmin
-rwxr-xr-x. 1 root root 7739568 Jun 22 13:51 /usr/bin/mysql
-rwxr-xr-x. 1 root root 6537048 Jun 22 13:51 /usr/bin/my_print_defaults
-rwxr-xr-x. 1 root root 6841208 Jun 22 13:51 /usr/bin/myisampack
-rwxr-xr-x. 1 root root 6771432 Jun 22 13:51 /usr/bin/myisamlog
-rwxr-xr-x. 1 root root 6823752 Jun 22 13:51 /usr/bin/myisam_ftdump
-rwxr-xr-x. 1 root root 6932360 Jun 22 13:51 /usr/bin/myisamchk

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/bin/mysql

-rwxr-xr-x. 1 root root 7739568 Jun 22 13:51 /usr/bin/mysql

[root@vcentos79-postgres-1 mysql-rpm-bin]# /usr/bin/mysqladmin --version

/usr/bin/mysqladmin  Ver 8.0.34 for Linux on x86_64 (MySQL Community Server - GPL)
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/sbin|grep -i mysql

-rwxr-xr-x.  1 root root     112425080 Jun 22 13:51 mysqld-debug
-rwxr-xr-x.  1 root root      64679040 Jun 22 13:51 mysqld

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /etc/my.cnf

-rw-r--r--. 1 root root 1243 Jun 22 13:44 /etc/my.cnf

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -ld /var/lib/mysql

drwxr-x--x. 2 mysql mysql 6 Jun 22 13:43 /var/lib/mysql

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/lib/mysql
total 4
drwxr-x--x.  2 mysql mysql    6 Jun 22 13:43 .
drwxr-xr-x. 28 root  root  4096 Aug 20 13:34 ..

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/log/mysqld.log

-rw-r-----. 1 mysql mysql 0 Aug 20 13:34 /var/log/mysqld.log

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/lib|tail

drwxr-xr-x.  2 root    root      76 Mar 19 23:00 VBoxGuestAdditions
drwxr-xr-x.  2 root    root      30 Mar 20 20:35 logrotate
drwxr-x---.  2 mysql   mysql      6 Jun 22 13:43 mysql-keyring
drwxr-x---.  2 mysql   mysql      6 Jun 22 13:43 mysql-files
drwxr-x--x.  2 mysql   mysql      6 Jun 22 13:43 mysql
drwx------.  2 root    root    4096 Aug 20 12:51 NetworkManager
drwxr-xr-x.  2 root    root    4096 Aug 20 13:33 rpm
drwx------.  2 root    root      29 Aug 20 13:34 rsyslog
drwxr-xr-x. 28 root    root    4096 Aug 20 13:34 .
drwxr-xr-x.  6 root    root      80 Aug 20 13:34 yum

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /etc/init.d/mysqld

ls: cannot access /etc/init.d/mysqld: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /etc/init.d/mysql

ls: cannot access /etc/init.d/mysql: No such file or directory
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]# systemctl status mysqld

● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/run/mysql/mysqld.pid

ls: cannot access /var/run/mysql/mysqld.pid: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/run/mysql/mysql.sock

ls: cannot access /var/run/mysql/mysql.sock: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/include/mysql

ls: cannot access /usr/include/mysql: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/libs/mysql

ls: cannot access /usr/libs/mysql: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/lib/mysql

ls: cannot access /usr/lib/mysql: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /usr/share/mysql

ls: cannot access /usr/share/mysql: No such file or directory


e. Start the mysql server

[this should initialize the data directory,An SSL certificate and key files are generated in the data directory, validate_password is installed and enabled]

systemctl start mysqld

Actual startup log:

[root@vcentos79-postgres-1 mysql-rpm-bin]# systemctl start mysqld
[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/lib/mysql
total 90576
drwxr-xr-x. 28 root  root      4096 Aug 20 13:34 ..
-rw-r-----.  1 mysql mysql       56 Aug 20 13:47 auto.cnf
-rw-r-----.  1 mysql mysql  8585216 Aug 20 13:47 #ib_16384_1.dblwr
drwxr-x---.  2 mysql mysql     8192 Aug 20 13:47 performance_schema
-rw-------.  1 mysql mysql     1676 Aug 20 13:47 ca-key.pem
-rw-r--r--.  1 mysql mysql     1112 Aug 20 13:47 ca.pem
-rw-------.  1 mysql mysql     1676 Aug 20 13:47 server-key.pem
-rw-r--r--.  1 mysql mysql     1112 Aug 20 13:47 server-cert.pem
-rw-------.  1 mysql mysql     1676 Aug 20 13:47 client-key.pem
-rw-r--r--.  1 mysql mysql     1112 Aug 20 13:47 client-cert.pem
-rw-------.  1 mysql mysql     1676 Aug 20 13:47 private_key.pem
-rw-r--r--.  1 mysql mysql      452 Aug 20 13:47 public_key.pem
drwxr-x---.  2 mysql mysql      143 Aug 20 13:47 mysql
drwxr-x---.  2 mysql mysql       28 Aug 20 13:47 sys
-rw-r-----.  1 mysql mysql     5632 Aug 20 13:47 ib_buffer_pool
drwxr-x---.  2 mysql mysql      187 Aug 20 13:47 #innodb_temp
-rw-r-----.  1 mysql mysql       16 Aug 20 13:47 binlog.index
-rw-r-----.  1 mysql mysql      157 Aug 20 13:47 binlog.000001
-rw-------.  1 mysql mysql        6 Aug 20 13:47 mysql.sock.lock
srwxrwxrwx.  1 mysql mysql        0 Aug 20 13:47 mysql.sock
drwxr-x--x.  7 mysql mysql     4096 Aug 20 13:47 .
drwxr-x---.  2 mysql mysql     4096 Aug 20 13:47 #innodb_redo
-rw-r-----.  1 mysql mysql 12582912 Aug 20 13:47 ibtmp1
-rw-r-----.  1 mysql mysql 12582912 Aug 20 13:47 ibdata1
-rw-r-----.  1 mysql mysql 16777216 Aug 20 13:47 undo_001
-rw-r-----.  1 mysql mysql 16777216 Aug 20 13:47 undo_002
-rw-r-----.  1 mysql mysql   196608 Aug 20 13:47 #ib_16384_0.dblwr
-rw-r-----.  1 mysql mysql 25165824 Aug 20 13:47 mysql.ibd

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/lib/mysql/mysql.pid
ls: cannot access /var/lib/mysql/mysql.pid: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/lib/mysql/mysqld.pid
ls: cannot access /var/lib/mysql/mysqld.pid: No such file or directory

[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/run/mysql/mysqld.pid
ls: cannot access /var/run/mysql/mysqld.pid: No such file or directory
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]#
[root@vcentos79-postgres-1 mysql-rpm-bin]#
[root@vcentos79-postgres-1 mysql-rpm-bin]#
[root@vcentos79-postgres-1 mysql-rpm-bin]# ls -altr /var/run/mysql/mysqld.pid
ls: cannot access /var/run/mysql/mysqld.pid: No such file or directory
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]#
[root@vcentos79-postgres-1 mysql-rpm-bin]# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2023-08-20 13:47:12 BST; 2min 29s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 10711 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 10777 (mysqld)
   Status: "Server is operational"
   CGroup: /system.slice/mysqld.service
           └─10777 /usr/sbin/mysqld
Aug 20 13:47:04 vcentos79-postgres-1 systemd[1]: Starting MySQL Server...
Aug 20 13:47:12 vcentos79-postgres-1 systemd[1]: Started MySQL Server.
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]#
[root@vcentos79-postgres-1 mysql-rpm-bin]# view /var/log/mysqld.log
[root@vcentos79-postgres-1 mysql-rpm-bin]#

[root@vcentos79-postgres-1 mysql-rpm-bin]# netstat -plantu|grep 3306
tcp6       0      0 :::33060                :::*                    LISTEN      10777/mysqld
tcp6       0      0 :::3306                 :::*                    LISTEN      10777/mysqld
[root@vcentos79-postgres-1 mysql-rpm-bin]#


mysql default port: 3306

f. Change mysql user root password [not linux root]


sudo grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p << password should be expired, so change it.
store the new password safely.

Actual output:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
Actual password update routine:
[root@vcentos79-postgres-1 mysql-rpm-bin]# grep 'temporary password' /var/log/mysqld.log
2023-08-20T12:47:07.425831Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: u(bZs7GNQW&0

[root@vcentos79-postgres-1 mysql-rpm-bin]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.34
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye

[root@vcentos79-postgres-1 mysql-rpm-bin]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.34 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye
[root@vcentos79-postgres-1 mysql-rpm-bin]#


g. Retrieve the deployment information and store it for future use


Refer below for the deployment info:




Video Tutorial of the blog content:


Thank you!

No comments:

Post a Comment

Troubleshooting the “Cannot Generate SSPI Context” Error After SQL Server Migration

  Introduction After a recent  SQL Server migration from 2012 to 2022 , our team encountered a classic authentication issue: The target prin...