Mysql Installation Steps on RHEL 7 for Database versions 5.6.x and 5.7.

========================================================================
RHEL 7 - DB Version 5.6.29
========================================================================

[root@hostname /]# useradd -g dba -u 888 -d /tmp/mysql -m mysql

[root@hostname /]# passwd mysql
Changing password for user mysql.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

[root@hostname 5.6.29]# pwd
/tmp/mysql/5.6.29

[root@hostname 5.6.29]# ls -ltr
total 466084
-rw-r--r-- 1 7155 wheel 20018036 Jan 15 23:29 MySQL-client-5.6.29-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 wheel 3549396 Jan 15 23:29 MySQL-devel-5.6.29-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 wheel 92504844 Jan 15 23:29 MySQL-embedded-5.6.29-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 wheel 60801520 Jan 15 23:30 MySQL-server-5.6.29-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 wheel 2106540 Jan 15 23:30 MySQL-shared-5.6.29-1.el7.x86_64.rpm
-rw-r--r-- 1 7155 wheel 59638388 Jan 15 23:30 MySQL-test-5.6.29-1.el7.x86_64.rpm
-rw-r--r-- 1 mysql games 238632960 Apr 11 14:22 MySQL-5.6.29-1.el7.x86_64.rpm-bundle.tar

[root@hostname 5.6.29]# rpm -ivh MySQL-client-5.6.29-1.el7.x86_64.rpm MySQL-server-5.6.29-1.el7.x86_64.rpm MySQL-shared-5.6.29-1.el7.x86_64.rpm
warning: MySQL-client-5.6.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
/usr/bin/perl is needed by MySQL-client-5.6.29-1.el7.x86_64
/usr/bin/perl is needed by MySQL-server-5.6.29-1.el7.x86_64
libaio.so.1()(64bit) is needed by MySQL-server-5.6.29-1.el7.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.29-1.el7.x86_64
libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.6.29-1.el7.x86_64

[root@hostname 5.6.29]# yum install libaio
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package libaio.x86_64 0:0.3.109-12.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================
Package Arch Version Repository Size
================================================================
Installing:
libaio x86_64 0.3.109-12.el7 base 24 k

Transaction Summary
================================================================
Install 1 Package

Total download size: 24 k
Installed size: 38 k
Is this ok [y/d/N]: y
Downloading packages:
libaio-0.3.109-12.el7.x86_64.rpm | 24 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libaio-0.3.109-12.el7.x86_64 1/1
Verifying : libaio-0.3.109-12.el7.x86_64 1/1

Installed:
libaio.x86_64 0:0.3.109-12.el7

Complete!

[root@hostname 5.6.29]# rpm -ivh MySQL-client-5.6.29-1.el7.x86_64.rpm MySQL-server-5.6.29-1.el7.x86_64.rpm MySQL-shared-5.6.29-1.el7.x86_64.rpm
warning: MySQL-client-5.6.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
/usr/bin/perl is needed by MySQL-client-5.6.29-1.el7.x86_64
/usr/bin/perl is needed by MySQL-server-5.6.29-1.el7.x86_64

[root@hostname 5.6.29]# yum install perl
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package perl.x86_64 4:5.16.3-283.el7 will be installed
--> Processing Dependency: perl-libs = 4:5.16.3-283.el7 for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(File::Path) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(File::Spec) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(File::Spec::Unix) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(File::Temp) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Cwd) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(Exporter) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: perl(File::Spec::Functions) for package: 4:perl-5.16.3-283.el7.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-283.el7.x86_64
--> Running transaction check
---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed
---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed
---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed
---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed
---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed
---> Package perl-Getopt-Long.noarch 0:2.40-2.el7 will be installed
--> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-2.el7.noarch
--> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-2.el7.noarch
---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed
---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
--> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed
---> Package perl-Socket.x86_64 0:2.010-3.el7 will be installed
---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed
---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed
---> Package perl-constant.noarch 0:1.27-2.el7 will be installed
---> Package perl-libs.x86_64 4:5.16.3-283.el7 will be installed
---> Package perl-macros.x86_64 4:5.16.3-283.el7 will be installed
---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed
---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed
--> Running transaction check
---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed
---> Package perl-Pod-Escapes.noarch 1:1.04-283.el7 will be installed
---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed
--> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch
--> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch
---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed
--> Running transaction check
---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed
--> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
--> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed
--> Running transaction check
---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================
Package Arch Version Repository Size
=============================================================
Installing:
perl x86_64 4:5.16.3-283.el7 base 8.0 M
Installing for dependencies:
perl-Carp noarch 1.26-244.el7 base 19 k
perl-Encode x86_64 2.51-7.el7 base 1.5 M
perl-Exporter noarch 5.68-3.el7 base 28 k
perl-File-Path noarch 2.09-2.el7 base 27 k
perl-File-Temp noarch 0.23.01-3.el7 base 56 k
perl-Filter x86_64 1.49-3.el7 base 76 k
perl-Getopt-Long noarch 2.40-2.el7 base 56 k
perl-HTTP-Tiny noarch 0.033-3.el7 base 38 k
perl-PathTools x86_64 3.40-5.el7 base 83 k
perl-Pod-Escapes noarch 1:1.04-283.el7 base 50 k
perl-Pod-Perldoc noarch 3.20-4.el7 base 87 k
perl-Pod-Simple noarch 1:3.28-4.el7 base 216 k
perl-Pod-Usage noarch 1.63-3.el7 base 27 k
perl-Scalar-List-Utils x86_64 1.27-248.el7 base 36 k
perl-Socket x86_64 2.010-3.el7 base 49 k
perl-Storable x86_64 2.45-3.el7 base 77 k
perl-Text-ParseWords noarch 3.29-4.el7 base 14 k
perl-Time-Local noarch 1.2300-2.el7 base 24 k
perl-constant noarch 1.27-2.el7 base 19 k
perl-libs x86_64 4:5.16.3-283.el7 base 686 k
perl-macros x86_64 4:5.16.3-283.el7 base 42 k
perl-parent noarch 1:0.225-244.el7 base 12 k
perl-podlators noarch 2.5.1-3.el7 base 112 k
perl-threads x86_64 1.87-4.el7 base 49 k
perl-threads-shared x86_64 1.43-6.el7 base 39 k

Transaction Summary
========================================================
Install 1 Package (+25 Dependent packages)

Total download size: 11 M
Installed size: 36 M
Is this ok [y/d/N]: y
Downloading packages:
(1/26): perl-Carp-1.26-244.el7.noarch.rpm | 19 kB 00:00:00
(2/26): perl-Encode-2.51-7.el7.x86_64.rpm | 1.5 MB 00:00:02
(3/26): perl-Exporter-5.68-3.el7.noarch.rpm | 28 kB 00:00:00
(4/26): perl-File-Path-2.09-2.el7.noarch.rpm | 27 kB 00:00:01
(5/26): perl-5.16.3-283.el7.x86_64.rpm | 8.0 MB 00:00:05
(6/26): perl-File-Temp-0.23.01-3.el7.noarch.rpm | 56 kB 00:00:00
(7/26): perl-Filter-1.49-3.el7.x86_64.rpm | 76 kB 00:00:00
(8/26): perl-Getopt-Long-2.40-2.el7.noarch.rpm | 56 kB 00:00:00
(9/26): perl-HTTP-Tiny-0.033-3.el7.noarch.rpm | 38 kB 00:00:00
(10/26): perl-PathTools-3.40-5.el7.x86_64.rpm | 83 kB 00:00:00
(11/26): perl-Pod-Escapes-1.04-283.el7.noarch.rpm | 50 kB 00:00:01
(12/26): perl-Pod-Perldoc-3.20-4.el7.noarch.rpm | 87 kB 00:00:01
(13/26): perl-Pod-Simple-3.28-4.el7.noarch.rpm | 216 kB 00:00:00
(14/26): perl-Pod-Usage-1.63-3.el7.noarch.rpm | 27 kB 00:00:00
(15/26): perl-Scalar-List-Utils-1.27-248.el7.x86_64.rpm | 36 kB 00:00:00
(16/26): perl-Socket-2.010-3.el7.x86_64.rpm | 49 kB 00:00:01
(17/26): perl-Storable-2.45-3.el7.x86_64.rpm | 77 kB 00:00:00
(18/26): perl-Text-ParseWords-3.29-4.el7.noarch.rpm | 14 kB 00:00:00
(19/26): perl-Time-Local-1.2300-2.el7.noarch.rpm | 24 kB 00:00:00
(20/26): perl-constant-1.27-2.el7.noarch.rpm | 19 kB 00:00:00
(21/26): perl-macros-5.16.3-283.el7.x86_64.rpm | 42 kB 00:00:00
(22/26): perl-parent-0.225-244.el7.noarch.rpm | 12 kB 00:00:00
(23/26): perl-libs-5.16.3-283.el7.x86_64.rpm | 686 kB 00:00:01
(24/26): perl-threads-1.87-4.el7.x86_64.rpm | 49 kB 00:00:00
(25/26): perl-podlators-2.5.1-3.el7.noarch.rpm | 112 kB 00:00:01
(26/26): perl-threads-shared-1.43-6.el7.x86_64.rpm | 39 kB 00:00:00
-----------------------------------------------------------------------------------------------------
Total 719 kB/s | 11 MB 00:00:16
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:perl-parent-0.225-244.el7.noarch 1/26
Installing : perl-HTTP-Tiny-0.033-3.el7.noarch 2/26
Installing : perl-podlators-2.5.1-3.el7.noarch 3/26
Installing : perl-Pod-Perldoc-3.20-4.el7.noarch 4/26
Installing : 1:perl-Pod-Escapes-1.04-283.el7.noarch 5/26
Installing : perl-Text-ParseWords-3.29-4.el7.noarch 6/26
Installing : perl-Encode-2.51-7.el7.x86_64 7/26
Installing : perl-Pod-Usage-1.63-3.el7.noarch 8/26
Installing : 4:perl-libs-5.16.3-283.el7.x86_64 9/26
Installing : 4:perl-macros-5.16.3-283.el7.x86_64 10/26
Installing : perl-Storable-2.45-3.el7.x86_64 11/26
Installing : perl-Exporter-5.68-3.el7.noarch 12/26
Installing : perl-constant-1.27-2.el7.noarch 13/26
Installing : perl-Time-Local-1.2300-2.el7.noarch 14/26
Installing : perl-Socket-2.010-3.el7.x86_64 15/26
Installing : perl-Carp-1.26-244.el7.noarch 16/26
Installing : perl-PathTools-3.40-5.el7.x86_64 17/26
Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64 18/26
Installing : perl-File-Temp-0.23.01-3.el7.noarch 19/26
Installing : perl-File-Path-2.09-2.el7.noarch 20/26
Installing : perl-threads-shared-1.43-6.el7.x86_64 21/26
Installing : perl-threads-1.87-4.el7.x86_64 22/26
Installing : perl-Filter-1.49-3.el7.x86_64 23/26
Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch 24/26
Installing : perl-Getopt-Long-2.40-2.el7.noarch 25/26
Installing : 4:perl-5.16.3-283.el7.x86_64 26/26
Verifying : perl-HTTP-Tiny-0.033-3.el7.noarch 1/26
Verifying : perl-threads-shared-1.43-6.el7.x86_64 2/26
Verifying : perl-Storable-2.45-3.el7.x86_64 3/26
Verifying : perl-Exporter-5.68-3.el7.noarch 4/26
Verifying : perl-constant-1.27-2.el7.noarch 5/26
Verifying : perl-PathTools-3.40-5.el7.x86_64 6/26
Verifying : 1:perl-Pod-Escapes-1.04-283.el7.noarch 7/26
Verifying : 1:perl-parent-0.225-244.el7.noarch 8/26
Verifying : 1:perl-Pod-Simple-3.28-4.el7.noarch 9/26
Verifying : perl-File-Temp-0.23.01-3.el7.noarch 10/26
Verifying : 4:perl-libs-5.16.3-283.el7.x86_64 11/26
Verifying : perl-Time-Local-1.2300-2.el7.noarch 12/26
Verifying : perl-Pod-Perldoc-3.20-4.el7.noarch 13/26
Verifying : perl-Socket-2.010-3.el7.x86_64 14/26
Verifying : 4:perl-macros-5.16.3-283.el7.x86_64 15/26
Verifying : 4:perl-5.16.3-283.el7.x86_64 16/26
Verifying : perl-Carp-1.26-244.el7.noarch 17/26
Verifying : perl-Scalar-List-Utils-1.27-248.el7.x86_64 18/26
Verifying : perl-Pod-Usage-1.63-3.el7.noarch 19/26
Verifying : perl-Encode-2.51-7.el7.x86_64 20/26
Verifying : perl-podlators-2.5.1-3.el7.noarch 21/26
Verifying : perl-Getopt-Long-2.40-2.el7.noarch 22/26
Verifying : perl-File-Path-2.09-2.el7.noarch 23/26
Verifying : perl-threads-1.87-4.el7.x86_64 24/26
Verifying : perl-Filter-1.49-3.el7.x86_64 25/26
Verifying : perl-Text-ParseWords-3.29-4.el7.noarch 26/26

Installed:
perl.x86_64 4:5.16.3-283.el7

Dependency Installed:
perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 perl-Exporter.noarch 0:5.68-3.el7
perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7
perl-Getopt-Long.noarch 0:2.40-2.el7 perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7

perl-Pod-Escapes.noarch 1:1.04-283.el7 perl-Pod-Perldoc.noarch 0:3.20-4.el7 perl-Pod-Simple.noarch 1:3.28-4.el7
perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-3.el7
perl-Storable.x86_64 0:2.45-3.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-Local.noarch 0:1.2300-2.el7
perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-283.el7 perl-macros.x86_64 4:5.16.3-283.el7
perl-parent.noarch 1:0.225-244.el7 perl-podlators.noarch 0:2.5.1-3.el7 perl-threads.x86_64 0:1.87-4.el7
perl-threads-shared.x86_64 0:1.43-6.el7

Complete!

[root@hostname 5.6.29]# rpm -qa | grep -i mariadb-libs
mariadb-libs-5.5.35-3.el7.x86_64

[root@hostname 5.6.29]# rpm -e mariadb-libs-5.5.35-3.el7.x86_64
error: Failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64

[root@hostname 5.6.29]# rpm -e mariadb-libs-5.5.35-3.el7.x86_64 --nodeps

[root@hostname 5.6.29]# rpm -ivh MySQL-client-5.6.29-1.el7.x86_64.rpm MySQL-server-5.6.29-1.el7.x86_64.rpm MySQL-shared-5.6.29-1.el7.x86_64.rpm
warning: MySQL-client-5.6.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-5.6.29-1.el7 ################################# [ 33%]
2:MySQL-server-5.6.29-1.el7 ################################# [ 67%]
warning: group mysql does not exist - using root
FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
Data::Dumper
3:MySQL-client-5.6.29-1.el7 ################################# [100%]
Need to install perl-Data-Dumper.x86_64 : Stringify perl data structures, suitable for printing and eval

Dependency Package : perl-Data-Dumper.x86_64

[root@hostname 5.6.29]# yum install perl-Data-Dumper.x86_64
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================
Package Arch Version Repository Size
===========================================================
Installing:
perl-Data-Dumper x86_64 2.145-3.el7 base 47 k

Transaction Summary
===========================================================
Install 1 Package

Total download size: 47 k
Installed size: 97 k
Is this ok [y/d/N]: y
Downloading packages:
perl-Data-Dumper-2.145-3.el7.x86_64.rpm | 47 kB 00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : perl-Data-Dumper-2.145-3.el7.x86_64 1/1
Verifying : perl-Data-Dumper-2.145-3.el7.x86_64 1/1

Installed:
perl-Data-Dumper.x86_64 0:2.145-3.el7

Complete!

[root@hostname 5.6.29]# rpm -ivh MySQL-client-5.6.29-1.el7.x86_64.rpm
warning: MySQL-client-5.6.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-client-5.6.29-1.el7 ################################# [100%]

[root@hostname 5.6.29]# rpm -ivh MySQL-shared-5.6.29-1.el7.x86_64.rpm
warning: MySQL-shared-5.6.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-5.6.29-1.el7 ################################# [100%]

[root@hostname5.6.29]# rpm -ivh MySQL-server-5.6.29-1.el7.x86_64.rpm
warning: MySQL-server-5.6.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-server-5.6.29-1.el7 ################################# [100%]
2016-04-11 14:42:29 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-11 14:42:29 0 [Note] /usr/sbin/mysqld (mysqld 5.6.29) starting as process 8536 ...
2016-04-11 14:42:29 8536 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-11 14:42:29 8536 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-11 14:42:29 8536 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-11 14:42:29 8536 [Note] InnoDB: Memory barrier is not used
2016-04-11 14:42:29 8536 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-04-11 14:42:29 8536 [Note] InnoDB: Using Linux native AIO
2016-04-11 14:42:29 8536 [Note] InnoDB: Using CPU crc32 instructions
2016-04-11 14:42:29 8536 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-11 14:42:29 8536 [Note] InnoDB: Completed initialization of buffer pool
2016-04-11 14:42:29 8536 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2016-04-11 14:42:29 8536 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2016-04-11 14:42:29 8536 [Note] InnoDB: Database physically writes the file full: wait...
2016-04-11 14:42:30 8536 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2016-04-11 14:42:33 8536 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2016-04-11 14:42:34 8536 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2016-04-11 14:42:34 8536 [Warning] InnoDB: New log files created, LSN=45781
2016-04-11 14:42:34 8536 [Note] InnoDB: Doublewrite buffer not found: creating new
2016-04-11 14:42:34 8536 [Note] InnoDB: Doublewrite buffer created
2016-04-11 14:42:34 8536 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-11 14:42:34 8536 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-04-11 14:42:34 8536 [Note] InnoDB: Foreign key constraint system tables created
2016-04-11 14:42:34 8536 [Note] InnoDB: Creating tablespace and datafile system tables.
2016-04-11 14:42:34 8536 [Note] InnoDB: Tablespace and datafile system tables created.
2016-04-11 14:42:34 8536 [Note] InnoDB: Waiting for purge to start
2016-04-11 14:42:34 8536 [Note] InnoDB: 5.6.29 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2016-04-11 14:42:34 8536 [Note] Binlog end
2016-04-11 14:42:34 8536 [Note] InnoDB: FTS optimize thread exiting.
2016-04-11 14:42:34 8536 [Note] InnoDB: Starting shutdown...
2016-04-11 14:42:36 8536 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2016-04-11 14:42:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-11 14:42:36 0 [Note] /usr/sbin/mysqld (mysqld 5.6.29) starting as process 8558 ...
2016-04-11 14:42:36 8558 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-11 14:42:36 8558 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-11 14:42:36 8558 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-11 14:42:36 8558 [Note] InnoDB: Memory barrier is not used
2016-04-11 14:42:36 8558 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-04-11 14:42:36 8558 [Note] InnoDB: Using Linux native AIO
2016-04-11 14:42:36 8558 [Note] InnoDB: Using CPU crc32 instructions
2016-04-11 14:42:36 8558 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-11 14:42:36 8558 [Note] InnoDB: Completed initialization of buffer pool
2016-04-11 14:42:36 8558 [Note] InnoDB: Highest supported file format is Barracuda.
2016-04-11 14:42:36 8558 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-11 14:42:36 8558 [Note] InnoDB: Waiting for purge to start
2016-04-11 14:42:36 8558 [Note] InnoDB: 5.6.29 started; log sequence number 1625977
2016-04-11 14:42:38 8558 [Note] Binlog end
2016-04-11 14:42:38 8558 [Note] InnoDB: FTS optimize thread exiting.
2016-04-11 14:42:38 8558 [Note] InnoDB: Starting shutdown...
2016-04-11 14:42:39 8558 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,no other statement but 'SET PASSWORD' will be accepted.See the manual for the semantics of the 'password expired' flag.
Also, the account for the anonymous user has been removed.
In addition, you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.This is strongly recommended for production servers.
See the manual for more instructions.Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /usr/my.cnf and will be used by default by the server when you start it.You may edit this file to change server settings

[root@hostname5.6.29]# su - mysql
Last login: Mon Apr 11 14:34:00 IST 2016 on pts/0

[mysql@hostname ~]$ mysql_install_db

WARNING: Could not write to config file /usr/my-new.cnf: Permission denied
WARNING: The host 'inkrh7qa52' could not be looked up with /usr/bin/resolveip.This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames when specifying MySQL privileges !

Installing MySQL system tables...2016-04-11 14:43:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-11 14:43:07 0 [Note] /usr/sbin/mysqld (mysqld 5.6.29) starting as process 8620 ...
2016-04-11 14:43:07 8620 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-11 14:43:07 8620 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-11 14:43:07 8620 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-11 14:43:07 8620 [Note] InnoDB: Memory barrier is not used
2016-04-11 14:43:07 8620 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-04-11 14:43:07 8620 [Note] InnoDB: Using Linux native AIO
2016-04-11 14:43:07 8620 [Note] InnoDB: Using CPU crc32 instructions
2016-04-11 14:43:07 8620 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-11 14:43:07 8620 [Note] InnoDB: Completed initialization of buffer pool
2016-04-11 14:43:07 8620 [Note] InnoDB: Highest supported file format is Barracuda.
2016-04-11 14:43:08 8620 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-11 14:43:08 8620 [Note] InnoDB: Waiting for purge to start
2016-04-11 14:43:08 8620 [Note] InnoDB: 5.6.29 started; log sequence number 1625987
2016-04-11 14:43:08 8620 [Note] Binlog end
2016-04-11 14:43:08 8620 [Note] InnoDB: FTS optimize thread exiting.
2016-04-11 14:43:08 8620 [Note] InnoDB: Starting shutdown...
2016-04-11 14:43:09 8620 [Note] InnoDB: Shutdown completed; log sequence number 1625997
OK
Filling help tables...2016-04-11 14:43:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-11 14:43:09 0 [Note] /usr/sbin/mysqld (mysqld 5.6.29) starting as process 8643 ...
2016-04-11 14:43:09 8643 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-04-11 14:43:09 8643 [Note] InnoDB: The InnoDB memory heap is disabled
2016-04-11 14:43:09 8643 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-04-11 14:43:09 8643 [Note] InnoDB: Memory barrier is not used
2016-04-11 14:43:09 8643 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-04-11 14:43:09 8643 [Note] InnoDB: Using Linux native AIO
2016-04-11 14:43:09 8643 [Note] InnoDB: Using CPU crc32 instructions
2016-04-11 14:43:09 8643 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-04-11 14:43:09 8643 [Note] InnoDB: Completed initialization of buffer pool
2016-04-11 14:43:09 8643 [Note] InnoDB: Highest supported file format is Barracuda.
2016-04-11 14:43:09 8643 [Note] InnoDB: 128 rollback segment(s) are active.
2016-04-11 14:43:09 8643 [Note] InnoDB: Waiting for purge to start
2016-04-11 14:43:10 8643 [Note] InnoDB: 5.6.29 started; log sequence number 1625997
2016-04-11 14:43:10 8643 [Note] Binlog end
2016-04-11 14:43:10 8643 [Note] InnoDB: FTS optimize thread exiting.
2016-04-11 14:43:10 8643 [Note] InnoDB: Starting shutdown...
2016-04-11 14:43:11 8643 [Note] InnoDB: Shutdown completed; log sequence number 1626007
OK

To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h inkrh7qa52 password 'new-password'

Alternatively you can run:

/usr/bin/mysql_secure_installation

which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
See the manual for more instructions.You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/ The latest information about MySQL is available on the web at
http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com
WARNING: Could not copy config file template /usr/share/mysql/my-default.cnf to /usr/my-new.cnf, may not have access rights to do so. You may want to copy the file manually, or create your own,
it will then be used by default by the server when you start it.

[root@hostname ~]# cat /root/.mysql_secret
# The random password set for the root user at Mon Apr 11 14:42:34 2016 (local time): yPyGCiMEDwfS_b0p

[root@hostname ~]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

[root@hostname ~]# vi /etc/my.cnf

[root@hostname ~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
basedir = /usr
datadir = /var/lib/mysql
port = 3306
server_id = 1
socket = /var/lib/mysql/mysql.sock
character_set_server = utf8
collation_server = utf8_general_ci
innodb_data_home_dir = /var/lib/mysql
innodb_log_group_home_dir = /var/lib/mysql

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[root@hostname ~]# service mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL. SUCCESS!

[root@hostname ~]# service mysql status
SUCCESS! MySQL running (8960)

[root@hostname ~]# mysql -u root -p
Enter password: ------------> yPyGCiMEDwfS_b0p
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1.Server version: 5.6.29
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.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> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root'); flush privileges;
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

[root@hostname~]# mysql -u root -p
Enter password: ------------ >root
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2 Server version: 5.6.29 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)

mysql> use mysql;
Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select user,host,password from user;
+------+------------+-------------------------------------------+
| user | host | password |
+------+------------+-------------------------------------
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | inkrh7qa52 | *1DD408DE1E6D3584AE4359831582E10A7FAA03BF |
| root | 127.0.0.1 | *1DD408DE1E6D3584AE4359831582E10A7FAA03BF |
| root | ::1 | *1DD408DE1E6D3584AE4359831582E10A7FAA03BF |
+------+------------+-------------------------------------
4 rows in set (0.00 sec)

mysql> show variables like '%port%';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| innodb_support_xa | ON |
| large_files_support | ON |
| port | 3306 |
| report_host | |
| report_password | |
| report_port | 3306 |
| report_user | |
+---------------------+-------+
7 rows in set (0.00 sec)

mysql> show variables like '%char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)

mysql> show variables like '%collat%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

mysql> show variables like '%data%';
+-------------------------------+------------------------+
| Variable_name | Value |
+-------------------------------+------------------------+
| character_set_database | utf8 |
| collation_database | utf8_general_ci |
| datadir | /var/lib/mysql/ |
| innodb_data_file_path | ibdata1:12M:autoextend |
| innodb_data_home_dir | /var/lib/mysql |
| innodb_stats_on_metadata | OFF |
| max_length_for_sort_data | 1024 |
| metadata_locks_cache_size | 1024 |
| metadata_locks_hash_instances | 8 |
| myisam_data_pointer_size | 6 |
| skip_show_database | OFF |
| updatable_views_with_limit | YES |
+-------------------------------+------------------------+
12 rows in set (0.00 sec)

mysql>


**********************************************************************
END
**********************************************************************


======================================================
RHEL 7 - DB Version 5.7.17
======================================================

[root@hostname ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)

[root@hostname ~]# groupadd -g 1020 dba1

[root@hostname /]# ls
bin data downloads home lib64 misc net proc run srv tmp var
boot dev etc lib media mnt opt root sbin sys usr

[root@hostname data]# ls -ltr
total 3840
drwxr-xr-x. 4 root root 4096 May 4 2016 mysql-connector-java-5.1.39
-rw-r--r--. 1 root root 9224 Sep 21 08:51 mysql57-community-release-el7-9.noarch.rpm
-rw-r--r--. 1 root root 3899019 Sep 21 09:58 mysql-connector-java-5.1.39.tar.gz
drwx------. 2 root root 16384 Jan 13 13:54 lost+found

[root@hostname~]# useradd -g dba1 -u 777 -d /data/mysql -m mysql

[root@hostname ~]# passwd mysql
Changing password for user mysql.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

[root@hostname ~]# cd /data/mysql/
5.7/ .bash_logout .bash_profile .bashrc perl5/

[root@hostname ~]# cd /data/mysql/5.7/

[root@hostname 5.7]# pwd
/data/mysql/5.7

[root@hostname5.7]# ls -ltr
total 570452
-rw-r--r--. 1 mysql games 25037548 Nov 29 21:59 mysql-community-client-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 277812 Nov 29 21:59 mysql-community-common-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 3774276 Nov 29 21:59 mysql-community-devel-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 45474744 Nov 29 21:59 mysql-community-embedded-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 23925668 Nov 29 21:59 mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 126047424 Nov 29 22:00 mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 2237116 Nov 29 22:00 mysql-community-libs-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 2112724 Nov 29 22:00 mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 54571580 Nov 29 22:00 mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 169496800 Nov 29 22:01 mysql-community-server-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 14478292 Nov 29 22:02 mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 116682212 Nov 29 22:02 mysql-community-test-5.7.17-1.el7.x86_64.rpm

[root@hostname ~]# rpm -qa | grep -i maria*
mariadb-libs-5.5.44-2.el7.x86_64

[root@hostname~]# rpm -e mariadb-libs-5.5.44-2.el7.x86_64
error: Failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18()(64bit) is needed by (installed) perl-DBD-MySQL-4.023-5.el7.x86_64
libmysqlclient.so.18()(64bit) is needed by (installed) MySQL-python-1.2.3-11.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) perl-DBD-MySQL-4.023-5.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) MySQL-python-1.2.3-11.el7.x86_64

[root@hostname ~]# rpm -e mariadb-libs-5.5.44-2.el7.x86_64 --nodeps
warning: file /etc/my.cnf: remove failed: No such file or directory

[root@hostname~]# cd /data/mysql/5.7/

[root@hostname 5.7]# pwd
/data/mysql/5.7

[root@hostname 5.7]# ls -ltr
total 570452
-rw-r--r--. 1 mysql games 25037548 Nov 29 21:59 mysql-community-client-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 277812 Nov 29 21:59 mysql-community-common-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 3774276 Nov 29 21:59 mysql-community-devel-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 45474744 Nov 29 21:59 mysql-community-embedded-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 23925668 Nov 29 21:59 mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 126047424 Nov 29 22:00 mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 2237116 Nov 29 22:00 mysql-community-libs-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 2112724 Nov 29 22:00 mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 54571580 Nov 29 22:00 mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 169496800 Nov 29 22:01 mysql-community-server-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 14478292 Nov 29 22:02 mysql-community-server-minimal-5.7.17-1.el7.x86_64.rpm
-rw-r--r--. 1 mysql games 116682212 Nov 29 22:02 mysql-community-test-5.7.17-1.el7.x86_64.rpm

[root@hostname 5.7]# rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm mysql-community-client-5.7.17-1.el7.x86_64.rpm mysql-community-server-5.7.17-1.el7.x86_64.rpm mysql-community-libs-5.7.17-1.el7.x86_64.rpm
warning: mysql-community-common-5.7.17-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:mysql-community-common-5.7.17-1.e################################# [ 25%]
2:mysql-community-libs-5.7.17-1.el7################################# [ 50%]
3:mysql-community-client-5.7.17-1.e################################# [ 75%]
4:mysql-community-server-5.7.17-1.e################################# [100%]

[root@hostname 5.7]# cd

[root@hostname ~]# cd /var/lib/mysql

[root@hostname mysql]# ls -ltr
total 0

[root@hostname mysql]# cd ..

[root@hostname lib]# ls -lr
total 12
drwxr-x---. 2 mysql mysql 6 Nov 29 02:04 mysql-keyring
drwxr-x---. 2 mysql mysql 6 Nov 29 02:04 mysql-files
drwxr-x--x. 2 mysql mysql 6 Nov 29 02:04 mysql

[root@hostname lib]# cd

[root@hostname ~]# su - mysql
Last failed login: Sat Jan 14 09:17:07 IST 2017 from hostname.domain.com on ssh:notty
There was 1 failed login attempt since the last successful login.

[mysql@hostname ~]$ mysql_install_db
2017-01-18 12:07:01 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2017-01-18 12:07:01 [ERROR] The data directory needs to be specified.

[mysql@hostname ]$ cd sbin/
[mysql@hostname sbin]$ pwd
/usr/sbin

[mysql@hostname sbin]$ ./mysqld --initialize
[mysql@hostnamesbin]$ exit
logout

[root@hostname ~]# cd /var/lib/mysql

[root@hostname mysql]# pwd
/var/lib/mysql

[root@hostname mysql]# ls -ltr
total 110628
-rw-r-----. 1 mysql games 50331648 Jan 18 12:08 ib_logfile1
-rw-r-----. 1 mysql games 56 Jan 18 12:08 auto.cnf
drwxr-x---. 2 mysql games 8192 Jan 18 12:08 performance_schema
drwxr-x---. 2 mysql games 4096 Jan 18 12:08 mysql
drwxr-x---. 2 mysql games 8192 Jan 18 12:08 sys
-rw-r-----. 1 mysql games 413 Jan 18 12:08 ib_buffer_pool
-rw-r-----. 1 mysql games 50331648 Jan 18 12:08 ib_logfile0
-rw-r-----. 1 mysql games 12582912 Jan 18 12:08 ibdata1

[root@hostnamemysql]# cd

[root@hostname ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service

[root@hostname ~]# service mysqld status
Redirecting to /bin/systemctl status mysqld.service
â mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-01-18 12:09:42 IST; 8s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 10653 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 10635 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 10656 (mysqld)
CGroup: /system.slice/mysqld.service
ââ10656 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Jan 18 12:09:40 hostname systemd[1]: Starting MySQL Server...
Jan 18 12:09:42 hostname systemd[1]: Started MySQL Server.

[root@hostname ~]# sudo service mysqld start
Redirecting to /bin/systemctl start mysqld.service

[root@hostname ~]# cd /var/lib/mysql

[root@hostname mysql]# ls
auto.cnf ib_buffer_pool ibdata1 ib_logfile0 ib_logfile1 ibtmp1 mysql mysql.sock mysql.sock.lock performance_schema sys

[root@hostname mysql]# ls -ltr
total 122920
-rw-r-----. 1 mysql games 50331648 Jan 18 12:08 ib_logfile1
-rw-r-----. 1 mysql games 56 Jan 18 12:08 auto.cnf
drwxr-x---. 2 mysql games 8192 Jan 18 12:08 performance_schema
drwxr-x---. 2 mysql games 4096 Jan 18 12:08 mysql
drwxr-x---. 2 mysql games 8192 Jan 18 12:08 sys
-rw-r-----. 1 mysql games 413 Jan 18 12:08 ib_buffer_pool
-rw-------. 1 mysql mysql 6 Jan 18 12:09 mysql.sock.lock
srwxrwxrwx. 1 mysql mysql 0 Jan 18 12:09 mysql.sock
-rw-r-----. 1 mysql mysql 12582912 Jan 18 12:09 ibtmp1
-rw-r-----. 1 mysql games 12582912 Jan 18 12:09 ibdata1
-rw-r-----. 1 mysql games 50331648 Jan 18 12:09 ib_logfile0

[root@hostname mysql]# cd

[root@hostname ~]# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

[root@hostname ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

[root@hostname ~]# cd /var/lib/mysql
[root@hostname mysql]# ls -ltr
total 122920
-rw-r-----. 1 mysql games 50331648 Jan 18 12:08 ib_logfile1
-rw-r-----. 1 mysql games 56 Jan 18 12:08 auto.cnf
drwxr-x---. 2 mysql games 8192 Jan 18 12:08 performance_schema
drwxr-x---. 2 mysql games 4096 Jan 18 12:08 mysql
drwxr-x---. 2 mysql games 8192 Jan 18 12:08 sys
-rw-r-----. 1 mysql games 413 Jan 18 12:08 ib_buffer_pool
-rw-------. 1 mysql mysql 6 Jan 18 12:09 mysql.sock.lock
srwxrwxrwx. 1 mysql mysql 0 Jan 18 12:09 mysql.sock
-rw-r-----. 1 mysql mysql 12582912 Jan 18 12:09 ibtmp1
-rw-r-----. 1 mysql games 12582912 Jan 18 12:09 ibdata1
-rw-r-----. 1 mysql games 50331648 Jan 18 12:09 ib_logfile0

[root@hostname mysql]# cd

[root@hostname~]# cd /bin/

[root@hostname bin]# ./sys
syslinux systemd-cgtop systemd-hwdb systemd-path
systemctl systemd-coredumpctl systemd-inhibit systemd-run
systemd-analyze systemd-delta systemd-loginctl systemd-stdio-bridge
systemd-ask-password systemd-detect-virt systemd-machine-id-setup systemd-sysv-convert
systemd-cat systemd-escape systemd-notify systemd-tmpfiles
systemd-cgls systemd-firstboot systemd-nspawn systemd-tty-ask-password-agent

[root@hostname bin]# cd

[root@hostname ~]# service mysqld restart
Redirecting to /bin/systemctl restart mysqld.service

[root@hostname ~]# systemctl restart mysqld.service

[root@hostname ~]# systemctl status mysqld.service
â mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-01-18 12:17:05 IST; 6s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 10934 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 10914 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 10936 (mysqld)
CGroup: /system.slice/mysqld.service
ââ10936 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Jan 18 12:17:05 hostname systemd[1]: Starting MySQL Server...
Jan 18 12:17:05 hostname systemd[1]: Started MySQL Server.

[root@hostname ~]# systemctl stop mysqld.service

[root@hostname~]# systemctl status mysqld.service
â mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Wed 2017-01-18 12:17:22 IST; 1s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 10934 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 10914 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 10936 (code=exited, status=0/SUCCESS)

Jan 18 12:17:05 hostname systemd[1]: Starting MySQL Server...
Jan 18 12:17:05 hostname systemd[1]: Started MySQL Server.
Jan 18 12:17:21 hostname systemd[1]: Stopping MySQL Server...
Jan 18 12:17:22 hostname systemd[1]: Stopped MySQL Server.

[root@hostname~]# systemctl start mysqld.service

[root@hostname ~]# systemctl status mysqld.service
â mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-01-18 12:18:05 IST; 2s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 11011 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 10993 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 11014 (mysqld)
CGroup: /system.slice/mysqld.service
ââ11014 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Jan 18 12:18:05hostname systemd[1]: Starting MySQL Server...
Jan 18 12:18:05 hostname  systemd[1]: Started MySQL Server.

[root@hostname~]# mysql --version
mysql Ver 14.14 Distrib 5.7.17, for Linux (x86_64) using EditLine wrapper

[root@hostname ~]# cd /var/log/

[root@hostname log]# pwd
/var/log

[root@hostname log]# grep 'temporary password' /var/log/mysqld.log
2017-01-18T06:38:50.554853Z 1 [Note] A temporary password is generated for root@localhost: 9JTbtMlyBx)v

[root@hostname ~]# mysql -u root -p
Enter password: 9JTbtMlyBx)v
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 3.Server version: 5.7.17
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.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> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

mysql> alter user 'root'@'localhost' identified by 'root';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@hostname~]# mysql -u root -p
Enter password: root
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 4 .Server version: 5.7.17 MySQL Community Server (GPL).Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)

mysql> select user,host,authentication_string from mysql.user;
+-----------+-----------+---------------------------------
| user | host | authentication_string |
+-----------+-----------+---------------------------------
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
+-----------+-----------+---------------------------------
2 rows in set (0.00 sec)

mysql> exit
Bye

[root@hostname~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

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

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[root@hostname ~]# vi /etc/my.cnf

[root@hostname~]# systemctl restart mysqld.service

[root@hostname~]# systemctl status mysqld.service
â mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-01-18 12:29:52 IST; 5s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 11246 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 11226 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 11248 (mysqld)
CGroup: /system.slice/mysqld.service
ââ11248 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Jan 18 12:29:51 hostname systemd[1]: Starting MySQL Server...
Jan 18 12:29:52 hostname systemd[1]: Started MySQL Server.

[root@hostname ~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character_set_server = utf8
collation_server = utf8_general_ci

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

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[root@ldm10u2r72001 ~]# cd /etc/

[root@ldm10u2r72001 etc]# ls -lt *cnf*
-rw-r--r--. 1 root root 1023 Jan 18 12:29 my.cnf

my.cnf.d:
total 0

[root@hostnameetc]# cd

[root@hostname ~]# mysql -u root -p
Enter password:root
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)

mysql> show variables like '%char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)

mysql> show variables like '%collat%';
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.01 sec)

mysql> show variables like '%data%';
+---------------------------------------+-----------------
| Variable_name | Value |
+---------------------------------------+-----------------
| character_set_database | utf8 |
| collation_database | utf8_general_ci |
| datadir | /var/lib/mysql/ |
| innodb_data_file_path | ibdata1:12M:autoextend |
| innodb_data_home_dir | |
| innodb_stats_on_metadata | OFF |
| innodb_temp_data_file_path | ibtmp1:12M:autoextend |
| max_length_for_sort_data | 1024 |
| metadata_locks_cache_size | 1024 |
| metadata_locks_hash_instances | 8 |
| myisam_data_pointer_size | 6 |
| performance_schema_max_metadata_locks | -1 |
| skip_show_database | OFF |
| updatable_views_with_limit | YES |
+---------------------------------------+-----------------
14 rows in set (0.00 sec)

mysql> show variables like '%sock%';
+-----------------------------------------+---------------
| Variable_name | Value |
+-----------------------------------------+---------------
| performance_schema_max_socket_classes | 10 |
| performance_schema_max_socket_instances | -1 |
| socket | /var/lib/mysql/mysql.sock |
+-----------------------------------------+---------------
3 rows in set (0.00 sec)

mysql> show variables like '%port%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| innodb_support_xa | ON |
| large_files_support | ON |
| port | 3306 |
| report_host | |
| report_password | |
| report_port | 3306 |
| report_user | |
| require_secure_transport | OFF |
+--------------------------+-------+
8 rows in set (0.01 sec)

mysql> select user,host,authentication_string from mysql.user;
+-----------+-----------+-------------------------------------------+
| user | host | authentication_string |
+-----------+-----------+---------------------------------
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
+-----------+-----------+---------------------------------
2 rows in set (0.00 sec)

mysql> CREATE DATABASE MYSQLLDM;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| MYSQLLDM |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)

mysql> create user 'user'@'%' identified by 'User@123';
Query OK, 0 rows affected (0.02 sec)

mysql> create user 'user'@'localhost' identified by 'User@123';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on MYSQLLDM.* to 'user'@'%';
Query OK, 0 rows affected (0.01 sec)

mysql> grant all on MYSQLLDM.* to 'user'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| MYSQLLDM |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)

mysql> select user,host,authentication_string from mysql.user;
+-----------+-----------+---------------------------------
| user | host | authentication_string |
+-----------+-----------+---------------------------------
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| user | % | *524820C1790F62E7CDDE12C072B94EED8508A600 |
| user | localhost | *524820C1790F62E7CDDE12C072B94EED8508A600 |
+-----------+-----------+-------------------------------------------+
4 rows in set (0.01 sec)

mysql> exit
Bye

[root@hostname ~]# systemctl status mysqld
â mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-01-18 12:29:52 IST; 1h 19min ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 11246 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 11226 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 11248 (mysqld)
CGroup: /system.slice/mysqld.service
ââ11248 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Jan 18 12:29:51 hostname systemd[1]: Starting MySQL Server...
Jan 18 12:29:52hostname  systemd[1]: Started MySQL Server.
Command is : systemctl {start|stop|restart|status} mysqld


*********************************************************************
END
*********************************************************************

Comments

Popular posts from this blog

PostgreSQL Database Version 13.4 To MySQL Database Version 8.0.20 Migration by using SQLines Tool

RDS MySQL / MariaDB SSL Connection by using Workbench and command line

Install Mydumper and Myloader Software for Backup of MySQL / MariaDB Databases and Usage of commands