1. 配置开机启动服务
/sbin/chkconfig httpd on [设置apache服务器httpd服务开机启动]
/sbin/chkconfig –add mysqld [在服务清单中添加mysql服务]
/sbin/chkconfig mysqld on [设置mysql服务开机启动]
/sbin/service httpd start [启动httpd服务,与开机启动无关]
/sbin/service mysqld start [启动mysql服务,与开机无关]
2. 设置mysql数据库root帐号密码。默认的初始化密码为空~~~
mysqladmin -u root password ‘new-password’ [引号内填密码]
3. 让mysql数据库更安全
mysql -u root -p
mysql> DROP DATABASE test; [删除test数据库]
mysql> DELETE FROM mysql.user WHERE user = ”; [删除匿名帐户]
mysql> FLUSH PRIVILEGES; [重载权限]
4.安装上mysql扩展
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
5.设置默认编码等一些初始参数(my.cnf)
vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
default-character-set=utf8 [添加]
default-storage-engine=INNODB [添加]
old_passwords=1
[client]
default-character-set=utf8 [添加]
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
本文摘自网络由网络安全攻防研究室(www.91ri.org) 网络信息安全小组收集整理.
Copyright © hongdaChiaki. All Rights Reserved. 鸿大千秋 版权所有
联系方式:
地址: 深圳市南山区招商街道沿山社区沿山路43号创业壹号大楼A栋107室
邮箱:service@hongdaqianqiu.com
备案号:粤ICP备15078875号