Database location in directory

Eladnova

Registered
Feb 2, 2018
4
0
1
Dublin
cPanel Access Level
Website Owner
Hi all
I have SSH access to my shared hosting (A2 Hosting) and am wondering where databases are stored.

I'm new to cPanel (normally use Plesk) so this is new to me.

Here's a screengrab of what I can see when using my FTP application

Thanks - appreciate the help.
 

Attachments

cPWilliamL

cP Technical Analyst II
Staff member
May 15, 2017
258
30
103
America
cPanel Access Level
Root Administrator
Hi @Eladnova,

What operations are you trying to perform that require direct access to the MySQL data directory? You typically do not directly interact with MySQL files. The MySQL data directory is set to '/var/lib/mysql/' by default; however, this is off limits to cPanel users, but still accessible via MySQL interfaces, as configured in cPanel > MySQL Databases.
 

Eladnova

Registered
Feb 2, 2018
4
0
1
Dublin
cPanel Access Level
Website Owner
Hi @cPWilliamL

Thanks for asking. I might be approaching this (wrongly) with some assumptions from using Plesk.

Basically I have a local NAS with an SSH backup app built in. It lets me perform scheduled backups of my entire cPanel. I was hoping that somewhere within the directory structure I'd find useable database backups.

Also, with Plesk installation on my VPS my scheduled and dropbox backups both FTP me my webspaces which includes my databases.

So I guess I'm finding that cPanel is a little different in this respect.

I know there's a Backup Wizard which will backup databases but at the moment cPanel doesn't offer scheduled backups to saved destinations.
 

Attachments

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

You'd need to utilize the "mysqldump" utility first to generate a backup of the database via the command line. That will allow you to generate a copy of the database in the account's home directory, which you can then have moved to your remote destination.

Thank you.