我试图为我做的第二个 Wordpress 博客设置新数据库
root@TheLove:/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 108
mysql> CREATE DATABASE wp_name CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON wp_name.* TO name@name.com IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> quit
Bye
之后,当我想停止/重新启动/身份验证时出现此错误
mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
/etc/init.d/mysql stop
Stopping MySQL database server: mysqld failed!
mysqld --skip-grant-tables
130126 0:23:57 [Note] Plugin 'FEDERATED' is disabled.
130126 0:23:57 InnoDB: Initializing buffer pool, size = 8.0M
130126 0:23:57 InnoDB: Completed initialization of buffer pool
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
130126 0:23:57 InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
所以我做了
pkill mysql
/etc/init.d/mysql start
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
root@TheLove:/# ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
还尝试了位于 cat /etc/mysql/debian.cnf 的密码
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
root@TheLove:/# ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
cat /etc/mysql/debian.cnf
在阅读了很多教程后我无法弄清楚这一点也发现有些人以前遇到过这个问题并且他们无法解决它