MySQL8 Question (increment field)

The question is with mysql8 how the F&*# do you increment a field!? For years all you did was UPDATE myCoolTable SET field=field+1 now this chits the bed with the typical vague useless consult the manual error. Reading the docs and searching the web is worthless as everything is about auto_increment not operations on a specific field. Anything relevant is outdated and just says “use the syntax you’ve been using for 20 years.”

Did you try adding backticks to everything?
UPDATE `myCoolTable` SET `field` = `field` + 1
AFAIK, that syntax is still valid.

1 Like

No I’ve never used them, nor did I have to in the past but that did work. Queue “Why the F do I need this now?” I’m guessing this is one of the many little stupid changes to various strict / lax settings under the hood. Seems every update I have to go change some obscure global setting to make old stuff work anymore. I f0king hate updates anymore. It’s like every day you wake up to find some ahole rearranged your house for “security and feature enhancements.”

1 Like

Yea I know that feeling. It could mean that whatever your field column is, is now a reserved word in MySQL 8 and if it was working in 5.x, then it probably wasn’t a reserved word in that version.

You can see the MySQL reserved words here

Good call! * RANK (R); added in 8.0.2 (reserved) bastards! Now a few million “Warning this will throw error in the next update” bs to fix…I despise this “Hey this isn’t allowed anymore…good luck figuring out how we expect you to do this now because the docs won’t say how to approach a replacement philosophy/methodology and any searches will turn up what’s worked for the last 20 years which is what won’t work now.” -Aholes laughing…

I know that the maintainers used to be good with stating that something will be deprecated in the next release. Are they not doing that now. Is this a personal project or a corporate one? If corporate, there should be a certified SQL DBA on staff specifically looking for these things.

I don’t really deal with DBA stuff anymore and now most of what I touch is MSSQL or SQL Lite.

If you don’t have logging turned on. I would do so. If you don’t have any type of parser or automation software looking for these things, I would recommend implementing something. Automation could be a weekend saver.

Sorry I’m very tired, burning the midnight frag just to unwind and kinda glazed over your response. I’ve seen warnings previously about a query using what will become (or is now) a reserved term in the past. This time it was just the normal vague “error near -snippet of sql-” and given my syntax was fine was bloody frustrating.

Everything is personal these days. I’m well and retired but I do things for some friends and org’s etc.

For the last 5 years I’ve had some big problems with mysql, even just a basic update normally ends in disaster and restoration anymore. It’s one of those stop procrastinating and migrate to something else kinda things at this point. In fact I was upgrading my one server when you guessed it, mysql hung and nuked the whole upgrade. Redid the machine clean, MySql is still a dumpster fire right out of the gate. Not overly fond of php right now either. Seems like everything is a never ending cycle of PHP 5 to 7 or Python 2 to 3 at this point. (Sorry Dolly 9 to 5 is tired, now it’s 5 to 7 or 2 to 3.) Endlessly reworking things because they keep stealing words or drastically restructuring how you can do things.

Have you ever mess with PostgreSQL I am a big fan of it, but what I do now no longer needs something so bloated (in a good way). I actually started with Oracle’s PL SQL as I was being mentored to become a Junior DBA. Postgres is the closes thing to it and in general, I rather support the F/LOSS software.

Outside of that, your issues sound exactly why MariaDB was forked from MySQL; that and the acquisition by Oracle. PHP is yet another pain but I am a dinosaur and I understand the LAMP stack good enough. I need to get better on the other competing stacks like MEAN, LYCE, and LYME, but you know, new tricks are hard. My personal site runs LAMP and I have been able to manage it by running minimal plugs.

I did actually fool with PostgreSQL for about a week when I got rumblings of MySql being bought up (which you mention), that was damn near 20 years ago now though. Things kinda worked out to where I didn’t have to switch and familiarity and “easier to find crap in a search” has kinda kept me chained to it. MySql has become like that old machine in the corner no one knows how to log into or what it’s even running…but it keeps running so long as you don’t touch it. Which is to say it’s fine so long as you don’t let it update or do anything else. However running Debian forces you into newer packages when you upgrade so you can’t hold things indefinitely like on a rolling release.

My problem with stacks anymore is outside LAMP everything treads to close to things I view as just flat out tire fires. I’ve refused to touch most things because they become so interconnected and those interconnections are often times explosive if versions update out of sync. (think any garbage that even looks in the direction of npm) I could be out of touch with a few options though. This is a massive topic and honestly a few years back I flat out canned all my projects and just went into I give up/maintenance mode. Which is the TL;DR to say I conceded a major corp cough Google had royally fKd me out of everything I was trying to do. Sounds a tad conspiratorial or “they’re all out to get me” but I’d hope by now most people know there are enough big players who have got everyone hooked on some dependency, tool kit or engine they’ve “given” out as FOSS which allows them to low key dictate. Go with their flow or you’re out the door…Outside that you could just start from scratch…if you never slept, had 20 pairs of eyes and a pair of arms/hands to go with them, never aged, or died, slept etc and worked on it non-stop for 20 years heh.

Sadly a lot of FOSS is going this way now too. They are trying to act like they’re in some competition with Apple and MSFT and now that what seems to be the vast majority of FOSS uses GTK they can push everyone around. For me the final straw wasn’t the non-stop GTK3 breaks GTK3 fiasco that went on for so long but the fact GTK is now 100% broken by design for multi XScreen/GPU. This same same issue where things have become so big it’s kinda impossible to do from scratch so you adopt a tool kit…but then down the road that turns around to bite you when they remove all the functionality you need or make some radical changes that just destroy everything you’ve built.

Stay woke my friend. Don’t let them catch you sleeping. Unfortunately the Benevolent benefactor playbook has worked for the big tech companies, and as you mentioned, they have given this stuff away and as a result, people have been locked into these different echo systems with high interdependence of the components. Some stack components are exclusive and cannot be changed out with other components.

Yup, why I just said F-it. Years ago I moved to web-dev. That has a bad rap but back then I was like screw this! I’m sick of porting and always having to figure out what headers do what on each system. Back then I was running BeOS, Windows, BSD and Linux. So I figured most of what I wanted to do could live in the web…until Apple and Google contorted web browsers and Firefart decided to implode with stupidity. When this whole Flock thing was announced it was kinda a deathknell for a project I was 2 years deep into. Now I just wanna keep what I have going and hopefully die as soon as possible… hehe.