The CyberPanel CLI:
Can be used to make a database and user, which automatically grants localhost privileges for the user to the database.
cyberpanel createDatabase --databaseWebsite cyberpanel.net --dbName cyberpanel --dbUsername cyberpanel --dbPassword cyberpanel
And you can manually add the remote host access at the CyberPanel dashboard, by picking a database, and user, and under “Remote Access” selecting “Manage”: ip.ip.ip.ip:8090/dataBases/listDBs
I was wondering, is there any way to grant remote access via the CLI? For a user to a database.
If I use mysql via Linux to grant remote privileges:
mysql -u root -p[rootpassword] -e "GRANT ALL PRIVILEGES ON database_name.* TO 'user_name'@'%' IDENTIFIED BY 'user_password';FLUSH PRIVILEGES;"
Or to drop the user:
mysql -u root -p[rootpassword] -e "drop user 'user_name'@'%';"
Then I can see the changes reflected in phpMyAdmin. However, I don’t see the changes updated on the CyberPanel dashboard (at ip.ip.ip.ip:8090). If for instance I drop the user, the dashboard still shows the user having remote access % privileges.
Can adding and removing remote privileges be done via the CLI?