Installation of MySQL on CentOS plain

Following steps will guide you to install MySQL on CentOS plain:

# yum install mysql-server

# /sbin/service mysqld start

# /usr/bin/mysql_secure_installation
Enter current password for root (enter for none): Hit enter
Set password? [Y/n]: y
new Password: root
Re-enter new password: root
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: n
Remove test database and access to it? [Y/n]: n
Reload privilege tables now? [Y/n] Y
Thanks for using MySQL


Issue following command to start MySQL services:

# /sbin/service mysqld start


Launching at boot:
# chkconfig mysqld on


The MySQL shell:
# /usr/bin/mysql -u root -p
Enter password: root

# mysql -u root -p
Enter password: root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16
Server version: 5.1.67 Source distribution

Copyright (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

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.00 sec)


To change root user password:
UPDATE mysql.user SET Password = PASSWORD(‘password’) WHERE User = ‘root’;

Note: Please don’t hesitate to revert in case of any query OR feedback.

Thanking you.

Have a easy life ahead.

Leave a Reply