Yum install MySQL and set password Shell code yum install mysql-server yum install mysql-devel chgrp-R mysql/var/lib/mysql chmod-R 770/var/lib/ mysql service mysqld start mysql set password for 'root' @ 'localhost' = PASSWORD ('secret _ password '); set the default encoding and other initial parameters (my. cnf) (if my. cnf, You Can cp/usr/share/mysql/my-small.cnf/etc/my. cnf) vi/etc/my. cnf [mysqld] datadir =/var/lib/mysql socket =/var/lib/mysql. sock user = mysql default-character-set = utf8 [add] default-storage-engine = INNODB [add] old_passwords = 1 [client] default-character-set = utf8 [add] [mysqld_safe] log-error =/var/log/mysqld. log pid-file =/var/run/mysqld. the following is the general operation of pid: Change the root password: mysqladmin-u root password 'newpassword' add mysql user: grant all privileges on my_db. * TO 'user' @ 'localhost' identified by 'Password'; DELETE the test DATABASE: mysql-u root-p mysql> drop database test; DELETE an anonymous account: delete from mysql. user WHERE user = ''; overload permission: mysql> flush privileges; if you want other machines to access it, in mysql. add a user whose Host is '%' to the user, then flush priviledges; and then add a statement similar to this to the firewall (enable port 3306 ): shell code-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT if you want reboot self-starting: Shell code chkconfig -- levels 345 mysqld on