宝塔面板的数据库使用

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

其中,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。

posted @ 2021-07-23 00:08  oeong  阅读(657)  评论(0编辑  收藏  举报