Create database programatically from PHP on WHM/cPanel server

后端 未结 4 899
执笔经年
执笔经年 2021-01-07 04:29

I was wondering whether it is possible to create a new database and user, from PHP, on an WHM/cPanel server.

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-07 05:17

    As long as the user you use to connect to the database has the appropriate privileges defined in MySQL this shouldn't be a problem.

    To create databases the user needs the CREATE privilege (to drop them that would be DROP privilege), to create user(s) you need to have the CREATE USER privilege. You also might need the GRANT OPTION privilege to be able to grant privileges to other users.

    So as long as the DB user(s) you can create through WHM/cPanel have these privileges, you should be ok.

提交回复
热议问题