Before installing, you should check whether the system is comfortable with MySQL software package
Rpm-qa|grep-i MySQL
#如果有的话需要先删除 rpm-e software name--nodeps
#To See all files in an RPM package (for example, a mysql-server rpm), run a command like this:
RPM-QPL mysql-server-version.linux_glibc2.5.i386.rpm
#To perform a standard minimal installation, install the server and client RPMs:
RPM-IVH mysql-server-version.linux_glibc2.5.i386.rpm
RPM-IVH mysql-client-version.linux_glibc2.5.i386.rpm
#安装后生成的一个随机密码在/root/.mysql_secret
#启动 MySQL
Service MySQL Start
#登录mysql
Mysql-u root-p
#修改密码
SET Password=password (' PASSWORD ');
#添加一个可远程登录的帐号
GRANT all privileges on * * to ' root ' @ '% ' identified by ' password ' with GRANT OPTION;
FLUSH privileges;
#修改密码
SET PASSWORD for ' root ' @ '% ' = PASSWORD (' PASSWORD ');
Allow Port 3306
Iptables-i input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT
# See if the rules are in effect
Iptables-l-N # or: Service iptables status
# The production environment is not secure at this time, the port should be closed after remote management, and the previously added rules should be removed
iptables-d input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT
PS, above iptables Add/Remove rules are temporary, if you need to restart after the effective, you need to save the changes:
Service Iptables Save # or:/etc/init.d/iptables save
Other than that
Vi/etc/sysconfig/iptables # plus the following line of rules is OK
-A input-p tcp-m state--state new-m TCP--dport 3306-j ACCEPT
Remote management of the database software, win system can use SQLyog, with several remote software, feel this use is pretty good.
CentOS 6.x installation MySQL