Manejando datos

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.: 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,…read more

Modify COLLATE of all tables and columns in MySQL-MariaDB

Posted by in MariaDB, MySQL

Working with the characters in the databases seems to have no consequences, until you come across things that do not match. In today’s post I tell you how to make it easier to change the COLLATE of the tables all to it. The reason for this entry The reason for this entry is that when making a query, it did not get the correct result. We reproduce what happened to me, and create a database, such that: CREATE DATABASE `test` /*!40100 COLLATE ‘utf8_general_ci’ */; so, let’s create a new table:…read more

Common_schema: repetitive tasks with foreach

Posted by in MariaDB, MySQL

Although we have spoken several times of this framework MariaDB MySQL-today a new feature, I bring very useful when you need to perform repetitive tasks based on consultations. It is used foreach call. Here I present a practical example of how you’ve used to perform a specific task: to replace all null to zero in a table with a lot of fields values. Locating the table fields The best way of locating the fields that will be used in our task is by using the information_schema, an internal database needed…read more

The mecanism of indexing on MySQL-MariaDB

Posted by in Databases, MariaDB, MySQL

In previous entrance related to MySQL and MariaDB I wrote one entrance related to why indexing is important, when working with databases (the article is only in spanish, but I will translate into english), and later, how to force MySQL-MariaDB to use a specific index that it is not the one chosen by MySQL (also in spanish). Today’s entrance is related to explain how works the mechanism of an index on MySQL-MariaDB tables, and what important considerations you need in order to get the best performance, and optimize your queries!…read more

Faster method: TRUNCATE or DROP a table?

Posted by in Databases, MariaDB, MySQL

I am working a a project in the University and I need to re-create a table. For that task, I’m thinking in two ways: using TRUNCATE, or dropping the table and create it again. TRUNCATE is a SQL sentence that empties a table, and for using it, you need to be granted as using DROP priviledge. autokey is reset to zero. The second option is using DROP a table, and create it again using CREATE TABLE. Para valorar de las dos opciones es más rápida, vamos a utilizar PROFILE, para…read more