分类: Mysql/postgreSQL
2007-08-07 22:55:42
hbli-debianetcinit.d# .mysql restart
Stopping MySQL database server mysqld failed!
Starting MySQL database server mysqld already running.
usrbinmysqladmin connect to server at 'localhost' failed
error 'Access denied for user 'debian-sys-maint'@'localhost' (using password YES)'
错误,但可以正常使用,但每次都弹出这个东西来,很不爽阿
是在 Debian 安装 MySQL 的朋友, Debian 预设启动 MySQL 的使用者账号为 debian-sys-maint@localhost , 您可以在 /etc/init.d/mysql 前面看到以下片段:
代码:
MYADMIN="/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf"
意思是会使用 /etc/mysql/debian.cnf 里所设定的账号?韱 MySQL, 所以您有几个选择:
1.把里面启动的账号改成您在 mysql.user table 里有权限的账号.
2.把 root 的 password 更改后, 进入 database 里, 到 mysq.user 的 table 里新增 debian-sys-maint 在 localhost 可允许 reload 与 shuwdown Database 的权限.
再去把 /var/run/mysqld/mysqld.sock 与 /var/run/mysqld/mysqld.pid 删除即可.
那用那种比较安全呢?如果把帐号和密码写到debian.cnf里的话启不是谁都可以看到密码
如果在user表里增加一个debian-sys-maint那么密码填什么?就直接写原来debian.cnf里那个加密过的密码吗(不用PASSWORD(),直接把值放到password字段)?
chinaunix网友2008-08-01 00:33:03
我把debian-sys-maint的密码给改了,结果也出那个提示,后来把debian.cnf里边的密码改成我自己设置的密码就可以了,不是数据库里select出来的一堆加密后的字符,是登录时输入的密码。