Mysql让我发疯了......
我知道这个问题已被问过1000次,但对我来说没什么用...我无法连接到mysql!这是在我更新ubuntu 13.1
之后到达的$> mysql
ERROR 1045 (28000): Access denied for user 'jeremy'@'localhost' (using password: NO)
$> mysql -u root -p****
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
$> cd my_work ; rails c
Access denied for user 'working'@'localhost' (using password: YES) (Mysql2::Error)
我已经尝试了一千个命令行,唯一不向我显示permission denied
的是使用--skip-grant-tables
选项运行mysqld但是一旦启动,就好像我没有用户db,甚至是root用户!此外,由于--skip-grant-tables
$> sudo su
$> service mysql stop
$> mysqld --skip-grant-tables --skip-networking &
$> UPDATE user SET password=PASSWORD('********') WHERE user="root";
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
$> SELECT host, user, password FROM user;
localhost | debian-sys-maint | *5480DE723DE487F407399B5208AA09588E67850E
我的所有用户都被删除了吗?我的root用户被删除了吗?如何解决这个问题?!
代表@ user2503775,我的database.yml:
development:
encoding: utf8
adapter: mysql2
reconnect: true
database: working
username: working
password: working
socket: /var/run/mysqld/mysqld.sock