ITPub博客

首页 > 数据库 > MySQL > MYSQL 安装维护注意事项

MYSQL 安装维护注意事项

原创 MySQL 作者:wenaini 时间:2009-01-22 19:21:01 0 删除 编辑
这几天看别人装,总是有问题,看来还是要写个操作手册[@more@]

安装时,先要用rpm -aq |grep mysql |xargs rpm -e --allmatch --nodeps

删除系统自带的Mysql,然后需要ps-ef |grep mysql看下是不是有正在跑的mysql进程,然后kill了。需要检查下/etc/my.cnf是否已近存在了,如果有那么就删掉,不然最后安装可能会报grant privillege table错误,这个问题在mysql 5上好像没发现,都是mysql 4.0.27报出来的。

这次安装还碰到一次邪门的事情,正在装的时候服务器重启了。。。起来发现ssh登录不上了,幸好有rsh。登录上去启动ssh服务发现:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0775 for '/usr/local/etc/ssh_host_dsa_key' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /usr/local/etc/ssh_host_dsa_key
Could not load host key: /usr/local/etc/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.

解决方法是:

chmod 600 /usr/local/etc/ssh_host_rsa_key
/etc/init.d/sshd start

好像是文件权限安全问题,这个还真有意思。。。

安装完mysql,还需要配置/etc/my.cnf,防火墙策略,如果需要还要配置.my.cnf允许root无密码登录mysql。配置下.mysql_history来保证历史纪录。

注意好上面的几方面,mysql基本就能用用了。。。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/79686/viewspace-1016396/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-02-10

  • 博文量
    50
  • 访问量
    183555