Linux PHP has insufficient permissions to connect to MySQL: 1. Grant query, insert and other permissions to ordinary data users by using the grant command; 2. Grant permissions to create tables and indexes to database developers through grant. .
What should I do if linux php has insufficient permission to connect to mysql?
Linux php has insufficient permissions to connect to mysql. Mysql fine-grained permissions division:
mysql can grant you a user such as select, insert, update, delete, etc. One or more of the permissions mainly use the grant command. The usage format is:grant 权限 on 数据库对象 to 用户
grant select on testdb.* to common_user@’%’ grant insert on testdb.* to common_user@’%’ grant update on testdb.* to common_user@’%’ grant delete on testdb.* to common_user@’%’
grant select, insert, update, delete on testdb.* to common_user@’%’
grant 创建、修改、删除 mysql 数据表结构权限。 grant create on testdb.* to developer@’192.168.0.%’; grant alter on testdb.* to developer@’192.168.0.%’; grant drop on testdb.* to developer@’192.168.0.%’; grant 操作 mysql 外键权限。 grant references on testdb.* to developer@’192.168.0.%’; grant 操作 mysql 临时表权限。 grant create temporary tables on testdb.* to developer@’192.168.0.%’; grant 操作 mysql 索引权限。 grant index on testdb.* to developer@’192.168.0.%’; grant 操作 mysql 视图、查看视图源代码 权限。 grant create view on testdb.* to developer@’192.168.0.%’; grant show view on testdb.* to developer@’192.168.0.%’; grant 操作 mysql 存储过程、函数 权限。 grant create routine on testdb.* to developer@’192.168.0.%’; - now, can show procedure status grant alter routine on testdb.* to developer@’192.168.0.%’; - now, you can drop a procedure grant execute on testdb.* to developer@’192.168.0.%’;
grant all privileges on testdb to dba@’localhost’
grant all on *.* to dba@’localhost’
grant select on *.* to dba@localhost; - dba 可以查询 mysql 中所有数据库中的表。 grant all on *.* to dba@localhost; - dba 可以管理 mysql 中的所有数据库
grant select on testdb.* to dba@localhost; - dba 可以查询 testdb 中的表。
grant select, insert, update, delete on testdb.orders to dba@localhost;
grant select(id, se, rank) on testdb.apache_log to dba@localhost;
grant execute on procedure testdb.pr_add to ’dba’@’localhost’ grant execute on function testdb.fn_add to ’dba’@’localhost’
show grants;
show grants for dba@localhost;
grant all on *.* to dba@localhost; revoke all on *.* from dba@localhost;
grant select on testdb.* to dba@localhost with grant option;
PHP Video Tutorial"
The above is the detailed content of What to do if linux php has insufficient permission to connect to mysql. For more information, please follow other related articles on the PHP Chinese website!