Debian Mysql stop 问题

LocalDomain:~# /usr/bin/mysql stop

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

---root 授权问题---

SHOW GRANTS for 'debian-sys-maint'@'localhost';

show grants for 'root'@'localhost';

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '**********' WITH GRANT OPTION;

远程登录问题

  在/etc/mysql/my.conf里面可以修改一些属性。

  原来有这么一行:bind-address = 127.0.0.1

  意思是限定只有本机才能访问,愿意是为了保证数据安全。现在想要使得远程的机器能够访问MySQL数据库服务,就可以通过改bind-address来实现, 两种方式:

  1. bind-address = 0.0.0.0

  2. 直接把bind-address这一行注释掉

  这样做完之后,执行以下命令:

  /etc/init.d/mysql stop

  /etc/init.d/mysql start