MySQL远程访问数据库语法如下:
grant [权限] on [数据库名].[表命] to [‘用户命‘]@[‘web服务器的ip地址‘] identified by [‘密码‘];
例句:
GRANT ALL PRIVILEGES ON *.* TO ‘myuser‘@‘%‘ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;
切记,授完权限后要刷新数据库权限,执行如下代码:
flush privileges;
时间: 2024-12-21 08:45:52