MySQL: Optimizing indexes after importing tables - mysql

I have imported a database from MySQL 5.6 into MySQL 5.5 (existing database). Now the problem is some stored procedures are taking too much time to execute. So I have checked execution plan by using "Explain" command. I have found some indexes are not working on MySQL 5.5 version but same indexes are working fine on MySQL 5.6 version. Below screenshots are for reference.
MySQL 5.5:
Explain Result MySQL 5.5 Screenshot
MySQL 5.6:
Explain Result MySQL 5.6 Screenshot
Please let me know if I am missing anything or if I need to change anything on MySQL 5.5.

Related

Mysql query broswer not showing schemata (databases)

Hello, people, I'd appreciate it if you could assist me with this problem. I'm using workbench and mysql, and I have a few schemata (databases) in my sql. However, when I log in using Mysql Query Browser, it doesn't show my schemata (databases), but it does when I use workbench.
MySQL Query Browser was the first visual DB query tool from MySQL. Since a decade or so it has been replaced by MySQL Workbench and does not support servers beyond 4.x (IIRC).

Mysql 8.0: High CPU Usage

We are using mysql 8.0 and also running 5.7 in some environment. We found our mysql 5.7 running fine on mostly environment but we are facing high CPU usage for 8.0. I didn't find anything in slow_query_logs, show processlist, persistent connections removed from PHP.
Same database dump working fine on mysql 5.7. I would really appreciate your quick suggestions.
Is mysql 8.0 is stable for live/production? please also share your thoughts.

Downgrade data from MySQL 5.7 to MySQL 5.1

I need to downgrade data from MySQL 5.7 to MySQL 5.1. are there any ways to do in simple steps? (backup and restore )T
There is a solution is step by step like downgrade from 5.7 to 5.6, and then to 5.5.
The Following link says step by step
Make sure you're not using features from 5.7, that are not avaliable in 5.1, for example utf8mb4 encoding (needed for emoji characters)
Then most safe option is to mysql_dump all databases via mysqldump, except for mysql (actually you need mysql.user table, but it's safer to recreate, other settings tables may and most probably will not fit)
Try restoring on staging server first, to see if restored db works the way you expect it to

MySQL migrate data from 5.1 to 5.6 - threats

I do plan to migrate the database from version 5.1 to version 5.6.
I want to do this by using mysqldump:
Export (by mysqldump) data from MySQL DB 5.1 to sql file,
Import (by mysqldump) this sql file that MySQL 5.6 database,
Do not have a complex database that migration can be associated with some risks?
What to look for?
I can not do update database from 5.1 a 5.6, because I can not stop the production base at this point.
Generally speaking it is safe (and supported) to upgrade using mysqldump.
My best suggestion is to use mysqldump from MyQSL 5.6 against the 5.1 server, as newer versions have quite a few fixes to ensure the correct order when dumping foreign keys and other bits and pieces. Your 5.1 version may have these fixes already, but using the newer version won't hurt in any case.
Ensure you run mysql_upgrade after importing the database into 5.6, and then restart the server, as per the MySQL upgrade guide:
http://dev.mysql.com/doc/refman/5.6/en/upgrading.html
Alternatively if you can update in two steps, you can do a in-place binary upgrade by first upgrading to 5.5.x before 5.6.x, ensuring to run mysql_upgrade during both steps.

Can I use MySQL Workbench to create MariaDB?

I am totally new to databases. I would like to create a database; I am going to make a small project which is going to use DB. I am going to use Maria DB as it is totally free for commercial use.
The question is: Can I use MySQL workbench program to create a database and then transform/change it to MariaDB?
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.
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 will forward engineer a compatible MariaDB SQL file.
Currently (Oct 2019) the generated SQL_MODE output is still compatible with MariaDB. Just like InnoDB, which is also preferred when using MariaDB in most cases.
Just to list a few other options:
MySQL Workbench
Heidi Sql
SQLyog
No.
The latest version of Workbench 8.0 is not supported in MySQL.
Yes, although connecting to view existing database on a remote MariaDB server will crash the current client (6.3.10). I use it mainly to deploy database models and that works fine, even on remote servers.
I just deployed to a MariaDB 10.3 server with that client and it worked fine, see screenshot.