Install mysql server on Centos 6.3

How to install mysql server on Centos 6.3




1. Install mysql-server on Centos by yum

[root@Centos6 conf.d]# yum install mysql-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base:
* extras:
* rpmforge:
* updates:
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package mysql-server.i686 0:5.1.66-1.el6_3 will be installed
–> Processing Dependency: mysql = 5.1.66-1.el6_3 for package: mysql-server-5.1.66-1.el6_3.i686
–> Processing Dependency: perl-DBI for package: mysql-server-5.1.66-1.el6_3.i686
–> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.66-1.el6_3.i686
–> Processing Dependency: perl(DBI) for package: mysql-server-5.1.66-1.el6_3.i686
–> Running transaction check
—> Package mysql.i686 0:5.1.66-1.el6_3 will be installed
–> Processing Dependency: mysql-libs = 5.1.66-1.el6_3 for package: mysql-5.1.66-1.el6_3.i686
—> Package perl-DBD-MySQL.i686 0:4.013-3.el6 will be installed
—> Package perl-DBI.i686 0:1.609-4.el6 will be installed
–> Running transaction check
—> Package mysql-libs.i686 0:5.1.61-4.el6 will be updated
—> Package mysql-libs.i686 0:5.1.66-1.el6_3 will be an update
–> Finished Dependency ResolutionDependencies Resolved=====================================================================================================================================================================================================
Package Arch Version Repository Size
mysql-server i686 5.1.66-1.el6_3 updates 8.8 M
Installing for dependencies:
mysql i686 5.1.66-1.el6_3 updates 895 k
perl-DBD-MySQL i686 4.013-3.el6 base 134 k
perl-DBI i686 1.609-4.el6 base 705 k
Updating for dependencies:
mysql-libs i686 5.1.66-1.el6_3 updates 1.2 MTransaction Summary
Install 4 Package(s)
Upgrade 1 Package(s)Total download size: 12 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): mysql-5.1.66-1.el6_3.i686.rpm | 895 kB 00:03
(2/5): mysql-libs-5.1.66-1.el6_3.i686.rpm | 1.2 MB 00:05
(3/5): mysql-server-5.1.66-1.el6_3.i686.rpm | 8.8 MB 00:40
(4/5): perl-DBD-MySQL-4.013-3.el6.i686.rpm | 134 kB 00:00
(5/5): perl-DBI-1.609-4.el6.i686.rpm | 705 kB 00:03
Total 222 kB/s | 12 MB 00:53
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : mysql-libs-5.1.66-1.el6_3.i686 1/6
Installing : perl-DBI-1.609-4.el6.i686 2/6
Installing : perl-DBD-MySQL-4.013-3.el6.i686 3/6
Installing : mysql-5.1.66-1.el6_3.i686 4/6
Installing : mysql-server-5.1.66-1.el6_3.i686 5/6
Cleanup : mysql-libs-5.1.61-4.el6.i686 6/6
Verifying : mysql-libs-5.1.66-1.el6_3.i686 1/6
Verifying : mysql-server-5.1.66-1.el6_3.i686 2/6
Verifying : perl-DBD-MySQL-4.013-3.el6.i686 3/6
Verifying : mysql-5.1.66-1.el6_3.i686 4/6
Verifying : perl-DBI-1.609-4.el6.i686 5/6
Verifying : mysql-libs-5.1.61-4.el6.i686 6/6

mysql-server.i686 0:5.1.66-1.el6_3

Dependency Installed:
mysql.i686 0:5.1.66-1.el6_3 perl-DBD-MySQL.i686 0:4.013-3.el6 perl-DBI.i686 0:1.609-4.el6

Dependency Updated:
mysql-libs.i686 0:5.1.66-1.el6_3

[root@Centos6 conf.d]#

2. Start mysql-server

[root@Centos6 conf.d]# /etc/init.d/mysqld start
Initializing MySQL database: WARNING: The host ‘Centos6.3’ 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…
Filling help tables…
OKTo start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your systemPLEASE 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 Centos6.3 password ‘new-password’Alternatively you can run:

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
cd /usr/mysql-test ; perl

Please report any problems with the /usr/bin/mysqlbug script!

[ OK ]
Starting mysqld: [ OK ]
[root@Centos6 conf.d]#

3. Check connection to mysql Server

[root@Centos6 conf.d]# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.66 Source distributionCopyright (c) 2000, 2012, 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 |
| test |
3 rows in set (0.02 sec)


That’s all. Thanks for using

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>