Archive for the ‘MySQL’ Category

Tips for data modelling with MySQL Workbench

Posted on: February 6th, 2021 by Olu No Comments

Hi Folks,

In this post I’ll share¬† few tips when doing database modelling with MySQL Workbench.

If you need to create a table based on another, duplicate the old tables rather than creatiog the table from scratch. To do this. press Ctrl C, Ctrl V. Then update the table name.

Use separate multiple EER diagrams where appropriate. If working on a large database when multiple different concerns, consider using a separate EER diagram for each concern. Don’t shove all very many tables into a single EER diagram.

Double-check queries when synchronizing entity model with database. you will be surprised at some unexpected SQL you may occasionally find generated by MySQL Workbench. To avoid nasty surprises, always read through the SQL queries before applying them to your database.

Use MySQL Model tab to quickly view all tables in a MySQL Workbench file.

When copying tables, pay attention to autoincrement clause carried over from the old table, deleting it if necessary.

That’s all for now. Till next time, happy software development.

How to dump stored MySQL routines

Posted on: June 12th, 2020 by Olu No Comments

Hi folks,

In this post I will quickly share how to make a MySQL dump of stored routines (procedures and functions). Recently, I was looking to back up databases for a MySQL server which I maintain. One of the databases contained a stored function. So, I thought, heh, let’s just use the good old mysqldump the way I do it with tables. Well, it didn’t work. After a bit of Googling and searching MySQL documentation, I eventually found the answer. All you have to do is add the routines flag when invoking mysqldump.



mysqldump --routines -u youruser -p yourdb > yourdb.sql


That’s all for now.