/    Sign up×
Community /Pin to ProfileBookmark

Create database from PhpMyAdmin BUT without access to root user

Hello people!

I am on a competition for a job, and I was asked to make various tricky things I could manage to solve them.

But now I am asked to create a database from PhpMyAdmin, I am getting access to a webhosting service, I am loging to cPanel and then access from there to PhpMyAdmin.

The thing is that I cannot create databases from PhpMyAdmin, since I am logged as a user without privileges to create databases. Here I am trying to create a database directly from console:
[https://ibb.co/FsQWn1P](src)

Even the button to make new Databases is disabled:
[https://ibb.co/Lx5xxNS](src)

And I cannot access to the .mysql folder from the terminal, since it is inside root directory.

I think the hint here is that I am using a shared webhost:
[https://ibb.co/gFnhTxN](src)

There is a MySQL Database wizard in cPanel but that is not a valid solution. I also have to name the database with 2 words beginning with capital letters like this: “MyDatabase”

But from the SQL wizard it is all set to lowercase and it has to have my user prefix, then “_” and finally the name of the database: “myuser” + “_” + “database-name”
[https://ibb.co/c1svN5L](src)

Remember that I don’t have access to the root user (at least I don’t have any password) so I cannot grant privileges to my current user (the one that I have access to PhpMyAdmin) to create databases.

I have until today at midnight to submit my solution (this issue is only one from many that I have already solved), so if you can help me, I would be really really thankful.

I still am researching, this is the only thing that I am missing, I will post the answer if I find it.

P.S.: Sorry for my noobness to post pictures, I’ve been awake for a lot of hours now, I really want to sleep.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJul 03.2020 — If your MySQL user does not have create privileges and you do not have access to a MySQL user account with admin privileges to change that, then you are not going to be able to do it in that database. Seems like either you ask them to add the privileges you need, or you do it on your own local installation of MySQL and provide them the scripts/SQL you used to do it for your "answer".
Copy linkTweet thisAlerts:
@ekoh95authorJul 03.2020 — @NogDog#1620216 thank you for the reply, that might actually work, since the only condition is to create the database from phpMyAdmin. I will later post if that was the answer, thank you man!
Copy linkTweet thisAlerts:
@VITSUSAJul 04.2020 — I agree with NogDog, without privileges how it is possible?
×

Success!

Help @ekoh95 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...