Inserting data in MYSQL

Have been looking for something like this for months and now I’ve found what I’ve been looking for. My question is how can I import the database into my MySQL database? Are there any how to guides to do this?

Probably your best bet is to start with a database download, which uses PostgreSQL. You can then use whichever PostgreSQL→MySQL migration tool you’d like (even just SQL dumps) to copy the schema and data over.


if you didn’t already find this, there’s a wiki page on the topic which points to an active-within-the-last-year project on github.

If it works out, please come back and write a post about what you learn :slight_smile:

1 Like

Many thanks for the link to the wiki page, which I’m happy to say, I got working and a mySQL database created. However, there seems to be a lot of tables empty. When I saw the Tables I got really excited because these were what I was looking for. Instruments, Labels, Artists, cover art etc… The only real tables which offer any volume of data are both the release table and the tracks.

I’m trying to create a music management game in php and my idea was to set this in the late 70s/ early 80s. I was hoping to use this data to get the singles, release dates, record labels and artists. I understand it’s user created and is not yet complete. Just wondering, am I missing data?

You could use the web service to import records if you don’t need everything.

Its probably worth setting up your own mirror though so you don’t hammer it.

Depends on which data files you loaded into postgres, and whether the mysql importer is up to date on the current schema (the latter seems unlikely).

I think this query returns all singles released between 1975 and 1984:

SELECT,, rc.date_year, rc.date_month, rc.date_day
  from release r
       inner join release_group   rg on r.release_group =
       inner join artist_credit   ac on r.artist_credit =
       inner join release_country rc on rc.release =
  where rg.type = 2
    and rc.date_year between 1975 and 1984

(would need tuning to remove multiple hits for the same release group etc); on my postgres db (set up a week or two ago) this seems to return over 12000 rows, which should be fine.

1 Like

Zastai, thanks for the heads up but looked through my data and those tables you use in your query are empty. This leads me to thinking that my database in incomplete…

Are you able to get the normal postgres database set up and query that from MySQL.
There is the connect storage engine that allows you to connect to an external database over odbc and make that table show up in MySQL. This would allow postgres to be set up for replication and allow you to work with the data in MySQL.

Any good, easy to understand tutorials on how to setup postgres and Musicbrainz in windows? Never used it although I’m quite comfy working in mySQL.

If you just want the db (and not the full server setup), take a look at mb-slave.

There’s also a how to on the wiki that may help (although it hasn’t been updated in a few years).

Hi guys, been a while since I looked at this but just tried to run ‘mdzdb’ and getting an error when setting up the schema for mysql.

‘ALTER ABLE ‘deleted_entity’ ADD ‘data’ JSONB NOT NULL’

Is there a page or has someone posted a thread that gives you the schema to set up in mysql. I’ve seen the the official one but that’s for Postgresql and I just can’t seem to get my head into that. With the schema installed correctly I know I can set up my database using the dump files or indeed using ‘mdzdb’ to set it all up.