I have a recurrent problem with phpMyAdmin: its relation view feature allows to create/drop foreign keys, but offers no control over the name of the constraint created.
Basically, it relies on default FK names like UserAddress_ibfk_2
.
That becomes tricky when trying to version a database with SQL patches, when we have no control over the names of the constraints. Of course we can write all FK-related queries by hand, but that's like loosing a bit the point of using a tool like PMA.
Are you guys using good alternatives to phpMyAdmin that have a nice FK editor allowing to edit the names of the constraints?
MySQL Workbench provides a visual interface to administer your MySQL environment. The available visual tools help configure your MySQL servers, administer users, perform backup and recovery, inspect audit data, and view database health.
You can disable foreign key check in MySQL by setting the system variable foreign_key_checks to 0. However, please note, after you enable foreign key checks, MySQL will not re-validate your existing data that you added after disabling foreign key check. It will only check any new additions/updates to your database.
To disable a foreign key constraint for INSERT and UPDATE statements. In Object Explorer, expand the table with the constraint and then expand the Keys folder. Right-click the constraint and select Modify. In the grid under Table Designer, select Enforce Foreign Key Constraint and select No from the drop-down menu.
MySQL supports foreign key references between one column and another within a table. (A column cannot have a foreign key reference to itself.) In these cases, a “child table record” refers to a dependent record within the same table.
You can use:
They are available in different version Windows, Linux or MAC
Yes it's called Mysql Workbench
Very handy tool and available in different OS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With