Install MySQL on CentOS 5.2

To install MySQL, we do this:
yum install mysql mysql-devel mysql-server

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start



Now check that networking is enabled. Run
netstat -tap | grep mysql

It should show a line like this:
[root@server1 ~]# netstat -tap | grep mysql
tcp        0      0 *:mysql                     *:*                         LISTEN      2584/mysqld

If it does not, edit /etc/my.cnf and comment out the option skip-networking:
vi /etc/my.cnf
[...]

#skip-networking

[...]
and restart your MySQL server:
/etc/init.d/mysqld restart

Run:
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.ocgold.com -u root password yourrootsqlpassword

to set a password for the user root (otherwise anybody can access your MySQL database!).
Posted on Categories Linux

Leave a Reply

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