What is new in MySQL 8

Posted by in Databases, MySQL

In the new series about upgrading from MySQL 5.5 to MariaDB, I must write about what is new in MySQL 8. I must confess that I haven’t tried version 5.7 (I did with version 5.6). In the blog you also have the same series, but 5 years ago moving from 5.1 to 5.6.:

http://www.manejandodatos.es/2013/8/migrando-de-mysql-5-1-a-la-nueva-version-mysql-5-6-10-ga-el-desastre

Because MySQL 8 news are a lot, you can read an extensive article here about it, so here I highlight the more important in my opinion. They are:

Support for UTF8

This is a big change, and an important one because Este cambio es importante, because this character set is the one that supports UTF8 in all its extension, and is the new default game. Personally, it has helped mu a lot reading this article (it is in spanish) about the problem and why the change. If you are still working with previous versions, I recommend that you make the appropriate modifications, following the different steps discussed in the article for upgrading.

For its implementation from now on, whatever version you are working with, the first thing you should know is the path where you have your my.ini configuration file, and you should change the following parameters:

default-character-set=utf8mb4 tanto en [mysql] como en [mysqld]

If you are from Spain (as I am), maybe you can need sometime to have available this page to have the best option for supporting spanish. so, the most recommendable is utf8mb4_es_800_ai_ci.

One of the main new features of MySQL 8 is the default support for Unicode 9, abandoning definitely latin1 (which was before the default option).

Window functions

Window functions are another important new feature of MySQL 8, which are used to perform calculations in data analysis, and address an important need compared to the GROUP BY clause that we can return the underlying data in the same query.

I must invest some time about this, but it sounds cool!

Native support for JSON

The JSON format has already started to be supported in MySQL 5.7, and now this feature is enhanced and improved. For the API developer, this is very good news, because JSON is almost the most used to connect the databases with the front-ends. It’s another aspect that I have to investigate as well, and that for sure will accelerate my work when I know it in more detail.

This feature is related to NoSQL databases (in this blog, we already talked many years ago about MongoDB as a NoSQL database, but since I haven’t used it professionally, I haven’t advanced further in it), and that is that having both features in the same database is an interesting novelty.

Witgh no doubt, this version offers several functions to DBA ready to work with JSON data such as JSON_PRETTY, JSON_TABLE, JSON_ARRAYAGG or JSON_OBJECTAGG ….. Also, there is an inprovement in performance, related to the 5.7 MySQL version.

GIS support

MySQL 8 have Geography support with Spatial Reference Systems (SRS), as well as SRS aware spatial datatypes, spatial indexes, and spatial functions. Without a doubt, this is a declaration of intent for those of us who work with geographical positioning.

And more ….

But these are not the only news, although they are perhaps the most important. Listing them all makes no sense, because you can see it in the changelogs, and also, if you perform a server update, the warnings or errors will surely improve your knowledge about what has been updated.

In the next entrance, you can read about how you can run MySQL 8 portable, that is, installing using files (not the installer). If you need to install a previous version, such as 5.1, 5.5, or 5.6, you can read my articles.

I hope you enjoy the news of MySQL8 and happy coding!