How to Install MySQL Server on CentOS 5.8

In this post, i will show on how to install MySQL database server on linux CentOS 5.8 server. MySQL server is a database server that can stores and retrieves data for the blog, websites and applications. It is one of the most popular most used in the internet especially for content management and blogging site. MySQL is a Relational Database Management System (RDBMS) that runs as a server providing multi-user access to a number of databases. For more information on MySQL, you can visit their website at www.mysql.com.

First of all, to install mysql server, you can simply execute this command :

[root@centos58 ~]# yum install mysql-server -y

Examples :

[root@centos58 ~]# yum install mysql-server -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.issp.co.th
 * updates: mirror.issp.co.th
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.i386 0:5.0.95-1.el5_7.1 set to be updated
--> Processing Dependency: mysql = 5.0.95-1.el5_7.1 for package: mysql-server
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server
--> Processing Dependency: perl(DBI) for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15) for package: mysql-server
--> Processing Dependency: perl-DBI for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15) for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15 for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15 for package: mysql-server
--> Running transaction check
---> Package mysql.i386 0:5.0.95-1.el5_7.1 set to be updated
---> Package perl-DBD-MySQL.i386 0:3.0007-2.el5 set to be updated
---> Package perl-DBI.i386 0:1.52-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                    Arch             Version                      Repository           Size
====================================================================================================
Installing:
 mysql-server               i386             5.0.95-1.el5_7.1             updates             9.8 M
Installing for dependencies:
 mysql                      i386             5.0.95-1.el5_7.1             updates             4.9 M
 perl-DBD-MySQL             i386             3.0007-2.el5                 base                148 k
 perl-DBI                   i386             1.52-2.el5                   base                600 k

Transaction Summary
====================================================================================================
Install       4 Package(s)
Upgrade       0 Package(s)

Total download size: 15 M
Downloading Packages:
http://mirror.oscc.org.my/centos/5.8/os/i386/CentOS/perl-DBD-MySQL-3.0007-2.el5.i386.rpm: [Errno 12] Timeout: 
Trying other mirror.
(1/4): perl-DBD-MySQL-3.0007-2.el5.i386.rpm                                  | 148 kB     00:01
(2/4): perl-DBI-1.52-2.el5.i386.rpm                                          | 600 kB     00:12
(3/4): mysql-5.0.95-1.el5_7.1.i386.rpm                                       | 4.9 MB     02:36
(4/4): mysql-server-5.0.95-1.el5_7.1.i386.rpm                                | 9.8 MB     03:48
----------------------------------------------------------------------------------------------------
Total                                                                37 kB/s |  15 MB     07:09
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-DBI                                                                     1/4
  Installing     : mysql                                                                        2/4
  Installing     : perl-DBD-MySQL                                                               3/4
  Installing     : mysql-server                                                                 4/4

Installed:
  mysql-server.i386 0:5.0.95-1.el5_7.1

Dependency Installed:
  mysql.i386 0:5.0.95-1.el5_7.1   perl-DBD-MySQL.i386 0:3.0007-2.el5   perl-DBI.i386 0:1.52-2.el5

Complete!

Note : MySQL server service daemon is mysqld.

To check Mysqld status :

[root@centos58 ~]# service mysqld status
mysqld is stopped

Start MySQL service :

[root@centos58 ~]# service mysqld start

Start MySQL service at first time :

[root@centos58 ~]# service mysqld start
Initializing MySQL database:  WARNING: The host 'centos58.ehowtuff.local' could not be looked up with 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...
OK
Filling help tables...
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 centos58.ehowtuff.local 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 with the /usr/bin/mysqlbug script!

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
                                                           [  OK  ]
Starting MySQL:                                            [  OK  ]

Stop MySQL service :

[root@centos58 ~]# service mysqld stop

Make mysqld daemon start at boot :

[root@centos58 ~]# chkconfig mysqld on

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

Leave a Reply

Your email address will not be published. Required fields are marked *