MySQL Database Location?

sedwards
Contributor

Trying to upgrade my JSS 9.98 to 9.100 and want to backup the database first. However, I can't seem to locate the database in order to backit up using the JSS Database Utility. I've looked in the database.xml as other's have suggested but there is no database path listed there. I'm running MySQL Server 5.7.

Any ideas?

5 REPLIES 5

scottlep
Contributor II

The default location for mySQL is /usr/local/mysql-xxx.xxx.-blahblahblah

The database should be in the data folder in that location

c855e05a7527428aa2db6513ede560a3

chriscollins
Valued Contributor

@sedwards why do you need the physical path of the database? The JSS database utility talks to the database over the network and dumps the data to a file. The only place where you should ever be asked to select a file path in the Database Utility is where to save the compressed database dump file.

The only information it needs for the database itself is the IP address and login credentials to the MySQL database itself. You should never be touching the actual raw database files.

sdagley
Esteemed Contributor II

@sedwards As @chriscollins says you don't need to know where the MySQL database is on disk to back up your JSS database with the JSS Database Utility. If you really wanted to know though, on Windows it'd be at %PROGRAMDATA%MySQLMySQL Server 5.7

Venn
New Contributor

if you have a file /etc/my.cnf. If so, it should tell you where the data directory is. For example:

[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
...
My guess is that your mysql might be installed to /usr/local/mysql-XXX.

Not applicable

By default, the datadir is set to /var/lib/mysql in the /etc/mysql/mysql.conf.d/mysqld.cnf file. Edit this file to reflect the new data directory: sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

I hope it will be useful for you.