Tag Archives: MySQL

  • Vim regexp: transforming multiple SQL inserts into a big one

    If you ever face a very slow MySQL process based on a very long insert file and you want to optimize it by unifying a lot of queries, you can do something like the following. Imagine you have a lot of these: INSERT INTO `employee` (`cod_modular`, `sequential_pago`, `a_pater`, `a_mater`, `names`, `type_id_doc`, `document_number`, `cod_dre`, `desc_dre`, `cod_cgef`, […]

  • Profiling MySQL/MariaDB queries

    If you ever face an optimization issue in MySQL or MariaDB and want to know how to measure/benchmark the differences in execution between two queries, you should definitely know about the set profiling=1; command. Here is how it works: mysql> set profiling=1; Query OK, 0 rows affected (0.00 sec) mysql> SELECT count(login_user_id)  FROM stats.track_e_online WHERE […]

  • Important meetings

    Sometimes I like to treat this blog as a personal one and write down things that might affect in fundamental ways our future… or at least my own future, potentially. Anyway, I’m currently living in Peru and had a series of meeting over the last two months with the new Electronical Government Office (ONGEI). Can’t […]

  • Import MySQL tables from .myd

    This is an easy procedure to import any MyISAM table that you would have in .myd, .myi and .frm format, into a local database. I assume you have MySQL server and a MySQL client on your local machine. First, identify the name of the table (that’s the name before the “.myd” extension). Connect to your […]

  • Reset MySQL root password

    Reference: http://www.cyberciti.biz/tips/recover-mysql-root-password.html (partly copied to avoid loosing source) # /etc/init.d/mysql stop Stopping MySQL database server: mysqld. # mysqld_safe –skip-grant-tables & [1] 5988 Starting mysqld daemon with databases from /var/lib/mysql mysqld_safe[6025]: started # mysql -u root Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 1 to server version: […]

  • Dokeos and MySQL strict SQL mode

    We’ve had reports about Dokeos creating problems when used with MySQL in strict mode. There’s a large topic development on the forum about that. The idea is that MySQL can be set to be more strict about the SQL syntax used in queries. Apparently Dokeos doesn’t provide a very strict implementation, so SQL errors appear […]