Posts

Showing posts with the label Mariadb

Can I Use MySQL Workbench To Create MariaDB?

Answer : From my experience -- Sure, you can use MySQL Workbench with MariaDB. However, I have tried basic functionalities only, like queries, schema design etc. Not sure about compatibility of advanced features. Just to list a few other options: MySQL Workbench Heidi Sql SQLyog So my experiences are, yes you can use MySQL Workbench for MariaDB database designs. However I needed to change the "Default Target MySQL Version" to 5.7 . This can be done by going to: Edit->Preferences in the menu. And finally to Modeling->MySQL. Since the latest MySQL version, v8.x, the SQL statements are not compatible with MariaDB statements (like creating an index). MariabDB creating an index on a table: INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC) vs MySQL: INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC) VISIBLE MariaDB can't handle this VISIBLE keyword in this example. Using an old MySQL Version, MySQL Workbench...

Cannot Drop Column : Needed In A Foreign Key Constraint

Answer : Having a look at MySql docs I've found a warning about foreign_key_keys : Warning With foreign_key_checks=0, dropping an index required by a foreign key constraint places the table in an inconsistent state and causes the foreign key check that occurs at table load to fail. To avoid this problem, remove the foreign key constraint before dropping the index (Bug #70260). IMHO you should drop FOREIGN KEY before DROP the COLUMN. ALTER TABLE `user` DROP FOREIGN KEY `FK_G38T6P7EKUXYWH1`; ALTER TABLE `user` DROP COLUMN `region_id`; I've set up a rextester example, check it here.

Can't Reset MySQL (MariaDB) Root Password

Answer : I have found a solution that is as strange as the problem itself. Reboot MySQL/MariaDB using --skip-grant-tables (search for tutorials on the web). (not necessary at all, read my edits at the end of the post) Look at the plugin field into the mysql.user table: MariaDB [mysql]> SELECT user, plugin FROM user; +------+-------------+ | user | plugin | +------+-------------+ | root | unix_socket | | root | unix_socket | | root | unix_socket | | root | unix_socket | +------+-------------+ I had to reset the plugin field of each entry to a blank string. UPDATE user SET plugin=""; // without WHERE clause Also, make sure that a password is defined, because sometimes it seems to be erased (select on user, password fields). If not, update it with: UPDATE user SET password=PASSWORD("my_password") WHERE user="root"; Privileges parameters need to be saved explicitly: FLUSH PRIVILEGES; Then, restart MySQL in normal mode and ...