Learn how to using SQLAlchemy with MySQL by working through an example of creating tables inserting data and querying data with both raw SQL and SQLAlchemy ORM.
It's time to switch all your MyISAM tables to InnoDB. Discover the myths about InnoDB in this blog post.
MySQL uses Redo Logs internally during crash recovery to correct data written by incomplete transactions. But how do you know what the right Redo Log size is? We will walk through how to figure that out in this blog.
We already have a couple of posts related to this topic. “How to calculate a good InnoDB log file size” and “How to Choose the MySQL innodb_log_file_size.” The first one has the formula I’ll mention in this blog, and the second has more details regarding Redo Logs. Most of it is still valid, just replace innodb_log_file_size / innodb_log_files_in_group with innodb_redo_log_capacity.
So in this one, I want to focus on two things:
- Present the new way of working with Redo Logs (No …
Here at OpenLampTech, I try and share plenty of variety in the weekly newsletter. Let me know what you would like to see more of. Thank you for reading
The Newsletter for PHP and MySQL Developers
Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.
In OpenLampTech issue #68, we have content covering:
- What if WordPress moved on from blogging?
- 5 tips for building your 1st Laravel Package
- Modifying HTML in a WordPress plugin
- User role management in WordPress
- And much more
Thanks so much for supporting OpenLampTech. If you’re not already …
[Read more]MySQL Community
Recent MySQL Book Review series, books that ecery MySQL DBAs or developers should have in their library.
ProxySQL is an open-source MySQL proxy server, meaning it serves as an intermediary between a MySQL server and the applications that access its databases. ProxySQL can improve performance by distributing traffic among a pool of multiple database servers.
Consider 2 slaves are routed under Proxysql , In any one of the slave, if the replication is broken, we could still see the traffic routing to the broken replication slave. We can make Proxy to not send traffic to broken replication slave, by setting appropriate value to the variable mysql-monitor_slave_lag_when_null
…
[Read more]This post was originally published in October 2018 and was updated in March 2023.
pt-query-digest is one of the most commonly used tools for query auditing in MySQL. By default, pt-query-digest reports the top ten queries consuming the most amount of time inside MySQL. A query that takes more time than the set threshold for completion is considered slow, but it’s not always true that tuning such queries makes them faster. Sometimes, when resources on the server are busy, it will impact every other operation on the server, and so will impact queries too. In such cases, you will see the proportion of slow queries going up. That can also include queries that work fine in general.
This article explains a small trick to identify such spots using pt-query-digest and the slow query log. pt-query-digest …
[Read more]Hello friends, at Percona Managed Services, we usually do different types of things every day, including routine tasks, monitoring, and, very frequently, answering questions that are not always easy to answer.
A few days ago, a client asked us the following question: “Hey Percona, I have a question and a problem simultaneously: I want to delete rows from a table from a specific date back because the data is not necessary. I tried to run the DELETE command, which gave me this error: Cannot delete or update a parent row: a foreign key constraint fails. Could you please help me?”
At first glance, the error message was obviously clear: the table from which rows were to be deleted had a child table, which prevented the execution of the DELETE directly.
“Don’t worry, we’ll take a look at the issue, and …
[Read more]The MySQL C API replaces the outdated MySQL-Connector-C. The MySQL C API is also known as libmysqlclient, this is how to use it.