增加到系统服务器
# chkconfig –add nginx
# chkconfig –add php-cgi
现在可以启动php-cgi和nginx了
# service nginx start
# service php-cgi start
重启动使用restart
开始安装配置mysql
# tar zxvf mysql-5.0.51a-linux-i686-glibc23.tar.gz
# mv mysql-5.0.51a-linux-i686-glibc23 /usr/local/
# ln -s /usr/local/mysql-5.0.51a-linux-i686-glibc23 /usr/local/mysql
# useradd mysql
# chown -R mysql:root /usr/local/mysql/
# cd /usr/local/mysql
# ./scripts/mysql_install_db –user=mysql
# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod 755 /etc/rc.d/init.d/mysqld
# chkconfig –add mysqld
# chkconfig –level 3 mysqld on
# cp ./support-files/my-huge.cnf /etc/my.cnf
# mv /usr/local/mysql/data /var/lib/mysql
# chown -R mysql:mysql /var/lib/mysql
# cd /usr/local/mysql/bin
# for i in *; do ln -s /usr/local/mysql/bin/$i /usr/bin/$i; done
编辑/etc/my.cnf
内容为:
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
max_connections = 1024
# max_user_connections = 40
skip-innodb
#skip-network
#skip-bdb
datadir = /var/lib/mysql
default-character-set=utf8
long_query_time = 5
log-slow-queries = /var/lib/mysql/slow_queries
wait_timeout = 5
thread_stack=128K
interactive_timeout = 20
skip-locking
key_buffer = 256M
max_allowed_packet = 2M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 8
log-bin=mysql-bin
server-id = 1
[mysql]
default-character-set=utf8
在本机上登陆mysql
# mysql -uroot
mysql>
输入一下内(可以复制粘贴啊), 增加一个可以远程连接的用户, 本例用户是hao32, 密码是:hao32.com
然后在web服务器上使用诸如phpmyadmin等软件连接上本台db服务器, 删增相应的用户
INSERT INTO `mysql`.`user` (
`Host` ,
`User` ,
`Password` ,
`Select_priv` ,
`Insert_priv` ,
`Update_priv` ,
`Delete_priv` ,
`Create_priv` ,
`Drop_priv` ,
`Reload_priv` ,
`Shutdown_priv` ,
`Process_priv` ,
`File_priv` ,
`Grant_priv` ,
`References_priv` ,
`Index_priv` ,
`Alter_priv` ,
`Show_db_priv` ,
`Super_priv` ,
`Create_tmp_table_priv` ,
`Lock_tables_priv` ,
`Execute_priv` ,
`Repl_slave_priv` ,
`Repl_client_priv` ,
`Create_view_priv` ,
`Show_view_priv` ,
`Create_routine_priv` ,
`Alter_routine_priv` ,
`Create_user_priv` ,
`ssl_type` ,
`max_questions` ,
`max_updates` ,
`max_connections` ,
`max_user_connections`
)
VALUES (
‘%’, ‘hao32’, PASSWORD( ‘hao32.com’ ) , ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ‘Y’, ”, ‘0’, ‘0’, ‘0’, ‘0’
);
完毕!