Exporting Revit Schedule to MySQL Workbench DB

Good morning all,

I am trying to export my Revit Schedules into a database (MySQL Workbench) and to be honest I am a bit lost as I am not very skillful in Dynamo and MySQL but, it is something that has been required in my company.

Doing some research I’ve got to the point that Slingshot package would be helpful for this but I am running into some problems.

The first one is that when I am trying to create a new Database with the node “Command.MySQL_Command” the outcome is just “FALSE” and I don’t know if the “Test Javier” Database should be created just with that or more steps are needed. (See image attach)

Any help with this would be very appreciated

Many thanks,

Javier

First issues that grabs my eye is your password code block is red meaning syntax error. “1” would be a string for 1. its erroring as you have 1".
As the Connection String Node output is not shown I am guessing that the connection string node is not creating a usable string for the command node to work.

Hi S.A.M,

First all thanks for the answer.
The password is in red because I didn’t want to show it. Sorry for that.
Even when I insert the right one the command work doesn’t work.

Maybe the code block before the command isn’t right?I am not sure…

Many thanks,

Totally understand the password bit. Next guess would be syntax of the SQL command. It looks like the Command Code block is outputting the scheme and Exists as one word. Maybe try, "CREATE DATABASE IF NOT EXISTS" + " " + scheme for it to output “CREATE DATABASE IF NOT EXISTS test Javier” instead of “CREATE DATABASE IF NOT EXISTStest Javier”.

Otherwise you could check your port and adjust the timeouts on the connection string node. (sorry I gave up on those nodes and used python to got Microsoft SQL instead of MYSQL so this is where my knowledge ends on those nodes).

1 Like

Thank you very much for your help S.A.M.
Still not working but I really appreciate your answer.

Thanks

is MySQL essential ?
It is not particularly easy for beginners and quite picky with security and connection settings. I’d start off with something simpler, such as SQLite or even MSSQL or Postgres

On a Dynamo level- it is probably easier to create the database manually first and test it is working- using an application such as Excel

Then use Dynamo to write (INSERT or UPDATE) or read (SELECT) from the database

Hi Andrew,

My idea is to export Revit Schedules into a SQL database where all the schedules of different projects will be stored, so if at some point someone requires me the number of “X Model” Task Chairs that we have used in 2020 projects, I can query it to the database and get a quick result. This is just a quick example.
My first idea is to export the schedules to an already set up Excel file and from there to the SQL database.
But I was also wondering if there is a way to export directly from Revit to a SQL database using Dynamo.Of course the SQL database can have some tables with columns already set up.

MySQL is not essential. I’ve chosen it because I saw this blog

What would you think is the best approach?

Many thanks

Yes- the link is pretty detailed. The type of database doesn’t really matter- it is the same principle for any database. In my experience, MySQL is a little more difficult for beginners. The other option is to use the ODBC export that is built in to Revit

May as well stay with this if you’ve already got it set up. I’d suggest starting off with something simple such as a SELECT query to check the connection to the database. Once that works, build it up from there

Regardless of the technical stuff- you’d need to think about:

  • what happens if Revit model changes- do you try and work out what has changed- then just update the database with that data, or do you nuke the database and export everything again. Perhaps not an issue if it is just a once-off export at the end of the project

  • the number of objects you are interested in- if just say one object category (furniture) then it is probably pretty simple. For many categories, or taking account of issues such as design options, nested families, grouping & phasing- it gets more complicated

hope this helps

Thanks again Andrew. I totally understand what you said.
The export from revit it will happen just one time at the end of the project so there is not need to worry about that.

To conclude I think the main problem I am having is the connection. I am not sure if I am doing something wrong but is not working

image
image
image

the problem is most likely MySQL security settings

Assuming you ticked the option to open relevant firewall ports when you installed- you may need to disable SSL. I believe this defaults to on in later versions. This is why MySQL is not the easiest for beginners

As before: start off simple- such as a SELECT query (rather than trying to create a schema)



Hi Andrew,

After adding “skip_ssl” into the “my.ini” , Did you just save and when opening MySQL Workbench again the SLL Availability should have changed to Off right?

I did that and it did not work for me…

you’ll need to restart the MySQL service (or the PC)

When you restart workbench, you’ll probably need to edit the connection settings

Dear all, thanks for your support.
I am totally new in Dynamo and want to export my data from Revit to MySQL and import it back.
Could somebody help my in that? how I can create Dynamo script?

Hi,
To be honest I was never able to make it work.
Best approach was to export everything to Excel and from there to MySQL.