配置mysql服务
[[email protected] ~]# find / -name mysql.server
/opt/lampp/share/mysql/mysql.server
/opt/lampp/bin/mysql.server ##mysql启动文件[[email protected] ~]# ln -s /opt/lampp/bin/mysql.server /etc/rc.d/init.d/mysql ##软连接(理解为快捷键)
[[email protected] ~]# vi /etc/rc.d/init.d/mysql ##大概看了一眼[[email protected] ~]# chkconfig --add mysql ##增加mysql的系统服务
[[email protected] ~]# chkconfig --list mysql ##列出mysql服务的设置情况
mysql 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭[[email protected] ~]# netstat -an|grep :3306
tcp 0 0 :::3306 :::* LISTEN
[[email protected] ~]# ps -aux|grep mysql
Warning: bad syntax, perhaps a bogus ‘-‘? See /usr/share/doc/procps-3.2.8/FAQ
root 2436 0.0 0.2 3044 1340 pts/0 S 11:46 0:00 /bin/sh /opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql --pid-file=/opt/lampp/var/mysql/centos1.pid
mysql 2797 0.6 19.0 330620 97348 pts/0 Sl 11:46 0:00 /opt/lampp/sbin/mysqld --basedir=/opt/lampp --datadir=/opt/lampp/var/mysql --plugin-dir=/opt/lampp/lib/mysql/plugin/ --user=mysql --log-error=/opt/lampp/var/mysql/centos1.err --pid-file=/opt/lampp/var/mysql/centos1.pid --socket=/opt/lampp/var/mysql/mysql.sock --port=3306
root 2830 0.0 0.1 5980 756 pts/0 S+ 11:48 0:00 grep mysql
[[email protected] ~]#配置apache服务
[[email protected] ~]# find / -name apachectl
/opt/lampp/bin/apachectl
[[email protected] ~]# ln -s /opt/lampp/bin/mysql.server /etc/rc.d/init.d/mysql
[[email protected] ~]# vi /etc/rc.d/init.d/mysql ##加入#chkconfig:2345 85 15
[[email protected] ~]# chkconfig --add mysql
[[email protected] ~]# chkconfig --list mysql
mysql 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[[email protected] ~]# service mysql stop
Shutting down MySQL.. SUCCESS!
[[email protected] ~]# service mysql start
Starting MySQL.. SUCCESS!
[[email protected] ~]# ps -aux|grep mysql
Warning: bad syntax, perhaps a bogus ‘-‘? See /usr/share/doc/procps-3.2.8/FAQ
root 2436 0.0 0.2 3044 1340 pts/0 S 11:46 0:00 /bin/sh /opt/lampp/bin/mysqld_safe --datadir=/opt/lampp/var/mysql --pid-file=/opt/lampp/var/mysql/centos1.pid
mysql 2797 0.8 19.0 330620 97348 pts/0 Sl 11:46 0:00 /opt/lampp/sbin/mysqld --basedir=/opt/lampp --datadir=/opt/lampp/var/mysql --plugin-dir=/opt/lampp/lib/mysql/plugin/ --user=mysql --log-error=/opt/lampp/var/mysql/centos1.err --pid-file=/opt/lampp/var/mysql/centos1.pid --socket=/opt/lampp/var/mysql/mysql.sock --port=3306
root 2824 0.0 0.1 5980 756 pts/0 S+ 11:48 0:00 grep mysql