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

 

相关文章:

  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
  • 2021-11-08
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
相关资源
相似解决方案