Is it possible to create database without creating user?

Bilal YILMAZ

New member
Joined
Mar 27, 2022
Messages
6
I have a database and a user in a host.
hostname is hostname_db and user is hostname_user

I want to park a domain name on the same host and create a new database using API through my software.
I want the database user to be one. But I want my databases to be multiple.

For example, new databases I will create;
It will proceed as
hostname_db_00001
hostname_db_00002
hostname_db_00003 etc....

and I have to access all of them with my hostname_user.

I was able to do this in cpanel and vestapanel before.
But when using the CMD_API_DATABASES command in your api, it definitely requires user and pass. and creating a new user.

How can I overcome this problem?
 
Last edited:
I solved it by setting the user's privileges via mysql.
While creating a database through the API, I also create a user, but I can access all of them with a single user whose authority I have increased.

I ran a similar command with root user;
SQL:
GRANT ALL PRIVILEGES ON  `hostname\_db\_%`.* TO 'hostname_user'@'localhost';
 
Back
Top