Skip to main content

RHEL: Install MySQL

MariaDB logo

[tuyendq@DangQuocTuyen ~]$ sudo yum list mysql
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Error: No matching Packages to list
[tuyendq@DangQuocTuyen ~]$ sudo yum install mysql
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.60-1.el7_5 will be installed
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.60-1.el7_5 for package: 1:mariadb-5.5.60-1.el7_5.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.60-1.el7_5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
 Package                         Arch                      Version                               Repository                             Size
=============================================================================================================================================
Installing:
 mariadb                         x86_64                    1:5.5.60-1.el7_5                      rhel-7-server-rpms                    8.6 M
Installing for dependencies:
 mariadb-libs                    x86_64                    1:5.5.60-1.el7_5                      rhel-7-server-rpms                    758 k

Transaction Summary
=============================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 9.4 M
Installed size: 53 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): mariadb-libs-5.5.60-1.el7_5.x86_64.rpm                                                                         | 758 kB  00:00:01     
(2/2): mariadb-5.5.60-1.el7_5.x86_64.rpm                                                                              | 8.6 MB  00:00:02     
---------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                        3.8 MB/s | 9.4 MB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:mariadb-libs-5.5.60-1.el7_5.x86_64                                                                                      1/2 
  Installing : 1:mariadb-5.5.60-1.el7_5.x86_64                                                                                           2/2 
  Verifying  : 1:mariadb-5.5.60-1.el7_5.x86_64                                                                                           1/2 
  Verifying  : 1:mariadb-libs-5.5.60-1.el7_5.x86_64                                                                                      2/2 

Installed:
  mariadb.x86_64 1:5.5.60-1.el7_5                                                                                                            

Dependency Installed:
  mariadb-libs.x86_64 1:5.5.60-1.el7_5                                                                                                       

Complete!
[tuyendq@DangQuocTuyen ~]$ 
[tuyendq@DangQuocTuyen ~]$ sudo yum install mariadb-server
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
---> Package mariadb-server.x86_64 1:5.5.60-1.el7_5 will be installed
--> Processing Dependency: perl(DBI) for package: 1:mariadb-server-5.5.60-1.el7_5.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: 1:mariadb-server-5.5.60-1.el7_5.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.60-1.el7_5.x86_64
--> Processing Dependency: perl-DBI for package: 1:mariadb-server-5.5.60-1.el7_5.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.023-6.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Running transaction check
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
 Package                                 Arch                   Version                             Repository                          Size
=============================================================================================================================================
Installing:
 mariadb-server                          x86_64                 1:5.5.60-1.el7_5                    rhel-7-server-rpms                  11 M
Installing for dependencies:
 perl-Compress-Raw-Bzip2                 x86_64                 2.061-3.el7                         rhel-7-server-rpms                  32 k
 perl-Compress-Raw-Zlib                  x86_64                 1:2.061-4.el7                       rhel-7-server-rpms                  57 k
 perl-DBD-MySQL                          x86_64                 4.023-6.el7                         rhel-7-server-rpms                 140 k
 perl-DBI                                x86_64                 1.627-4.el7                         rhel-7-server-rpms                 802 k
 perl-Data-Dumper                        x86_64                 2.145-3.el7                         rhel-7-server-rpms                  47 k
 perl-IO-Compress                        noarch                 2.061-2.el7                         rhel-7-server-rpms                 260 k
 perl-Net-Daemon                         noarch                 0.48-5.el7                          rhel-7-server-rpms                  51 k
 perl-PlRPC                              noarch                 0.2020-14.el7                       rhel-7-server-rpms                  36 k

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

Total download size: 13 M
Installed size: 62 M
Is this ok [y/d/N]: y
Downloading packages:
(1/9): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm                                                                 |  32 kB  00:00:01     
(2/9): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm                                                                  |  57 kB  00:00:00     
(3/9): mariadb-server-5.5.60-1.el7_5.x86_64.rpm                                                                       |  11 MB  00:00:02     
(4/9): perl-DBD-MySQL-4.023-6.el7.x86_64.rpm                                                                          | 140 kB  00:00:00     
(5/9): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                        |  47 kB  00:00:00     
(6/9): perl-DBI-1.627-4.el7.x86_64.rpm                                                                                | 802 kB  00:00:00     
(7/9): perl-Net-Daemon-0.48-5.el7.noarch.rpm                                                                          |  51 kB  00:00:00     
(8/9): perl-IO-Compress-2.061-2.el7.noarch.rpm                                                                        | 260 kB  00:00:00     
(9/9): perl-PlRPC-0.2020-14.el7.noarch.rpm                                                                            |  36 kB  00:00:00     
---------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                        2.7 MB/s |  13 MB  00:00:04     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                       1/9 
  Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                2/9 
  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                               3/9 
  Installing : perl-IO-Compress-2.061-2.el7.noarch                                                                                       4/9 
  Installing : perl-Net-Daemon-0.48-5.el7.noarch                                                                                         5/9 
  Installing : perl-PlRPC-0.2020-14.el7.noarch                                                                                           6/9 
  Installing : perl-DBI-1.627-4.el7.x86_64                                                                                               7/9 
  Installing : perl-DBD-MySQL-4.023-6.el7.x86_64                                                                                         8/9 
  Installing : 1:mariadb-server-5.5.60-1.el7_5.x86_64                                                                                    9/9 
  Verifying  : 1:mariadb-server-5.5.60-1.el7_5.x86_64                                                                                    1/9 
  Verifying  : perl-Net-Daemon-0.48-5.el7.noarch                                                                                         2/9 
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                       3/9 
  Verifying  : perl-DBD-MySQL-4.023-6.el7.x86_64                                                                                         4/9 
  Verifying  : perl-IO-Compress-2.061-2.el7.noarch                                                                                       5/9 
  Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                               6/9 
  Verifying  : perl-DBI-1.627-4.el7.x86_64                                                                                               7/9 
  Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                8/9 
  Verifying  : perl-PlRPC-0.2020-14.el7.noarch                                                                                           9/9 

Installed:
  mariadb-server.x86_64 1:5.5.60-1.el7_5                                                                                                     

Dependency Installed:
  perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7     perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7     perl-DBD-MySQL.x86_64 0:4.023-6.el7      
  perl-DBI.x86_64 0:1.627-4.el7                    perl-Data-Dumper.x86_64 0:2.145-3.el7           perl-IO-Compress.noarch 0:2.061-2.el7    
  perl-Net-Daemon.noarch 0:0.48-5.el7              perl-PlRPC.noarch 0:0.2020-14.el7              

Complete!
[tuyendq@DangQuocTuyen ~]$ 
[tuyendq@DangQuocTuyen ~]$ sudo systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[tuyendq@DangQuocTuyen ~]$ sudo systemctl start mariadb
[tuyendq@DangQuocTuyen ~]$ 
[tuyendq@DangQuocTuyen ~]$ sudo systemctl status mariadb
● mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-02-16 20:07:43 +07; 3min 43s ago
  Process: 8571 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
  Process: 8492 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
 Main PID: 8570 (mysqld_safe)
   CGroup: /system.slice/mariadb.service
           ├─8570 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
           └─8737 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/ma...

Feb 16 20:07:41 DangQuocTuyen mariadb-prepare-db-dir[8492]: MySQL manual for more instructions.
Feb 16 20:07:41 DangQuocTuyen mariadb-prepare-db-dir[8492]: Please report any problems at http://mariadb.org/jira
Feb 16 20:07:41 DangQuocTuyen mariadb-prepare-db-dir[8492]: The latest information about MariaDB is available at http://mariadb.org/.
Feb 16 20:07:41 DangQuocTuyen mariadb-prepare-db-dir[8492]: You can find additional information about the MySQL part at:
Feb 16 20:07:41 DangQuocTuyen mariadb-prepare-db-dir[8492]: http://dev.mysql.com
Feb 16 20:07:41 DangQuocTuyen mariadb-prepare-db-dir[8492]: Consider joining MariaDB's strong and vibrant community:
Feb 16 20:07:41 DangQuocTuyen mariadb-prepare-db-dir[8492]: https://mariadb.org/get-involved/
Feb 16 20:07:41 DangQuocTuyen mysqld_safe[8570]: 190216 20:07:41 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Feb 16 20:07:41 DangQuocTuyen mysqld_safe[8570]: 190216 20:07:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Feb 16 20:07:43 DangQuocTuyen systemd[1]: Started MariaDB database server.
[tuyendq@DangQuocTuyen ~]$ 
[tuyendq@DangQuocTuyen ~]$ sudo mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[tuyendq@DangQuocTuyen ~]$ 

Popular posts from this blog

Microsoft Windows Server 2012 R2 Standard Evaluation Product Key

Microsoft Windows Server 2012 R2 Standard Evaluation D2N9P-3P6X9-2R39C-7RTCD-MDVJX DBGBW-NPF86-BJVTX-K3WKJ-MTB6V

ManageEngine ServiceDesk Plus - Reset password

Let's reset the default administrator's password to 'admin'

hmailserver: Notes from the field

hmailserver is one of free open source mail servers running on Microsoft Windows operating system.