r/mysql Nov 03 '20

mod notice Rule and Community Updates

25 Upvotes

Hello,

I have made a few changes to the configuration of /r/mysql in order to try to increase the quality of posts.

  1. Two new rules have been added
    1. No Homework
    2. Posts Must be MySQL Related
  2. Posts containing the word "homework" will be removed automatically
  3. Posts containing links to several sites, such as youtube and Stack Overflow will be automatically removed.
  4. All posts must have a flair assigned to them.

If you see low quality posts, such as posts that do not have enough information to assist, please comment to the OP asking for more information. Also, feel free to report any posts that you feel do not belong here or do not contain enough information so that the Moderation team can take appropriate action.

In addition to these changes, I will be working on some automod rules that will assist users in flairing their posts appropriately, asking for more information and changing the flair on posts that have been solved.

If you have any further feedback or ideas, please feel free to comment here or send a modmail.

Thanks,

/r/mysql Moderation Team


r/mysql 1d ago

discussion Leaving MySQL after 25 years of reliable stability

41 Upvotes

I figured I'd write a reality-based "kudos" on MySQL.

I run a small software company. In 2001, I made a website content manager that ran on MySQL 4. It is somewhat similar to what WordPress would become, though it predated WordPress by a couple of years.

I am writing this in July of 2026. MySQL 4 has been rock solid, running my website, and other websites, for 25 years. I did not tinker with it. It kept working.

Yet, my paid software development work was not in MySQL. In that same 2001 time frame when I chose MySQL, I was approached by a client who wanted me to implement a Microsoft SQL Server database engine for their custom business software, which had until then been using Microsoft Access as its database engine.

They liked what I did, and wanted more. They remained my client for about 20 years, until COVID-19 hit them very hard: their main business involved in-person trade shows.

Over time, I became highly skilled in working with the Microsoft SQL Server database engine, including migrating Visual BASIC for Applications (a.k.a. VBA) custom program code from Microsoft Access into the database language of Microsoft SQL Server: Transact-SQL (a.k.a. T-SQL).

There were some compelling reasons to also migrate my website content manager from the MySQL 4 database engine to the Microsoft SQL Server database engine, since the latter was what I was most comfortable working with.

It’s like one of my automotive clients who standardized on using Ford vans and trucks, yet they also have one old International truck that just refuses to die, so they keep using it, and it keeps working.

I figured that leaving MySQL was not urgent, since I do know MySQL 4 well enough to be able to fix any problems if they were to arise. Yet, none did. 

The recent 25 years of my life have been tumultuous. The recent 25 years have been tumultuous for America too. So my attention often went to whatever was the newest crisis, not always to what made calm, strategic sense.

Also, as the saying goes: "If it ain't broke, don't fix it." So, I just stayed on MySQL for my content manager. For 25 years, the software based on MySQL 4 kept running flawlessly. But more impressively: MySQL 4 kept running flawlessly.

My website content manager is a fairly sophisticated piece of software that includes 119 database tables, A/B testing, various logs, and so on. The logs grew and grew … for 25 years.

Finally, the logs in MySQL 4 grew to be large enough to run the virtual machine out of disk space. Yes, I could have cleared the logs, but that doesn’t shrink the MySQL 4 database. Some additional work would be needed to make the database smaller again.  And that, I didn’t really want to do. Yes, I could have increased the disk space.  But …

I had lived the great American tradition, of kicking the can down the road, for 25 years.

I decided that if I was ever going to migrate away from MySQL, this was the best time. So I did. And now my website content manager runs on Microsoft SQL Server, where it is indeed easier for me (emphasis on "for me") to work with it, such as if I want to implement significant changes to the software, such as table structure changes.

I'm not saying Microsoft SQL Server is better than MySQL. But I'm reminded of the time when a colleague mused: "Sometimes, the best tool for the job is the tool you know best." There some merit to his argument (and, I concede, much merit to the contrary too).

After 25 years, I finally decommissioned the virtual machine on which MySQL 4 had been running.

That is a very long time for a database engine. So, a massive "kudos" to MySQL 4 and the people who made it.

For me, the migration was fairly intricate. I'd hoped it would be as simple as "download and run this conversion utility" but somehow that approach turned out to be non-viable for me. At some point, I stopped looking for easy solutions and I made my own process, and I powered through. No doubt: smarter people would have done it better.

Even so, if you might benefit from knowing the specific steps I took, feel free to ask.


r/mysql 5d ago

discussion Reality Check: Is ProxySQL + Signal18 Replication Manager a good HA setup for MariaDB?

3 Upvotes

Hi everyone,

Before taking this to production, I'd like a reality check.

Current setup:

  • MariaDB Primary + Replica
  • ~2,500 reads/sec
  • ~1,500 writes/sec
  • GTID replication

I decided against Galera because I was concerned about synchronous write latency. Instead, I'm planning:

  • 2× ProxySQL + Keepalived (VIP)
  • Signal18 Replication Manager for automatic failover
  • Existing Primary/Replica architecture

Questions:

  • Does this look like a solid HA architecture for this workload?
  • Any hidden pitfalls with ProxySQL + Replication Manager?
  • Would you recommend a different approach instead?

Looking for real production experience. Thanks!


r/mysql 6d ago

solved TAF: 3.1 Add CPU affinity support for MySQL/MariaDB (taskset integration)

4 Upvotes

TAF: 3.1 Add CPU affinity support for MySQL/MariaDB (taskset integration)

- Added new cpu_affinity property to MySQL and MariaDB plugins
- Updated template plugin to expose cpu_affinity for future DB makers
- Normalized affinity range parsing (e.g., 0-11)

New usage block:
O = --db-cpu-affinity=<list|range>
P = taf.db_cpu_affinity=<list|range>
: CPU affinity for the database engine.
: Pins the database process to specific CPUs. : Valid forms: : 0,1,2,3 : 0-11
: (future) 0-3,8,10-12 : If unset (null), the database runs on all CPUs.

https://github.com/MariaDB/TAF/commit/18ffedd142f38d79151ecabd4c68259e9a629fee


r/mysql 6d ago

question Unable to connect with root@localhost

2 Upvotes

I am setting up a SQL server so I can run a WordPress intranet site. I installed the latest version of MySQL and Workbench and went through the set up leaving everything default but adding a password. However I am unable to connect. Whenever it asks me for password it just says in unable to connect with some various things to check.

I am on a windows server 2025 VM and I have a domain admin account I'm logged in with.

How can I check go see of the root account was created?


r/mysql 6d ago

question what does incremental msgstore backups contain ?

1 Upvotes

What does incremental msgstore.db mean for whatsapp ? Do incremental msgstore.db backups contain previous chats that are not contained in the "msgstore.db" ?


r/mysql 7d ago

solved Informix en la actualidad ¿Por que?

2 Upvotes

Hola amigos,

Se han encontrado en la problemática de tener sistemas "legacy" a pesar de tener capacidades para seguir escalando pero aun siguen estancados en bases de datos Informix?

Hace un tiempo me encontré con un sistema escrito en PHP 5.2 y fue la ultima versión que XAMPP dejo de publicar el conector para bases de datos Informix, de ahí todo fue una pesadilla porque; a pesar de que la base de datos no estaba normalizada correctamente, los problemas de rendimientos con 10 usuarios simultáneos eran caóticos.

En este tiempo dominaba muy bien Rust y decidí crear una herramienta muy primitiva pero funcional para migrar bases de datos enormes en Informix a PostgreSQL 12. Funciono a la perfección pero la gerencia no me quiso dar mas tiempo para poder migrar los SPs y funciones propias para automatizar procesos.

Todo esto para ya no depender de la esclavitud de IBM porque realmente este motor es muy costoso a nivel de licenciamiento.


r/mysql 8d ago

question Looking for the best free YouTube channel or website to learn MySQL deeply (with lots of practice)

7 Upvotes

Hello everyone,

I'm a second-year engineering student, and I want to learn SQL in depth. I've already covered the basic topics using Apna College's MySQL one-shot video on YouTube.

Now I'm looking for a YouTube channel or website that covers intermediate and advanced topics and provides lots of practice questions to help me improve.

If you've learned MySQL from a resource that you genuinely think is excellent, I'd really appreciate your recommendation.


r/mysql 8d ago

discussion Profiling database lag: how lowering our connection pool limits actually made our backend faster

9 Upvotes

We’ve been scaling a high-traffic microservice that handles a high volume of concurrent database reads and writes. A few weeks ago, as traffic started to spike, we noticed a strange degradation in database response times. Our immediate instinct was to throw more hardware at the problem and increase the maximum open connection pool limit on our SQL driver, thinking that more concurrent connections would allow the database to process queries faster.

To our surprise, increasing the connection pool made the latency spikes even worse. The CPU usage on our database instance was pinned at nearly 100%, even though the actual query volume hadn't changed that much.

I ran a deep profile on the database server itself and realized we had fallen into a classic connection pooling trap. Every single database connection is not free; it requires the database engine to spawn a dedicated OS thread or process, allocate memory buffers, and constantly context-switch between them to handle incoming traffic. By opening up hundreds of connections, we weren't making things faster—we were forcing the database to spend more CPU time context-switching between connections than actually executing the SQL queries.

I went back into our configuration and aggressively lowered the connection pool limits to a much tighter, conservative number that closely matched the physical CPU core count of our database server.

The results were immediate and massive. CPU usage on the database dropped significantly, context switching plummeted, and our total query throughput actually went up.

It was a huge reminder for our team that database connections are a physical hardware bottleneck, not an elastic software resource. If your backend is hitting sudden database lag under load, it might be worth trying to shrink your pool limits instead of expanding them.


r/mysql 12d ago

discussion Birthdate stored as UTC Date + unique index (firstName, lastName, birthDate); timezone shifts are causing wrong/duplicate values

6 Upvotes

Storing birthDate as a Mongo Date, with a unique index on (firstName, lastName, birthDate) to catch duplicate records.

Frontend builds the ISO string by taking "now" overriding just the year/month/day, then calling .toISOString(). Problem: the time-of-day at submission carries through, so depending on the user's timezone and what time they submit, the date can shift by a day after UTC conversion. Same birth date can end up stored as two different days, and in some cases two different real birth dates collide onto the same stored day - which breaks the unique index outright.

Can't change how the frontend serializes the date.

Anyone hit this before, or know a better fix?


r/mysql 15d ago

question Install MySQL Linux mint

18 Upvotes

Hello all
I’m currently studying my sql and want to install on my machine, is a GUI or CLI the better option

Any help appreciated
Thanks
David


r/mysql 19d ago

question Return the 3rd entry of each week.

7 Upvotes

Hi all,

I have a table with sport sessions that have a date column. I want to select every third entry (sport session) of each week.

I can't figure out how to do it.

What im trying to do is:

Select sessionID FROM table

WHERE It was the third entry with YEARWEEK(date)

Does anyone have any suggestions?


r/mysql 20d ago

solved MySQL Workbench to DBeaver Transition

11 Upvotes

r/mysql 20d ago

solved You need a database for testing your program?

Thumbnail github.com
2 Upvotes

r/mysql 22d ago

discussion Wait, MySQL 28.4? Did I just sleep through 20 years of database releases?

7 Upvotes

If you recently saw people talking about MySQL 28.4 and thought you accidentally pulled a Rip Van Winkle, don't panic. You didn't sleep through two decades, and your server didn't spontaneously evolve.

Check more here: https://comunidademysql.com.br/novo-versionamento-mysql-28-4-atualizar/


r/mysql 28d ago

solved MySql Workbench Not Opening

8 Upvotes

Hi, I'm a complete beginner learning to use SQL. I tried opening mysql workbench after a while of not using it, and it just never started. I tried deleting and downloading it twice and nothing has changed. Though something weird is that the MySql Workbench folder never disappeared and I can't delete it even after I deleted the content inside it, so this may be related to what's happening.

Edit: The MySqlWorkbench.exe file is there but it doesn't run when I click on it, and trying to open it in command prompt just says "the directory is invalid"

Edit 2: Solved this by shutting down MySqlWorkbench.exe via task manager, as it somehow was running all along. After that I deleted the entire workbench folder and reinstalled the entire thing which made it work again!


r/mysql Jun 22 '26

question Proyecto análisis de datos

0 Upvotes

¡Hola a todos! Recientemente completé un proyecto de análisis de negocio utilizando la base de datos Sakila en mysql para poner a prueba mis habilidades. Analicé el rendimiento operativo y me encantaria recibir feedback para mejorar y saber que me falta

Aquí está mi repositorio de GitHub: https://github.com/LumigLumebros/Sakila_Business_Analysis .


r/mysql Jun 21 '26

idea I got tired of manually documenting database schemas, so I built a tool to export them directly to Markdown

3 Upvotes

Hey everyone,

Working on a project i realized that quick database schemas change could be a pain to explain to coding agents.

To solve this, I created  a lightweight, open-source tool designed to instantly export your database structure into clean, readable Markdown files (perfect for your GitHub wikis, READMEs, or internal docs).

What it does:

  • Connects to your database and reads the entire schema.
  • Generates clean Markdown files documenting tables, columns, data types, and relationships.
  • Saves time and keeps your team's documentation synced with the code.

It is completely open-source and free. I’m currently looking for feedback to improve it—features you'd like to see, edge cases, or support for specific database dialects.

Code and images: https://github.com/Bilodev/DBtoMD


r/mysql Jun 21 '26

question Getting stuck for some reason?

1 Upvotes

So i am just trying to create something related to my project and after i created the table i realised that i had written char(1) in one column and that i needed varchar(2), so i tried to modify that column obviously but when i entered the modifying the command, sql got stuck for some reason on the next line??? i tried typing something anything but nothing showed, it was like it hung/froze but when i did ctrl+c, it showed query aborted then showed what i had written. when i tried to drop both the table and the database same thing happened. what should i do because this is starting to get really annoying?


r/mysql Jun 18 '26

troubleshooting Database instance loading

0 Upvotes

com.primavera.integration.client.ClientException: Unable to get database instances.

at com.primavera.integration.client.Session.getDatabaseInstances (Session.java:337)

at com.collabro.legare.f.111111.111111 (APIPVConnectionProvider.java:83)

at com.collabro.legare.j.111111.IIII11 (PVLoginDetails.java:125)

at com.collabro.legare.d.IIll11.111111(LoginWindow.java:282)

at com.collabro.legare.d.IIllll.<init>(LoginWindow.java:71)

at com.collabro.legare.main.Main.llllll (Main.java:156)

at com.collabro.legare.main.Main.main(Main.java:84)

Caused by: java.lang.ExceptionInInitializerError

at com.primavera.integration.client.LocalSession.getDatabaseInstances (LocalSession.java:90)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.primavera.integration.client.Session.getDatabaseInstances (Session.java:319)

6 more

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'registryService' defined in class path resource [com/primavera/bre/integration/intgconf.xml]: Invocation of init method failed; nested exception is com.primavera. PhoenixException: Unable to resolve privileged username and password

Error opening connection to do with connection string: jdbc:sqlserver://10.231.169.55:1433;database=PMDB_22; and properties (user-pubuser, v $session.process=12072, v$session.program=P6-BRE-PrivUserResolver}

at

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:620)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)

at org.springframework.beans.factory.support. DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:234)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:953)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)

at com.primavera.bre. Initializer.start(Initializer.java:28)

at com.primavera.bre.Application.start(Application.java:114)

at com.primavera.integration.server.ServerFacadeBase.<init>(ServerFacadeBase.java:121)

at com.primavera.integration.server.ServerFacadeBOMgr.<init>(ServerFacadeBOMgr.java:156)

at com.primavera.integration.server.ServerFacade.<init>(ServerFacade.java:31)

at com.primavera.integration.server.ServerFacade. <clinit>(ServerFacade.java:26)

12 more

Caused by: com.primavera. PhoenixException: Unable to resolve privileged username and password

Error opening connection to do with connection string: jdbc:sqlserver://10.231.169.55:1433; database=PMDB_22; and properties (user=pubuser, v $session.process=12072, v$session.program-P6-BRE-PrivUserResolver}

at com.primavera.infr.db.PrivUserResolver.<init>(PrivUserResolver.java:139)

at com.primavera.infr.srvcs.RegistryServiceImpl.init(RegistryServiceImpl.java:101)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$invokeCustomInitMethod $7(AbstractAutowireCapableBeanFactory.java:1920)

at java.security.AccessController.doPrivileged (Native Method)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1919)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invoke InitMethods (AbstractAutowireCapableBeanFactory.java:1872)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)

27 more

Caused by: java.sql.SQLException: Error opening connection to do with connection string: jdbc:sqlserver://10.231.169.55:1433;database=PMDB_22; and properties (user=pubuser, v$session.process=12072, v$session.program=P6-BRE-PrivUserResolver}

at com.primavera.infr.db.DriverManagerUtil.getConnection (DriverManagerUtil.java:84)

at com.primavera.infr.db.PrivUserResolver.<init>(PrivUserResolver.java:112)

37 more

I

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host 10.231.169.55, port 1433 has failed. Error: "Connection timed out: no further information. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

I'm getting this error when application is loading database instances and the ip address in this error is production database and it should actually point to pre prod database as this is pre prod. How can I approach the problem.


r/mysql Jun 17 '26

question Database instances

3 Upvotes

I'm having issue at work. The application database instance is not loading and I'm not sure what's the issue. If anyone can help me fix me. Kindly ping me if anyone can help, like how to resolve the issue. Thanks in advance


r/mysql Jun 14 '26

question MYsql

6 Upvotes

What is the difference between read uncommitted and repeatable read ,if repeat able read is taking a snapshot of old row and using it again whenever needed and don't care about other transactions so isn't it same as read uncommitted some how??


r/mysql Jun 13 '26

query-optimization Is it a good practice to pass mysql2 createPool to a function as an argument

3 Upvotes

Just wanted to know if there are any issues with passing the mysql2.createPool(options) to another function as an argument instead of ending and reopening the pool multiple times

Desired Result:

I want to make multiple mysql queries from the same connectionPool, but all of my queries reside in different functions, if it safe to pass mysql2 pool as an argument to those functions, and finally end the pool after all of those queries are called.

Code:

Database: MySQL, Language: Node/javascript, Other Tools Used: Express

const mysql = require('mysql2/promise');
const mysqlOptions = require('./db/mysqlOptions');

// This is a secondary function that accepts createPool as an arg
async function secondFunc(query, arga, mysF) {
let final = await mysF.execute(query, arga);
return finalResult;
};

//START HERE 
// This is the first function, where createPool is initialized 

async function mainFunction(query, args) { 
 const con = await mysql.createPool(mysqlOptions);
 let [results, fields] = await secondFunc(query, arga, con);
 // Passing pool to secondFunc await con.end();
 // Ending the connection at last return 
 {result: results, field: fields};
 };

I have tried it and it works as expected and the connection is closed at the end.

I just want to know if there are any risks associated with this method, or is it better to just end the pool and restart it at every function.

Thank You in advance.


r/mysql Jun 11 '26

question Help with slow stations because of data ( this is what I think)

7 Upvotes

Can someone help me understand what could cause this?

I'm still learning SQL and only taking basic courses right now. We have a machine connected to a MES system and a PLC. In one station there is a CHECK IN step, and sometimes a CHECK OUT step, where the MES trigger is executed.

Every few months (maybe every 3 or 4 months), the machine cycle time becomes about 1 or 2 seconds slower during those steps. The machine still runs, but it is noticeably slower than normal.

What is strange is that the Chinese engineers who built the machine connect remotely and do something in SQL or the database, and after that the cycle time goes back to normal. This has happened several times.

I know this is probably not enough information to find the exact problem, but I would like to understand what kinds of things could cause this. Could it be related to indexes, large tables, locks, database maintenance, or communication between the MES and SQL?

I'm asking because I will probably be responsible for supporting these systems in the future, and I'm trying to learn more about how SQL affects MES and PLC systems.

Any ideas would be appreciated.


r/mysql Jun 07 '26

question Migrate old instance 5.1 to 9.7

12 Upvotes

Hello everyone!!

I'm trying to migrate a small database of about 2.6 MB from MySQL 5.1 to a more recent version, such as 9.7.

I understand that it's a very old system and might have problems, but the database is very old, and I'm not sure if a phased migration is necessary. The problem I'm having is that I've always used the checkForServerUpgrade() plugin, which is available in the MySQL shell, but I can't use it because it's an older version than 5.7 and doesn't support it.

So, I understand that I would have to see which elements in the instance itself are incompatible with the new version 9.7. I imagine there are many, or perhaps none, since the instance, as I said, is very small.

Could you tell me the appropriate steps in this situation? I don't think it's as simple as exporting/importing the instance with a dump.

Thanks!