在CentOS、RedHat上,可以使用yum安裝mysql,如果Redhat沒有注冊,則無法在線使用yum安裝,只能手動下載安裝包後,手動安裝,或可以通過掛載RedHat光盤方式,設置配置文件後yum安裝。
yum install mysql
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('new_password');
FLUSH PRIVILEGES;
QUIT;
[root@localhost ~]# /sbin/iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
For REDHAT/CENTOS:
[root@localhost ~]# /etc/init.d/iptables save
附:/etc/init.d/iptables用法:
Usage: /etc/rc.d/init.d/iptables {start|stop|restart|condrestart|status|panic|save}
設置開機啟動:
chkconfig --levels 345 mysqld on