mysql -u root --password=admin < c:\test.sqlmysql -u root --password=admin -e "CREATE USER 'test'@'%' IDENTIFIED BY 'test'"为啥执行上面语句时都会提示:mysqladmin shutdown mysqladmin: shutdown failed; error: 'Access denied. You need the SHUTDOWN privilege for this operation' 错误.公司的机子不提示,家里的机子会提示.
mysql/bin/mysql_safe & 终止命令
mysql/bin/mysqladmin shutdown -uroot -p
输入密码
如果出现类似下边的信息,则终止成功。
STOPPING server from pid file /usr/local/mysql/var/test922.pid
081030 17:01:01 mysqld ended
[1]+ Done ./mysqld_safe 如果出现类似
shutdown failed; error: 'Access denied; you need the SHUTDOWN privilege for this operation
说明你当前操作的用户没有shutdown权限,楼主可以先确保操作用户是否有shutdown权限
root用户都没有权限了,怎么恢复回去呢.
为些我重新装了一次mysql,还是这种情况..
不好意思,今天才能上网,我的root用户是有登陆权限的,因为我重新安装了一下,并且服务启动了,单建库和表和用户都可以的.
用 MySQL GUI Tools 操作也畅通无阻.上面的语句执行结果如下.
E:\Documents and Settings\Administrator>mysql -u root --password=admin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 132
Server version: 5.1.37-community MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
连上去后执行一下这个语句。mysql> CREATE USER 'test'@'%' IDENTIFIED BY 'test'
mysql> create user 'test'@'%' identified by 'test'
-> ;
Query OK, 0 rows affected (0.19 sec)mysql>
而如果直接 mysql -u root --password=admin -e "CREATE USER 'test'@'%' IDENTIFIED BY 'test'" 则不行?你的故障现象是这样吗?