Manejando datos

Recover a MySQL database with no ibdata1 file

Posted by in Databases, MariaDB, MySQL

Normally, when you start working with databases, you can suffer a dissaster, and you will be lucky if you do not got only one. And that’s what it has happended to me with the database of my thesis, becuase suddenly, my database has been corrupted, and I cannot use it. Or even worse, I have access but I have no data although the file size are large enough (some files, of course). Important: This tutorial is been writen at the same time as I am executing instructions, without knowing what…read more

How to: MariaDB portable using XAMPP

Posted by in Databases, MariaDB

In the last posts of the blog I have talked about databases again, and we are working again with MySQL (what’s new in MySQL 8) and MariaDB. Some weeks ago I had the need to update part of my thesis, which implies (because of the availability) to have portable MySQL or MariaDB. So, I’ll tell you how I got it. Back to 2014 I already published a post testing one of the first versions of the MariaDB 10 series database using the installer (in spanish). And it is still a…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