经常忘记宝塔面板中数据库的使用,因此做特别记录。

宝塔面板的数据库使用

其中,root密码是指,账号为root的MySQL管理员密码,可以管理所有数据库;
而testDB用户只有管理testDB数据库的权限,在数据库软件中通过该用户也只能连接到这个库。

连接远程数据库可能会遇到的问题

错误:ERROR 1130: Host '192.168.1.3' is not allowed to connect to thisMySQL serve

解决办法:
帐号不允许从远程登陆,只能在localhost。更改"mysql" 数据库里的 "user" 表里的 "host"项,从"localhost"改称"%"。

mysql -u root -p
mysql>use mysql;
mysql>select 'host' from user where user='root';
mysql>update user set host = '%' where user ='root';
mysql>flush privileges;
mysql>select 'host' from user where user='root';

完成后重启MySQL。

相关文章:

  • 2021-08-09
  • 2021-12-09
  • 2022-12-23
  • 2021-06-26
  • 2021-09-21
  • 2022-12-23
  • 2021-08-04
  • 2021-10-07
猜你喜欢
  • 2021-10-25
  • 2021-10-30
  • 2022-01-21
  • 2021-04-23
  • 2021-05-27
  • 2022-01-14
  • 2021-07-10
相关资源
相似解决方案