Please see the following FAQ. (There are a couple of links in the FAQ which might be useful.)
Can Juicebox handle a custom data source, for example RSS or Instagram?
Every Juicebox gallery must have a 'config.xml' file (where the gallery's configuration options and image data are stored).
However, the 'config.xml' does not need to be a static file created when the gallery is authored. It can be generated dynamically (by a server-side scripting language such as PHP) at the time the gallery is displayed.
You'd need to point Juicebox towards a PHP (or alternative language) script using a configURL entry in your gallery's embedding code, for example:
<!--START JUICEBOX EMBED-->
<script src="jbcore/juicebox.js"></script>
<script>
new juicebox({
containerId: "juicebox-container",
galleryWidth: "100%",
galleryHeight: "100%",
backgroundColor: "#222222",
configUrl: "config.php"
});
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->
The output of the 'config.php' file would need to be in the format of a regular Juicebox 'config.xml' file but, within the script, you could pull in data from whatever source you like (such as a MySQL database).
It would certainly be possible to do but knowledge of PHP (or similar) and how to query your database would be required.
There is a simple example of a dynamically generated configuration file (to display images from a designated web server directory) in this forum post which might help.
I hope this points you in the right direction.