Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "mysql"
Too much stupid today..
Client: "Our server is almost full, fix it"
Me: "Okay, you can upgrade the VM, or I can see if theres anything that can be cleaned up?"
C: "Clean it up"
Me: *Finds 5 extra MySQL DB's that amount to 50-60GB in total*
Me: "Well I can remove some of your extra databases, and some of the local backups, as they're also backed up offsite. They're currently unused and dated back to the beginning of 2017, everything is out of date anyways."
Me: "Okay, is there a reason?"
Me: "Okay, so we'll upgrade the VM?"
Me: "I'm sorry, but those are really your two options"
C: "Just fix it"
What in the ducking fuck !@#$#%?
If you're so fuggin smart, then why do they pay me?
I'm clearly stupid and unable to read your mind.22
Yesterday I managed to optimize a query...
Went from 43 seconds to 0.0702 seconds.
For some reason mysql decided to copy the data of 4 huge tables into a temp table and do its operations there... (the copying to temp tale took 42/43 seconds)
Two composite indexes later and I saved the company hours of time over the course of a few months.
For a flipping two hours the code wasn't working. Then I saw this single dot instead of comma...
When I was an intern, I wrote a very heavy MySQL query with multiple joins. Quite frustrated, I asked for some help from one of my seniors.
He came by on my desk and told me, "Explain your query!".
I was completely blank-faced O_O.
After a few moments, the senior grabbed this hopeless bastard's keyboard and typed "EXPLAIN" in the beginning of the query; and then ran it.
I thought he was being hard to me.8
Fun fact: Michael Widenius named "MySQL" after his daughter My. When MySQL was acquired by sun, he decided to start a new open source database, "MariaDB", named after his second daughter Maria.
This guy is (partially) responsible for two of the largest databasesystems in the world.
Imagine his daughters apply for a database engineering job one day. During application process: "One of the largest databases in the world was named after me..." 😂20
I remember some years ago when a professor asked -
"What is the difference between SQL and MySQL?"
And one of the students answered -
Uh... I don't know... SQL is more like a general SQL and MySQL is a personal SQL...
I have to let it out. It's been brewing for years now.
Why does MySQL still exist?
It was lousy as hell 8 years ago, and since then it hasn't changed one bit. Why do people use it?
First off, it doesn't conform to standards, allowing you to aggregate without explicitly grouping, in which case you get god knows what type of shit in there, and then everybody asks why the numbers are so weird.
Second... it's $(CURRENT_YEAR) for fucks sake! This is the time of large data sets and complex requirements from those data sets. Just an hour through SO will show you dozens of poor people trying to do with MySQL what MySQL just can't do because it's stupid.
Recursion? 4 lines in any other large RDBMS, and tough luck in MySQL. So what next? Are you supposed to use Lemograph alongside MySQL just because you don't know that PostgreSQL is free and super fast?
Window functions to mix rows and do neat stuff? Naaah, who the hell needs that, right? Who needs to find the products ordered by the customer with the biggest order anyway? Oh you need that actually? Well you should write 3-4 queries, nest them in an incredibly fucked up way, summon a demon and feed it the first menstrual blood of your virgin daughter.
There used to be some excuses in the past "but but but, shared hosting only has MySQL". Which was wrong by the way. This was true only for big hosting names, and for people who didn't bother searching for alternatives. And now it's even better, since VPS and PaaS solutions are now available at prices lower than shared hosting, which give you better speed, performance and stability than shared hosting ever did.
"But but but Wordpress uses MySQL" - well then kill it! There are other platforms out there, that aren't just outrageously horrible on the inside and outside. Wordpress is crap, and work on it pays crap. Learn Laravel, Symfony, Zend, or even Drupal. You'll be able to create much more value than those shitty Wordpress sites that nobody ever visits or pay money on.
"But but but my client wants some static pages presented beside their online shop" - so why use Wordpress then? Static pages are static pages. Whip up a basic MVC set-up in literally any framework out there, avoid MySQL, include a basic ACL package for that framework, create a controller where you add a CKEditor to edit page content, and stick a nice template from themeforest for that page and be done with that shit! Save the mock-up for later use if you do that stuff often. Or if you're lazy to even do that, then take up Drupal.
But sure, this is going a bit over the scope. I actually don't care where you insert content for your few pages. It can be a JSON file for all I care. But if I catch you doing an e-commerce solution, or anything else than just text storage, on MySQL, I'll literally start re-assessing your ability to think rationally.12
So I gave this guy access to a database and phpMyAdmin and then I get this:
Him: hello??? i cant make databases i have no privilages
Me: Use tables instead of databases...
Him: I need to make databases
Him: 1. my votes plugin 2. my ftop plugin 3. my forums 4. my new forums 5. my new forums (he runs a minecraft server fml)
Me: You don't need databases for all of those, you can use tables, that's a massive waste
Him: idc i would rather have databases
Tonight I want to try to setup an openvpn server with mysql based authentication because I'd love to somehow setup/become a vpn provider.
Of course there's a huge ass legal part but let's first make sure I know the technology of the top of my head!
Just ranting this out because I'm excited 😊27
At the moment I'm trying to optimize a slow old MySQL query from a project I made several years ago. The execution time is in excess of 55 seconds. Not good :(
After about an hour of experimenting I finally set a good index and reduced the time to < 3 seconds.
It would be really FUCKING great if NodeJS or mysql could give me a FUCKING shout or ERROR MESSAGE when one of the parameters I'm giving is not the RIGHT FUCKING DATA TYPE INSTEAD OF THROWING A RANDOM ERROR THAT DOESN'T INDICATE A WRONG MOTHERFUCKING DATA TYPE. Five FUCKING hours of debugging later.17
- John says that your sql is not working fine, but his does, so use his sql.
- but boss, MySQL ...
- I said use his sql
This is one of the most unexpected, silly and ridiculous behaviors of MySQL: it doesn't support LIMIT in sub-queries, however it perfectly supports it in sub-sub-queries. WTF.10
Job title :
"PHP and MySQL Programmer"
Job description :
"We are looking for a Flash Developer with a high level of proficiency developing ActionScript solutions.... bla bla Development in a 2D and 3D environment"
doesnt say ANYWHERE what is require to know in php nor mysql
EDIT: actually it does but why would they put php and mysql programmer if thats not the main things they are looking for6
- Replace a 4 year old PHP API.
- PHP script writing PHP scripts to /var/www/ for every endpoint needed
- Answers everthing with 200 (not even 404)
- MySQL 5.6
- ~ 1000 Tables, NO FUCKING FK's
- "Wasn't worth the effort"
- Not allowed to behave any different
Head of development: "I'm looking for the perfect php developer with perfect MySQL knowledge."
Me: "We'll ok. Good look with finding that unicorn. I think we are done here."
The problem with some people is that they are the gatekeepers for other people's careers and that they are begging to be bullshitted: "Yes of course I am the best of all php developers! And I don't only know MySQL but am pretty awesome in YourSQL as well!" As if I want to work in a team posers.2
Apparently `= NULL` is not a thing in mysql, instead you have to use `IS NULL`... Took me a while to figure out why the fuck my query wasn't returning any results.8
Working on a database priorly designed and maintained by some private agency.
The fuck I'm dealing with!
Boolean values stored as 'TRUE'/'FALSE'. It's varchar, my dudes.
There are no FK relations. Just the values of IDs in a column.
There are no indexes, all on just the PKs, nothing else. Nothing.
Null, what's that? I'm dealing with 'N/A', my dudes.
Unique key, what's that? The table which stores users has all the fields nullable. Email is not unique ( even though that's the required behaviour).
ALL the numeric values are stored as varchar. Varchar, my dudes. Varchar. '1', '1.1'
And finally, the good ole, 1 table to rule them all. Normalisation, fuck that.
And what's the root cause of all this? My PM used to hand them Excel sheets she maintains on her local system. FTW. I don't have a enough explanations.7
YAY a JOIN query (MySQL) just ran successfully at the first try for the first time of my life!! I never understood joins but slowly getting there I guess :)4
NO DJANGO, YOU'RE WRONG! THE TABLE DOES FUCKING EXIST I CAN FUCKING SEE IT AND ACCESS IT AND FUCKING ADD AND TAKE AWAY FROM IT!5
I hate that, not only did this error happen, but they weren’t smart enough to hide the MySQL stack trace15
Spend several days decoding API legacy code from the guy who got paid shitload of money and then stumble on the piece of code that shows he isn't even aware there is a count function in SQL (or rowCount in PDO)
MySQL should have a recycle bin. I just deleted whole "user" table by mistake... Forgot to add where clause properly... Had to restore 2 days old backup copy. I just hope no accounts were created or someone changed their password in last 2 days....8
Me as Junior Dev doing mysql first time, specifically INSERT test data to test db, sucess on first try.
My Senior co-worker says: WOW, Baby's first INSERT...... that sounds so wrong out of context xD
So I'm in the middle of the website migration that was made in Wordpress.
Just made a database dump and decided to take a look at it cause it looked really big for a site that only needs internal management. Found out they use contact form plugin which stores binary of attachments directly in database..
And people ask me why I hate Wordpress and so called Wordpress devs..6
Internship Rant #2
Perks of new job:
- I can take a bath there whenever I want
- gr8 bathroom 11/10
- gr8 heater, no need to have my hands shaking all the time
- workspace is nice and everyone has an extension so my phone and laptop are always on full charge
- flexible work schedule
- easy access to company files hehehe including credentials
Anyways, so I have to deal with this for three months.16
Okay so this happened ages ago (nearly five years) but this suddenly came to my mind again.
It was in the first year of my study (currently in my 5th and last year).
I was experimenting around with php and mysql during some free hours. All the insert,delete and so on statements worked perfectly find except for one update statement. Started to debug of course and after a little while of no results I was like "oh yeah right, something like logs exists of course". Looked in the logs but nothing. No matter how I altered my code (rewrote it numerous times for some 'clean starts') it just would not run the update statement.
Alright, time for some class mate help. After multiple hours of debugging with a few classmates, there was still no result at all.
Time to bring in one or more teachers. After hours of debugging, still no result even with the help of a few good teachers.
Decided to give it a rest for that day.
Two weeks later it still was not updating anything/working and I finally gave up.
Till today, I still have no clue what went wrong and it still bugs me from time to time :/4
MySQL has the absolute worst error messages.
"You have an error in your SQL syntax; check the manual that corresponds blah blah near '(some random code line)'".
How vague can you be? It doesn't help that I always find the error in a completely different place to where the message says it is.5
My first times today:
First time a droplet on Digital Ocean.
First time Nginx.
First time trying to separate mail and website servers.
First time using UFW firewall.
First time Ubuntu webserver.
First try all alone configuration of my webserver.
First time installing all the stuff I need on my own, like MySQL, PHP and so on.
First time only SSH access from the beginning.
First time deployment from bitbucket.
Do you have any advise what I should think about. Or what software I will need. Or what I should think about.46
MySQL fell down the stairs again and dropped tables all over the datacenter
the affected servers tried to notify me in advance but spamd wasn't able to scan their messages so IT JUST DIDN'T SEND THEM
EVEN IF IT COULD, NAMED COULDN'T RESOLVE ANY MX RECORDS
BECAUSE BEFORE MYSQL CRASHED IT CONVERTED /ETC/RESOLV.CONF INTO AN INNODB TABLE
(AND THEN DROPPED IT)
When migrating from MySQL server to MariaDB and having a query start returning a completely different result set then what was expected purely because MariaDB corrected a bug with sub selects being sorted.
It took several days to identify all that was needed on that sub select was “limit 1” to get that thing to return the correct data, felt like an idiot for only having to do 7 character commit 😆4
So last night i was dealing with some mysql query issues trying to grab some complex data from a relational database and ended up giving up.
This afternoon i was about half-asleep going to nap, not even thinking about the code and randomly came up with the solution.
A few hours later i made the changes and it works as intended.
Anyone else solve code subconsciously ? 😂😂😁😁12
I was working on a very database heavy PHP app about six months ago. All database access was done directly, with hardcoded SQL strings.
I'd suggested switching over to an ORM during the upcoming major verson's rewrite, and FINALLY got approval to start integrating one.
The next week I'm told that I need to trash all the code I'd just written, since the decision to use an orm has been reversed.
The rationale? According to management, ORMs aren't "scalable enough for our application" and would "reduce developer productivity". I pointed out that we would be processing ~10 concurrent operations, maximum; I was told that the technically details didn't matter and the person I was working under had the final say because they'd worked at IBM, briefly, as an intern.
I stopped working on that project about two weeks later, thankfully.20
I messed up carelessly in production. Learnt how SQL queries bite you in the ass when it knows you are under pressure.
Was hosting an online quiz kinda thing during my college techfest. Tens of thousands of people participating.
Using MySQL as database and thousands of queries were being executed. Everyone were pretty excited as the event just opened up.
None of the teams could solve one particular level. Turns out the solution was wrong and was asked by the organisers to change the solution for that particular level. Usual stuff, right?
Was too lazy to open up the web UI for the back office and so, straight ahead logged in to the MySQL server and ran the UPDATE query on the table consisting of the solutions.
It had been a couple of hours and the organisers came to me with a weird problem. There were no changes in the scoreboard for the last two hours. Everyone were stuck wherever they were. Weird, right?
I then realized.
In that dreaded query, I had only run
UPDATE 'qa' SET answer = 'something'
leaving out the where clause, specifying the question to update, like
As a result, solutions to all the questions were updated to the same answer. After hastily fixing everything back, I had the dreaded conversation.
Org: What was the problem?
Me: It was the cache.
Org: Damn thing. Always messes up.
Me: *sheepishly* yeah
Probably the most embarrassing moment in my life, wrt coding 😑4
> Sees mysql_ bindings, XSS/SQL injection vulns
*Logs into webhost*
> Running PHP 5.4 by default
> Doesn't support PHP 7
Sadly, I'm sure this is a common scenario, particularly the webhost part4
I recently got a Sysadmin/Devops job at an Uber-like local startup.
After a few days in and with a 20% increase in daily API calls, we started getting "502 gateway error" for like half of the requests which was insane!
I double checked nginx, php-fpm, mysql, etc and in the end turns out that they log every app login session in a 680K row table in a mysql database and run a query every time to find out if the client was logged in or not!
spent 8 months building and customizing a vtiger database for work. tons of fun got it to a point where I have saved a ton of time for all the people that use the program. boss wants to have reports out of it each morning, so I showed him how to run reports and adjust entries. he didn't like the formatting of the report. so I set up the report to export to excel and took another 2 hours building a macro that formats the way he likes and prints the report for him. he used to take a month filling out paper work to get a report, now all he has to do is open a favorite on his web browser, make 3 clicks Then open an excel and type ctrl+r and it's done. he tells me it seems too complicated and is considering going back to the paper method...so frustrating.2
Been taking a course on php and I'm currently working through a cms project. It's just so satisfying learning how all the data communicates from frontend to backend.4
When UserID is an int(3) in one table, and then text(10) in another. And then the monent you see that the Username field is stored in both tables ......🖕🖕🖕🖕
Who dafuq wrote this crap?!?!?!?5
I added functions to create and delete categories on my cms project :) Its starting to come around.1
I'm debugging someone else's 10 year old legacy .asp web application (shoot me now), and I'm trying to find the most recent records in a database table.
Why is the most recent record from September of last year?
Because they're storing the datetime value as varchar (40).
Good thing they were smart enough not to waste disk space by using varchar (255)!4
$ mysql -uroot -p > file.sql instead of
$ mysqldump -uroot -p > file.sql
And not checking the result file before reinstalling my server 😭😭2
MySQL databases beginning with "test" in the name gives even people without login full access to its tables.
Somebody deleted all tables so we had to get a backup from out hoster.
*Runs MySQL benchmark on a new server*
Result: 30 read queries a second.
*Hmm.... that can't be right...."
*Creates simple node benchmark script and runs it*
Result: 400-500 read queries a second.
Awesome! New server!
With a newer version of MySQL
With new bugs on my websites
Seriously, this new version destroyed all the queries6
When someone decides to manually delete a user from a relational database that relies on that user to exist and expects everything to work out perfectly.2
Thanks Firebase! I dont have to buy a 5$ server and install php mysql etc.. anymore. It is super easy create something for one-page one-day side projects! I am so happy..3
Ok. FUCK MySQL Workbench.
Most of our products built on MySQL and we just had enough of the tools that we are using for our mysql databases...
We decided to make our own tool :)
If it goes well, we plan to open source it. Would you guys be interested in it?
We planned the following features:
1. Schema editing
2. Schema versioning
3. Update/downgrade script generation to move easily between schema versions
4. Manual/auto sync
5. Might include our own replication solution too...
What do you think?10
Please use normalization. Don't store more than is intended in one field and use special characters to separate things. It would make future developers job easy.7
I was having my after lunch coffee +reading devRant. I saw a rant about MySQL ("MySQL server has gone away" error).
It's spreading and no one can stop it!3
Oh hell yeah. I just spent a good few hours optimizing an ok mySQL query and made it so much better and faster. Inner join ftw!!3
Having to deal with legacy code is fucking terrible. Worse yet when there is basically ZERO documentation and what little documentation there is, is wrong! Not just wrong, contradictory.
I have spent far too long trying to decipher what I need to make everything fucking work. Having to figure out if they used Gunicorn or UWSGI. Whether they used MySQL 5.6 or 5.7. Whether they wanted me bent over or crying on my knees.6
me and my boss plan to make a new feature to our system.
i model the database tables
he says that there are too many tables
i say its atomic and acid
he says to put all the columns in a single table14
Twenty five goddamn minutes finding an incorrect quote mark in a bloody massive query of mySQL, I need a beer.1
I made sure to commit all changes (from my desktop) before leaving my home for the weekend so I can continue my project at the parents house (going for a monthly visit)..
I arrived, synced all my changes to my laptop, all good and well, going perfect. Updated the bower components etc. Time to start some test runs so I started my localhost, opened my browser,..Ended up with a MySQL errors galore.. Unknown table this and that.. I forgot the export my MySQL database :'( #fml1
Me: "can you please send my credentials for the database?"
Hosting provider: "Yea sure... We will set it up on our servers in no time"
*5 mins later: provider sends mail to me*
Me: *looks at mail*
Also me: *NOTHING TO DO HERE*
Congrats to jweiland.net for not being able to support their customers.2
I also wasn't a good database architect at that time and my database had an image table wich was for the gallery. Within this table there were multiple columns for one image slider (there should be multiple sliders on one page in the gallery (I know... 🤢)).
In my defense I can say: It worked. 😅
It hurts to remember this. And I hope you won't judge me.2
Why does MySql least and greatest functions return null if any of the arguments are null? Who was the genius behind the idea that it's the best way to implement it, and to change this behavior in a minor version?
Why does MySql return bigint when i convert a value to integer?
Why does MySql exist?17
I feel ridiculous. While learning SQL databases I ran a query that was supposed to fill up the database with test data for me to play with. The actual result?
8 GB and 330,000+ rows.
Keep in mind this database is on a remote server, so trying to delete it times out after thirty minutes. I’m submitting a ticket right now.6
- Knock Knock
- Knock Knock
- Who's there?
- Your mysql query callback
- Your mysql query callback4
Never have I been so satisfied as I am right now after having implemented a login and user account system with the ability to update user preferences with databases n' shit in PHP after only knowing PHP for a day.
Speaking of all that, do you guys know of any good place to make sure all my stuff is secure? No SQL injections n' the like.4
when reviewing each other's code and sql queries is the most romantic way you can think of to spend the evening2
Had a teacher in high school who ordered us to learn MS Access, even tho most of us already knew MySQL... It was to learn about relations and the likes...
We spend way to long on that subject, because most of really didn't find the Access interface intuitive and she had to walk from table to table helping...
The only two finished the task where those who say screw it and used MySQL 😅
The moment when your forced to use mySQL after years of blissful coexistence with a noSQL workflow.1
Boss: hey can you loop through all the entries in the data base (PHP) to make a menu of everything?
Me: me sure thing, shouldn't be a problem
10 min in playing with the database...and I remove the table...FUCK ME?!!??!!!
good thing we backed up the night before 😂😂1
Tomorrow is my bd and I swear besides seeing my friends all I want is to find this bug.
I remember it was Friday, 30 minutes before leaving the office when suddenly someone from the upper management directly asked for my help to mass update something as it is important. By that time our CMS is not capable of doing this so I had to do it straight in the live database.
It was an update query and I decided to type the query in notepad first. when i pasted it in the terminal i didn't noticed i missed the "where" part so i mass updated the status of all our records dating 3 years back.
fuck.. please take note it was on a Friday night.4
When mysql_query gets called inside of a loop that is inside of a loop.. While the could've used a one liner mysql command...
Best of all they don't think that this doesn't effect performance...1
IT'S CAPS RANT TIME!
MYSQL ERRORS ARE SO USELESS! AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHH
I JUST WANT TO ADD A FOREIGN KEY BUT 'Cannot add foreign key constraint' KEEPS COMING UP, AND THE STACK OVERFLOW ANSWERS INDICATE THAT IT COULD BE -LITERALLY- ANYTHING!
THIS IS OF COURSE, AFTER PHPMYADMIN GIVES ITS OWN ERRORS FOR TRYING TO USE THE DESIGNER TO ADD THE RELATION. IT ONLY WANTS UNIQUE FOREIGN KEYS, DESPITE ONE OF THE MAIN USES OF FOREIGN KEYS BEING MANY-TO-MANY AND ONE-TO-MANY RELATIONS!3
For the past few months I've developed an oridinary digital shopping list. Just a simple web app written in php, HTML5, CSS3, JS and MySQL. From knowing nothing to having this feels great. Think what you want about it, but I'm quite proud of myself. First programming project, ever.
If you want to try it head over to https://app.esyshop.se.
Passwords are hased and salted with bcrypt.4
I don't understand why someone who's totally sane and careful could forget to turn off MySQL general log over Christmas vacation. Of course Disk out of space caused us down time :/1
So I was waiting on a mysqldump for over a halfhour wondering why it was taking way to fcking long.
But then I saw I typed mysql -u user -p database > dump.sql
Instead of using the mysqldump command xD at moments like this you realize how important sleep is xD
Problem saving emojis to your database? MySQL’s utf8 only allows you to store 5.88% of all possible Unicode code points. https://mathiasbynens.be/notes/...2
So i ordered myself a web server and am trying to get access to phpmyadmin.
I got generated username and password for the phpmyadmin login.
So i created mysql databases and database users, outside the interface, but that's fucking it, i need to create tables as well, can't do that without the interface, cuz NO ACCESS!
Fucking piece of shit service provider, they had one thing to do and they can't even fucking do it right. How dare they call themselves web hosts at all...
It's probably a badly configured config file but i can't access the file myself to start sorting this shit out, so i got to wait at least 12 hours till work hours to be able to contact with them and sort this shit out.1
My simple MySQL Connector for every languages (Dekstop/mobile). I've tried this in C#, VB.NET, and Java. Trust me, it works. How 'bout ya?9
If you don't know how to do it the proper way, just throw something together. :D
Might not be pretty, but it works... (only took about 3 hours)13
A programme I have to maintain (and not allowed to optimise or change):
1) read input from serial connection
2) store data in MySQL database
3) every day convert to CSV
4) store on Windows file share
5) process CSV in access 2000
6) store in MsSQL database
When it was first developed, I said to te developer to store it straight from serial to MsSQL but out boss wanted it to follow the above spec.
He has now left and I have to maintain it1
FUCK! I've done this a fucking God fucking damn million fucking God fucking damn times fucking before! FUCK! FUUUUCK! FUUUUUUUUUCK!
The best part is that someone is going be paying me once it works............................... FUUUUU K!2
So, today timestamps within my database saved me. I have one titled "created_at" to indicate when the item was originally created.
Today a large client called up to complain that they have 296 bookings but only 288 menu choices (each booking has a menu choice). Basically, saying I'd "programmed it wrong [sic]" :(
After taking a quick look at the date the client originally added the menu and the date the missing bookings were created, I made a discovery.
It turned out the client was at fault. They had set an event (customers book events and bookings have a menu choice) live without associating the menu. This meant the event had been live without a menu for customers to book.
I simply compared the timestamps of the missing bookings to the date the menu was originally added. The customer most likely made the event live for period (I estimate ~45 mins), realised they hadn't associated a menu and then added it afterwards. Of course at this point it was too late as people had already booked.
No need for a huge email either. I condensed the above into a 5 sentence email.
Timestamps are soooo useful1
I just created an Oracle account just to comment on a mysql bug report in order to inform people to use mariadb as a fix ¯\_(ツ)_/¯
^w should delete back a word, not to the beginning of the line! This is broken because instead of readline, Oracle's mysql-client uses editline.
Yet why the fuck do you compile mysql-client with editLine wrapper that breaks the common keybindings?
Licenses is why. Oracle wants to avoid using GNU GPL, and readline uses just that, so they use editline since it has BSD. And they just don't seem to give a damn if it breaks usability.1
Hello devs, I need help from database devs.
The company where I'm interning is a non IT company, so they planned to migrate to a SQL Database from their older MS Access Database.
Since I'm the only IT intern, I'm up against the major devs and hot shots from where my company outsources IT solutions.
They suggested SQL Express.
I have a meeting tomorrow with them, please help me so that I can get better results for my company.
Basically I have to question them about how their decision works better for our firm and why didn't we go for MySQL Enterprise Edition or anything which is much better and cheaper and such critical questions.
Please help me.
The Database would be used to store information about the products manufactured and their parts' history so that in future if there's a problem with the product, it can be looked up in the database so that there can be further replacement or repair processes.10
A non-profit wants me to build a database for them and I coded everything as a CMS in PHP. But now their IT guy wants it as a Wordpress site and he wants me to send files to the website but I can't update the website or plugins personally myself. How do I go about this?10
Export data from a database that you've not modeled is a problem (sometimes), I just realized that this DB has two tables to storage cities, the main difference is the id, the other fields are the same in both tables, I hate that kind of people....
Rant at myself for being a moron.
Manually tried moving some InnoDB stuff around on a local server and corrupted a load of databases, with no backups since June 28th. Spent all day yesterday trying to recover with no luck 😑
Lesson learned: need to backup databases more regularly. Any good tools?3
I am programming a site where developers can share shell scripts and other users can execute it via a CLI.
I decided to add a little joke into it: the page where users can view a shell script is https://mukodik.com/scriptid.sh
I use Express, so I just use app.get('/:id.sh') to get the scriptid.
How would someone possibly bug out this page? (the uploaded shell script is not actually stored in a file, it's stored in a mysql database(using connection.escape to escape chars))2
Do you know how MySQL got it's name? Well, it's a really interesting thing one should know. Atleast, I find it really amusing.
~Michael "Monty" Widenius is one of the founder of MySQL and one of his daughter's name is My(after whom MySQL was named).~8
My original project has morphed and twisted to become this monster where I’ll need to learn PHP, databases, and somehow get a desktop C# app to read the remote database and execute tasks based upon times in the database. God help me.4
Has anyone here used MongoDB for relational databases? I am trying to use MySQL with Node but I feel like the whole thing is a mess. There are some ORMs like Knex or Sequelize for MySQL but they are pretty crap. I am thinking if I should just move onto MongoDB instead of MySQL, at the same time I feel a little dirty to store relational data in a document store :(18
Working at a local seo sweat-shop as "whatever the lead dev does't feel like doing" guy.
Inherit their linux "server".
- Over 500 security updates
- Everything in /var/www is chmod to 777
- Everything in /var/www is owned by a random user that isn't apache
- Every single database is owned by root sql user
- Password for sudo user and mysql root user same as wifi password given to everyone at company.
- Custom spaghetti code dashboard with over 400 files in one directory, db/ api logins spread throughout these files, passwords in plain text.
- Dashboard doesn't have passwords, just usernames to login
- Dashboard database has all customer information including credit card stored in plain text
- Company wifi is shared by other businesses in the area
I suggest that I should try to fix some of these things.
Lead Developer / Tech Director : We're an SEO company, not a security company . . .10
I've alway pronounced it sequel but everyone I know swears it's SQL, so I say that now to fit in.
I feel like a spy, lying to my closest friends everyday...2
I nearly missed the WHERE clause today. Only realized my mistake after I was about to close the SO tab and glanced at an answer below the one I read 😨1
I gotta let this out. I apologize..
Why the FUUUCK does MySQL not let me log into my FUCNING ROOT USER AND THE OTHER USER I MADE...
I thought i fixed it a few days ago, but apparently not. Now im considering trashing this shitproject for a while.
*insert awesome words that illustrate extreme rage and a broken keyboard*9
When every related field has a god damn different way of working with the data on hand..
`tht_date` ("Y-m-d", Date) - expiration date on the product, hence, there can be multiple of the same products with a different THT
`tht_alert` ("-2 months", varchar, DateTime modify mutation string) - sending an alert when this interval is hit, and being the activator of the tht_date field (unless value is "none")
`tht_minimum` ("28", integer, quantity of days before tht_date) - to lock them from being sent out/collected.
How would you expect this ×not× to become a friggin' spaghetti when trying to resolve the best row ID?
These values are in the wrong spot in the first place, then they also act entirely different in relation to eachother..
I hate the person that set this up, for doing this. When is the madness going to stop...
Our dev uses laravel and instead of doing a sum to get a total of a couple columns he is getting all values and manually counting them up in the php.
he keeps telling he cant improve and i cant work on his code because i know i will break the rest.
when i looked at the code i had the following feeling.2
"Configuring incomplete, errors occurred!" Ok, I get that. But would it kill you to tell me what errors? If you behave like an asshole, I'll hate you as well!
That wonderful moment when you explain a bunch of different technologies to a customer (thinking they'll work with you to choose one from the lot), and they go off, only to come back having cooked up some scheme in which they want you to have them all working together seamlessly.2
So... We're going to totally rewrite one of our web applications at work. It's currently written using the .NET framework, and we're moving to Node.js instead. For me, that's absolutely wonderful! Outside work I practically only work with Node, so I'm happy. There is just one thing that's bothering me. My colleague wants to use MySQL for the database. Even worse is that he's the one deciding, since I started working there just a couple of weeks ago.
Now, I really, really want to use Mongodb. It integrates so wonderfully with Node together with Mongoose, and just the thought of using JSON everywhere makes my body shiver of satisfaction.
So therefore I have two questions.
A. Would you prefer Mongodb over MySQL for a node application?
B. How the hell can I convince him to use Mongodb?!
Convinced someone to start using ubuntu. Now we spent 25 mins getting mySQL and workbench to work. He was getting pretty frustrated, but then we got it working and he was so happy about it.
Now he knows.
No turning back.1
I need to performance monitor our web app. I have been working on some speed improvments since some of our customers have complained. My boss wants me to be able to produce stats which he can use (and abuse) to highlight to customers that we have got quicker. I am currently looking at blackfire for PHP profiling to help with speeding things up but I need a top site overview for everything. Our stack is PHP (no framework), JS (jquery + vanilla), MySQL on Windows mainly. On premise solutions would be good since we don't traditionally run in the Cloud. Our system isn't SaaS and is installed on dedicated data centre servers or on premise3
Why is it that in my IT class, peoplle think it is a great idea to say they know how to use mySQL to create databases and then end up destroying the CentOS VPS they had installed for them... like if you really are that retarded, use Microsoft Access, or better yet, LEARN FUCKING MYSQL BEFORE USING IT3
spend better part of my day processing about 400M rows of data with MySql, woo ain't no single line of code that can do that in 12hrs 😊
I just tried to updated mySQL on my development server, the mysql.user table is corrupted, all passwords got expired and i cant set new passwords because as i said, the user table is corrupted.4
When it comes to choosing a database, What is the best for a Java project?
1.SQL - MySQL
1) Writing data to database works just fine
2) Query reading back that same data returns null
3) Spend 3 hours to try figure out why that 4 year old select statement suddenly doesn't work anymore
4) Figure out mysql master stopped replicating to read slaves
5) Facepalm and cry a little
I want to cry... Fuck it.. shiit. .. :( :( ;(
Wasted half of the Weekend to Setup MySQL on my vServer which uses ssl encryption, have specific User and so on.
Thought: well, the User mysql is not so good as a Name. Drop it, you don't need it.
What did I? Instead of Drop User mysql , I typed Drop Database mysql.
Fuck that fucking Shit. I'm so sad right now. Broked the complete MySQL Database. Nothing is working anymore. And the server is new, I've Just made One Backup. Deleted this a few hours ago.. also accidently.
Help me :( Shit :( so sad :( Now, I don't have Motivation anymore to work with the vServer :(3
Gotta revise MySQL and Java for my IT Matura exam on Wednesday...
Reading/writing from/to files in a Java 8 manner,
LOAD DATA (LOCAL) INFILE "blah.csv" LINES TERMINATED BY "\r\n" DELIMITED BY ";' etc.,
clean Eclipse install...
No Internet, I'll have javadoc and mycli though.26
I remember back then when we were building an E-commerce website. To maintain good performance the boss insisted using flat table. This was also applied to other projects like GPS. That was already 2013 when NoSQL databases like MongoDB was around already. His concern is he didn't like to risk on new technologies and it would cost money for training instead of using the existing "MySQL" and Microsoft SQL Server.
Everything I learned from that guy was just poop.
Me and some friends are working on creating a food recipe app and webapp. Currently in Norwegian, but would it be worth the trouble of translating all content and the app itself?
Backend written in PHP/MySQL with Laravel and app written with Ionic Framework v1.4
So php7 deprecated all support for mysql none of my previous projects are working on localhost.Moreover,Ubuntu removed the php5 package from it's latest version . FML.17
on a pleasant note,
Seriously, fuck myPhpAdmin. Fuck c9 and fuck MySql. My connection is solid i can do mini crap. my ajax call is good too. so idk why.
Ive spent over a week on a bug and now “occasionally working” is the best I can get and im not even sure why.
This assignment is due today.
I cant even try to do it locally cause for some reason myphpadmin and mysql dont wanna work on my laptop so yay fuck me.5
FUCK YOU EMOJIS! FUCK YOU AND YOUR EVER FUCKING GOD DAMN SPECIAL WAY OF BEING HANDLED.
Now that I have that part out...
I really fucking hate emoji at this time. Currently I'm working on one of my projects that has markdown support. One of the things I'm extendending the parser with is github style emoji (eg. :smile:) now this part works great. The problem however is getting that short code into a unicode char for HTML. And at the same time I have to take any unicode emoji inserted into the text box by phones and stuff and convert them into the shortcode (My database does support emoji but it's much nicer to store all emoji with the same standard)
All of this has taken 5 hours of research (needed a database of unicode -> short names) and several hours of converting the data from someone elses json into something I can use. (AKA Shrinking the damn file to only what I need) and now I've spent 5 more hours working on the actual code. And I still don't have it working properly.3
The client has been working with MySQL his whole life, wants me to make a front end for a site but insists on making what he calls the backend in my terms the database himself. So he wants the ability to drop and add rows, tables from the database itself somehow implemented, any ideas?6
Okay so I have a stressball, but the kind of fucked up stress I was in the last two days required more than just my stressball.. I Okay so I have a stressball, but the kind of fucked up stress I was in the last two days required more than just my stressball.. I really need a punching bag..
I'm not only feeling stressed, but I also have A LOT of anger inside me.2
My fascination for programming began around 13, when i started developing plugins for my minecraft server in java.
Had an awesome time with creating plugins for some fully custom servers with relatively large playerbases(50-200 players, depended on the time of the day).
This sparked something in me, and i started creating crapp ass "portfolio" sites for myself with php and mysql login and registration forms. After that I got into some basic c# abd had fun with some cute console/form applications.
And here comes today, in the process of picking up more css, php, html, js knowledge, probably heading towards react or vue.
I just love programming to death.
Why the actual fuck is MariaDB disguised as MySQL in the AUR?!? Is there just no way to install MySQL from the AUR anymore?7
Had trouble to connect to our MySQL database, so I decided to open a ticket to the Database admins. At least they are pros and I'm sure they'll help me:
"Hey guys, I have trouble connecting to [Hostname]. I guess it's a firewalling issue would you take a look? Attached are screenshots, saying hostname not found.
Hey Dominique, are you sure the password you used is correct? Is it yours or the sysuser pw what you sent to the server? How did you send it?
Me: (kind of confused) Hey dear admin, did you look at my error message? It says Hostname not found. What do you think how I provided any credentials?
Support: yes, I saw your screenshot and don't see any password entry. That's why I asked!
Me: Well, than... ok... go and search for another job. Yeah and consider fucking yourself. Kisses.
- Installed openSUSE Tumbleweed
- Installed mariadb
- Tried to start the service (several times) with failure
- Searched online, made adjustments as per the suggestions. No luck
- Reinstalled related packages
- Tried again and failed
- Deleted everything in /var/lib/mysql
- Tried again ... and 👍
Stupidly tested some sql on development to return results for an admin (see the whole results) and stupidly didn't test the where clause for generic users (only see a subset of data)
To find out on production the where clause was being run because it wasn't a where, it was an 'and' and 'where' was not being used before so made the whole users get the entire results.
My own fault for not testing all use cases. Horrible though.2
TFW your boss can't provide you with dB access so you. Create a user agent style sheet so you can copy by hand 72000. WordPress subscribers 999 at a time into a .txt file to upload to email campaign manager
I just accidentally installed mariadb and completely fucked mysql. Probably by now I've deleted my databases, but luckily nothing very important.
Time to get round to setting some proper backup system I suppose.3
Probably my most favorite how-to-not-do-it story:
Given a database table in which an integer field served as a bit field, a fellow programmer needed to find out all rows where a given bit was set. His solution was to use MySQL's CONV() function to convert the integer from base 10 to base 2 within the SELECT and then use PHP's substr function to extract the bit (i.e. substr($field, -2, 1) for the 2nd bit) and check wether it's '0' or '1' within a foreach loop to create a new array with all "matching" rows.
At least kudos for being creative! I am only glad he never had to write an update function for that particular field.
"Getting stuck debugging mysql for 30 minutes to finally realized you are missing a : is my favorite thing"
-said no one ever.
Today's progress. Updated the cms to update category titles :D So when you click the edit link, it displays the current category title in the input field. Then you just change the value and submit it to update the database info for that specific category. Fun stuff!
This one was thanks to the beloved MariaDB.
I needed to update a record with id = 12345
I copied the id to the clipboard.
Then proceded to type:
UPDATE table SET field = NULL WHERE Ctrl+v
So it ended up
UPDATE table SET field = NULL WHERE 12345
I forgot to type "id = " after the "WHERE".
MariaDB says "OK, after the WHERE any number means TRUE".
Simple update taking longer than 0.000001 seconds means bad news. And if you add that I was making the stupid update using phpMyAdmin, I couldn't cancel it faster. I had to log into terminal and kill it from there. Some hundred of thousands of records updated to null, thank you.
It was a testing database, and we had a backup so I had to take my good 30 minutes to restore it but it was not cool.5
Yes, I know I'm shameless, but here we go:
Are there any norwegian devs out there that are looking for a new colleague (webdev)? :D
I'm going to be out of work in a few months time, and have started applying for jobs in the Oslo area, but most jobs I see listed require 3+ years of experience. I've worked with web for about 9 months and I'm keen to get more experience. Interested in a full time job or being a trainee.
If yoy know anything, please let me know :)5
I cannot think about a title, so just story:
in my position as multi headed chimera one of my ongoing task is it to dedust old excel sheets, processes and other super inefficient relics that steal time. Mostly i solve those with some tiny vba scripts, bigger vba scripts or a tiny java applications. usually that takes a few hours or maybe two days, depending on what i think is necessary.
the current task at hand is for our (physical) production, work time is noted on a sheet of paper and later given to the production head. Who then proceeds to type it all in excel to do his thing. The guy is starved of time by a huuge margin.
The other day our CEO-like guy was ranting that nothing in this company gets ever done and that people wasting their time with useless projects and named my project among them.
I dont get humans. First he gives thumbs up for this, knowing that it will probably take me 100 hours or so to create in a working manner but later he calls it "a waste of time?" I presented the use (reducing expensive mantime, paper waste and room for fudgery) and yet he calls it useless? (well, his point was that there are other problems (which are out of my reach anyway))
they guy normally is pretty nice and has an ear for problems, but when it comes to higher computer stuff (>excel) he really struggles.
i really like my side project, gives me room to flex some muscles and test stuff. Also playing with raspberry pis on worktime.
On a sidenote, anyone ever tried raspi mesh networks and knows where i get working >10 inch capacitive touch screens?
That feeling when you are asked to export data with columns that have never existed in the database...😞
<sanityCheck> //asking for a friend
Some clever b*****ds wrecked a section of our production mysql db. To fix it I need to rollback the affected records 2 weeks - around 50/300 tables are affected, the other data must remain intact.
Currently my plan is to take a 2 week old dump and cherry pick the data I need from it, then combine it with a dump of the db in it's current state, drop the db and recreate it.
I know this approach will work - but it's risky, a pain in the ass and dealing with 300mb text files is tedious so since I only need to start in around 8 hours I figured It wouldn't hurt to post my approach and see if anyone thinks my plan is borderline retarded.
If you have any advice .etc that will make my life easier I would greatly appreciate it.
So in your opinion...
- is there a better/safer way?
- do you know of any db dump merge tools?
- have a recommended (linux) text editor for large text files?
- have you made any personal mistakes/fuck ups in the past you think I should avoid?
- am I just being a moron and overthinking this?
- if I am being a moron - In your humble opinion has the time come for me to give up all hope and pursue my dream of becoming a professional couch surfer?
Note: Alternatively, if your just pissed that my rant is asking for a solution instead of simply trashing the people that created my situation and your secretly wishing it was on SO where it belongs so you can moderate/edit/downvote/mark the shit out it, feel welcome to troll me in the comments (getting dev advice just doesn't feel reliable without a troll - you matter to me). Afterwards If your panties are still in a bunch I'll post it on SO and dm a link to you to personally moderate - my days already fucked and I wouldn't want to ruin yours too.4
So I've been trying to use bootstrap alerts after deleting a category item in my cms project.
The problem is that I send params via get request and after sending a query to mysql it's best to refresh the page using header to both update the new changes but also prevent the params from staying in the url.
Unfortunately, after refreshing, my alerts don't run because the context of deleting a category is over at that point. I'm sure I'll find a solution eventually, but it's causing headaches and it's a good time waster xD1
I'm seeing someone trying to access one of my machines looking for phpMyAdmin. I don't use php, nor mysql.
Keep trying random h4x0r!1
Hello, can someone help me with this one ? I guess that the fucking SO elitist community would have beaten me to death if I asked this question.
I'm trying to create a relational table between a Tutorial object and a User object (to know which tutorial the user has access to) using Sequelize, and I figure out that I have two PRIMARY keys in my table. How is it possible ? UserID is also marked as Index.
The both keys are not Unique in themselves but their combinations are unique.4
I'm currently testing live and that includes trying sql injection, i have no backups. So if i forgot to escape string somewhere, I'm fucked. I like to live dangerous :D
Alos, i always test sql injection with "--; DROP ALL TABLES;" Casue... It's a bad idea..?2
Which database program do you use? MySQL, MongoDB etc.
I'm using MySQL at the moment, but a lot of jobs requires MongoDB. Does anyone know why?
Though I can't get it to work on my dedicated server, giving up for now...13
The company I work in had to build a software that establishes a connection to a MySQL database running on an external server. It doesn't work for the client company because the firewall is very restrictive and only lets through connections on port 80, so we had to build a fucking http server that forwards SQL queries to the MySQL server and returns the result. This is so horrible!
(Running MySQL on port 80 isn't an option as any other connection type than http is blocked by the firewall)8
Developed a microsite for a temporary campaign. Involves generating 1.5million promo codes on excel. Done... good luck importing it to mysql. Campaign launch is tonight while importing cant be successful unless importing 10K at a time -_-4
Hands on experience is the best. Lemme tell ya.
So recently a friend has been bugging (in a good way) me about getting to one of my projects. So, about a week and a half ago I finally got along to starting. I tried using existing FOS projects to mold together as my own, but that didn’t work. So I made it from scratch. At first it was frustrating because I didn’t know PHP, but now I think I got the gist of it.
Almost a week and a half now and quite the progress has been made, at least to what I had expected... now I’m addicted to coding. I hate food. And people. I love my code, no matter how terrible it is.1
Just gotta say, YouTube videos that show connecting a form to MySQL make it so much more complicated than it is...
Ok, this question is related to mysql and php.,
Let me state the current situation
I have a db, say "gd".
That db has several tables all with same columns.(i.e same fields for different manufacturers such as product name, cost , stock etc.)
Now i want to know how many tables have the product 'a' in them and what's the cost of 'a' in each of those table.(tables are generated dynamically so I'll never now how many tables are there, well ofcourse i can refer information schema, but just wanted to highlight this fact). So is there a way to achieve this?.. excluding "dump the whole data and then search it" solution.
Plz help, .. sorry for my bad English, .9
Why the fuck is it so difficult to change "utf8" to "utf8mb4" in MySQL?
And who the fuck even had the genius idea to make "utf8" (which isn't even true UTF-8) the default???3
Surely I can't be the only one curious enough to start this discussion; so what's everyone's backgrounds?
I'm sure we're all under the assumption that we're all developers of some sort and like to rant about what we do-- hence the app name-- but what does everyone do? Such as what you make, what you've made, your skill set and a little info about yourself
Myself, I'm a 21 year old male from the North West of England. My name isn't actually Markshall, it's Mark, but I'm a huge fan of Eminem so it's a play on my name on his (Marshall).
I'm not yet employed by a web development company, I work in retail whilst I freelance my web development skills
I have an online portfolio at http://mark-eriksson.com (needs a little updating-- not all my projects are on there and you're unable to view any information about them)
I write code in Brackets (http://brackets.io) on my 21.5" iMac. I use Google Chrome and have iPhone 6s Plus 64GB. PS4 player. Vodka and Jack Daniels enthusiast.
So, what about you?
Side note: devRant needs an edit feature :-(13
I'm going to ask a silly question... When I was introduced to databases, I was shown using Access. The interface Access used seemed to me to be fairly intuitive.
When I was introduced to MySQL, I guessed there would be some tool or other that would allow a similar design and manipulation of a database using a GUI.
MySQL Workbench didn't seem to be great for the task.
What is the 'proper' method used by actual DB devs?2
I don't understand this:
xtrabackup --backup --datadir=/Path/To/Database/ --target-dir=/Path/To/DBBackup/ --host=172.25.0.51 --port=3306 --user=backup --password=...
When I execute it out put says:
Access denied for user 'backup'@'172.25.0.1'
Why is it using user@GATEWAY instead of user@HOST?7
self refrencing tables awesome concept but it pisses me off that mysql doesnt support "select with" query i had to think about writing recusive functions that builds a tree of n level i must say im kinda proud :p2
I've been practicing really hard on C# the last few days and it really doesn't feel like I'm making any real progress. Everything I'm doing is in console and when people in my class see it I get treated like a idiot because most of my classmates took the C# or C++ courses while I focused on web...3
When the server is unable to process my queries just because of memory allocations capacity. Should i adjust with my codes, or the server itself? This happens to me all the time2
Well that was fun. I'm deleting duplicate files from a mysql table and S3. Accidentally removed the one I wanted to keep from S3 and don't have a reference to the old one because I give my S3 files super unique names to prevent duplication and naming hacks. Ugh.
Stayed up all night to "just add another MySQL instance as replication". Guess what's not working: the instance that worked till yesterday and the new one. Somehow, MySQL ignores statements from the config, looses the server-is every now and then and forgot that I stopped it, so I need to reboot the whole server.
I guess we're the only one how say "just this thing and I'm off for today" and ending up doing this "just thing" for 20 hours.
How the hell does anybody follow the amount of brackets, quotes, single quotes and ` these things in MYSQL, I'm getting a hernia thinking about it.4
Another question for Database-Gurus:
Is a MySQL table with 4 columns and about 42000+ rows considered 'big' or should the table be split in smaller pieces?5
When your customer face a lot of 503 on the main website since weeks and you are confirming that the code changes doesn't affect anything for that.
Later in a 2 hour calls you see that the machine with the MySQL server (that wasn't monitored) had issues with table never optimized/repaired because the cron that do that was remove because useless (for them).
So...buffered query kept crashing even though I have a row limit of 10001 on my abstract datatables class. I didn't realize it was buffered because I grab the results in a for loop as a fetch. Well, I tracked it down to being the size of the email content that I'm selecting (and then using strip_tags and substring in PHP before returning to the front-end). So it's totally a catch-22 at this point because if I select let's say...substring 500 characters and most of that is line breaks and other html junk, I may only get a couple characters of normal text (or none at all) after stripping tags and doing a final substring to get the 50 characters of text I want to display. I said screw it and took the email content out of the table all together. You have to view it to see the content now. I should probably be storing a text-only version of the email, but argh..that's a lot of extra data.
Damned XAMPP doesn't want to run MySQL. Can't access phpmyadmin on local machine. Fixed localhost problems now it shows me 404! Edited all ports in config files for Apache, killed some tasks working on that port, stopped running some services - still nothing. Now found out there are some db files missing for MySQL via error log so I need to fix that plus 404 on my localhost. Don't feel like I'm close to solve all that. Half of a day wasted with no results. I need a cold shower and a gallon of coffee.1
i don't like devs who put serialized data into a relational database. guys, do you even know how to relational database? 😭😭😭6
MySQL by far. It was my first DB experience and I have since used it in countless LAMP web apps. Even with modern document databases MySQL is the first solution that comes to mind
So, I rarely ask questions, I usually find the answer myself, but, I'm just tired today and maybe my fellow dev ranters can help here.
Is there a way to write a bash script that automatically runs a pre-defined mysql query on local DB and throws that up into production DB?
it's just a simple select and then insert.
Been looking at select into out file, from infile etc
I could do it manually, but I'm going to have to do this more than a few times over the next few weeks and would love to just alias it and be done with it
doesn't seem possible without actually logging into mysql cli each time...on both sides, which sucks
this isn't export/import a table, it's export/import the result of a query
The feeling when someone decided that it was a good idea to give all databases the same name across environments. So you have to:
drop database prod
On your MySQL prompt to restore the test environment from the latest mysqldump.
Never thought naming could be so hard...2
Time for an unpopular opinion, I've been working with MySQL spot this week and I've actually quite liked it. The documentation is well layed out, innodb seems pretty peformant after some initial soak tests. Yeh I like this.
A RxJS wrapper for MySQL queries.
If anyone has any suggestions/reviews for it.1
Just tried too create procedures and functions in mysql, can easily say it is not the prittiest project I've made but i feel it is safer to call procedures rather than write entire queries in python source code.
Question for database gurus:
I need to save the openig hours of my clients in a database. Each day should have different opening hours and also the possibility for 2 breaks during the opening hours. There should also be an option for different local holidays for each client.
How to I acomplish this in a clean/performant/scalable way? Thank you for your answers!10
Just migrated my custom help desk software for work to cockroachdb! Scalability here I come fucking come! And no more fucking MySQL Master Master configs to deal with.
I was maintaining Laravel 5.1 code and at that time recently updated to 5.3. Updated all server softwares n everything which took a lot of my time.
After a month, I had to add a field to table and found unusual error. In laravel 5.1 migrations, created_at and updated_at default values were set as 0000-00-00 00:00:00 and mysql update didnt allow it.
Now everything else works fine except I can't make changes to tables. Should I leave it as it is?
Instead of using MySQL, I zipped a bunch of json files... It's fast, but definitely not reliable, I was young and stupid, I should finally getting started with mySQL, srsly.2
Just spend two fucking days debugging a few methods in our program. I used unit tests to call those methods (don't want to navigate through the complete program workflow)...
Yeah, guess what: the test cleanup includes a fucking rollback transaction function. So NONE NADA ZERO FUCKING CHANGES WILL BE PERSISTED. Fuck me3
Was feeling over-confident one day, wrote a delete query and pushed to production without double checking it.
Turns out the where clause always returned true and deleted all rows in the production table.
Mind you, from that day onwards I'm using update queries instead of delete..
I felt pretty smart about replacing that huge php database import script with a bash script loading the XML dump via MySQL's LOAD XML INFILE feature directly.
Why then does the php script only take 35 minutes for all the tables to import, whereas my script takes almost 2 fucking hours for that one table? We are talking an import of the ridiculous size of 70 MB. I don't get it. It's supposed to be fast.2
Fuck encoding and fuck PHP!!!
I'm programming a little vocab trainer to get used to php and MySQL. From an old VB vocab trainer I had ca. 2000 txt-files with words and converted them to sql-queries with a simple python script. When SELECTING words with special characters they become encoded properly. But if I UPDATE words their encoding is just fucked up... The table is utf-8 encoded all the columns are utf-8 encoded. The php mysqli connection is utf-8 encoded. My HTML header is utf-8... WTF?
MySQL Workbench 32-bit requires Visual C++ 2013, but all I can find is VS 2015 and later. So you need to have a 64 bit computer now to develop on mySQL databases? Well that SUCKS! A lot of devs work on commodity hardware, i.e. somewhat dated, 32-bit computers. Most devs that I know, including myself, are not interested in the latest, flashiest, most expensive hardware.19
So im working on a blog website and im trying to make a php sign up page the only problem is I don't know php or MySQL does anyone know a good place to learn php or MySQL besides w3schools?9
Anyone familiar with Wordpress site migration?
I'm trying to move a client site from my dev server to theirs, seem to do so fine, but all urls still point to my dev domain.
A search and replace plugin was recommended but it doesn't seem to be updating the database references correctly...or at all.
Not sure if anyone would mind lending some insight so I don't have to essentially redo the whole website over :p8
Me, trying to access an old mysql database on a Linux server, the root user gets rejected. Out of frustration I delete mysql entirely and try to start again.
I was not using sudo to access the root user...
In the bright side, the deleted mysql version was actually an old one, the database is actually fine.1
Need to build an auction website with PHP or any other language. Anyone available to help me? Would really appreciate it.9
Not a rant but a helping request.
A friend of mine just asked me if I can make an ERP System for his father, he wants to take control of the inventory, and the merchandise decrease.
Any advice of which database would be better for this job since I don't think he is going to pay for a license or something like that.
I was thinking using MySQL and C# or maybe Java.
Any comment is well appreciated ☺️7
Clean install of Ubuntu 18.04 on my work desktop, rbenv won't install a ruby version saying i need to install libssl-dev (that i've installed, ofc) and the mysql install did not prompt me for the root password, so i can't login on it.
Any good tutorials to build a simple users system with node.js and MySQL db? I just started node.js and I can't find anything good....6
what is better, and what do you prefer, storing time like "1471275311" or "2016-08-11 18:50:42"14
I want to merge select and delete/drop query together and make it as one in MySQL. For ex:
Select * from t where year = 2015 and drop table tab;
Select * from t where year = 2015 and delete from tab;
and ya you can't use ';' for merging4
Deploy new script on production and then server time are outdated suddenly, plus old timestamp data inside db changed to outdated time. Who update the data inside db? Mindblow~2
It is sometimes shocking to see 10+ developers working on a fairly big project (online quiz). Missing data binding operations here and there, as a result, bunch of sql injections, which successfully led to the entire db full of questions and answers sitting on my desktop.
Vulnerabilities have been reported, took them 2 weeks to understand what happened and fix them.
Pretty sad :/1
The biggest mistake my colleague done is -
update query for admin_reports table without where clause in mysql in production db. Right after that no admin reports. More than 1000 rows affected.
Glad we luckily we have some data in staging machine.. I don't know Why TF our devops team not taking backup. Hope they will from now.
Nom I'm using python to dump the data from staging and save it local file and then export to production.
Fuck you mysql and your new fucked up 8.0 login. Fuck you 100 times. Now I need to restore my computer because of you.4
The guy was trying to upload MySQL into a PaaS SQL for last 1 week.
Me: Its SQL not MySQL
Guy: Yeah its PaaS, it works with both.
Spend all day trying to connect to my online database remotely just to realise there is currently a bug with IP wildcards on MySQL and I gave to add every ip that needs to connect to it manually. What if it's a dynamic ip? Have to add the new one everytime it refreshes. Seriously?!1
Best eays to improve database performance?
I have a huge database table with a lot of data, 10+columns and around 5-6million rows and growing. We are thinking about optimisation methods, the data will be frequently accessed, but not in the same ways. even though caching is helping, some initial requests take 6-20secs. What are good ways to improve a relational db performance? The data is date and item based, every item can have some data back from 2016 or older and up to 1000 related rows in each day. Every day new data would be added. Right now working with php.9
I have for a very long time wondered about, what do people do when using git and databases? If I locally add new columns to the db, how in the world would you easily make the change in production?
Do I really have to manually do it or take the time to make scripts for it?3
Okok i cant find a decent solution on this so have to ask you guys; i have 2 ubuntu servers atm. I need to transfer some few mysql data from s1 to s2 when i press 'send' on my main site. So its available to use on s2 and then back if needed. How can i do this properly and secure?4
Oracle vs MySQL !
My colleague and I had a long debate on auto increment and sequence :O |Guess who won ..
MySQL docker container randomly just redeployed itself. Because he can.
The worst part is that it pulled the last mysql-percona image (5.7 strict mode by default plus more) and I cant revert it!!! looooool
And you know what its the best thing? is that today is friday!! Best weekend ever 10/10 would repeat again fixing sql's everyday2
I've been meditating and shit on how to do hourly backups on a live MySQL database without slowing the fucking site to a crawl.3
What's your favorite way to expose a SQL database? Or interface with it?
Using mysql workbench right now and it's a bit much for my users.9
Well, there is this one video online of some guy who made his own website out of PHP and MySQL (https://youtu.be/lomppRPkeFE) . Good old me didn't care about how we were both noobs that didn't care how cringey the site was. The site had so many vulnerabilities and looked so much like a 90s forum, I offered to help the guy out on a common quest to make an epic website. 2.5 years later and that quest is still in progress today. We actually remade the site too (https://www.novanius.com)1
Today, I saw a table mean to store tags designed horizontally, each column store a tag with value 1 or 0. 🤦🏻♂️
Installed MySQL on my Ubuntu Mate laptop. Then I forgot which directory it's in and how to open it. Maybe I should reinstall it.5
"So our price widget doesn't allow decimals, you'll have to create a custom widget"
I do it.
"Hey, It's not working and I verified it's applying the filter correctly. I noticed my price is a string in your index, maybe that's incorrect and causing it to not work?"
They say: "Yep, you'll need to run an update to fix that and change all to floats" (charges an arm and a leg for the thousands of index operations needed to update the data type)
I clear the index and send a single one as a test, verifying it's a float by casting it using (float) then var_dumping. It shows "double(3.99)", but when it gets to Algolia, it's 0.
So I contact support.
"Hi, I'm sending across floats like you say but it's receiving it as 0, am I doing something wrong? Here's my code and the result of the var_dump"
They respond: "Looks like you're doing it right, but our log shows us receiving 3.999399593939, maybe check your PHP.ini for "serialize_precision" and make sure it's set to -1"
I check and it's fine, then I realize that var_dump is probably rounding to 2 decimal points so I change my cast to (float) number_format($row['Price'], 2) and wallah...it works.
Now I've wasted days of paying for their service, a ton of charges for indexing operations, and it was such a simple fix.
if they had thrown an error for the infinite decimal, that would have helped, but instead I had to reach out to find out that was the issue.
When your application uses persistent mysql connections... So you can't add more workers else "Mysql server has gone away" occurs 🙄
I worked for 7 hours today trying to find the bug because our BPM process wasn't working and the clients are really upset. I was pretty sure everything was correctly configured. I did around 15-20 rounds of debugging, putting and removing breakpoints in different parts of the whole project, going back to certain lines cause I might have missed a bug or maybe an error was there and I'm just not seeing it.
In the end, the only fucked up thing about it is that the table in the clients' ddbb was broken. It was considering something NULL even though it's not and the only thing I did was duplicate it and change the duplicate's name to the original name.
Those were 7 hours of wasted time, but at least I get paid for it!
Being worst in relationships and having hard time in debugging on a simple query with multiple table joins was an disaster for me
"Then you get a message saying the software is no longer supported, but that's ok"
Outdated technologies ftw
Just finished connecting my task manager (to-do list basically)using(angularjs,php)to my back end(it used localstorage previously now uses php and MySQL) now I can login ,register new users,create new tasks, set as priority.
Does some of you guys use a live chat software for your website?
Maybe open source?
No matter how many times I educate them, my colleagues still end up confused between writing conditions in join statement and in where statement.
They think they're both same :'(