简体   繁体   中英

How to access database created from root in the terminal from cpanel?

I have an issue here, not sure what to do.

I am running a game on my server and wanted to add a control panel script. It uses the databases I've created for the game under the root account. But I've also created a database and user for the control script in cpanel.

This is my error

Mysqli extension not loaded. Please verify your PHP configuration.

I believe the script is not getting access to the databases I created under root. Since the script config uses the cpanel mysql user and database info, and the mysql users and databases I've created in the terminal. Is there a way to give the mysql user I created for the script access/all priveleges to the Databases I created under root?

This Error isn't related to the mysql permissions, it says that the mysqli extension isn't loaded with your php config,

if the extension files installed on your server, you just need to load it in your php.ini file,

find this line in your php.ini file and uncomment it:

;extension="mysqli.so"

just remove the ";" from the begin of the line. and restart your apache, if doesn't work, so it needs to install it,

For the mysql databases, you can login to your mysql server with root and grant the required permissions to any user you want, like this:

GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'localhost'
  • change ALL PRIVILEGES with the required permissions if you don't like to grant all permissions to this user.
  • change databasename with your databasename and the * with table name if you don't like to grant permissions on all tables to this user.
  • change username with the user that you want to grant permissions to.

regards,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM