An InnoDB table must have a primary key (one is created if you don’t do it yourself). You may have a natural key at hand. Stop! Allow me to suggest an AUTO_INCREMENT may be better.
Why should one add an AUTO_INCREMENT PRIMARY KEY on a table on which there’s a natural key? Isn’t an AUTO_INCREMENT a pseudo key, meaning, it doesn’t have any explicit relation to the row data, other than it is a number and unique?
Yes, indeed so. Nevertheless, consider:
Many of the prominent companies in the MySQL ecosystem are Percona customers, including hardware manufacturers, software developers, hosted service providers, and appliance developers. We perform paid and unpaid research on their products, and we publish blog posts related to their products or services. Independence and objectivity are core Percona values. How do we balance the [...]
It has taken a years to get a proper integration between operating system kernel, device driver and hardware to get behavior with caches and IO modes correctly. I remember us having a lot of troubles with fsync() not flushing hard drive write cache and so potential hard drives can be lost on power failure. Happily [...]
We’ve just published a new white paper analyzing the causes of emergency incidents filed by our customers. The numbers contradict the urban myth that bad SQL is the most common problem in databases. There are a number of surprises in other areas, too, such as the causes of data loss. This is the companion to [...]
Three ways to recover a root user password:
The order of solutions here under gets more creative on the way down :)
1. obviously, before starting messing around check my.cnf or scripts for passwords entries, then try home directories for password files
2. secondly – can you restart mysql? if yes, restart with –skip-grant-tables, log into mysql, change your password and restart without –skip-grant-tables
3. third option – (on linux / unix ONLY)
If you haven’t found the password anywhere and can’t afford to restart your mysql.
Disclaimer:
This post is for educational purposes only and no responsibility will be taken if you execute any of the commands. You mess it, you fix it!
Replacing a password for a user on MySQL can be done in at least four ways. Three ways at least.
1. set password for ‘user’@'host’=password(‘abc’);
2. grant usage on *.* to ‘user’@'host’ identified by ‘abc’;
3. update mysql.user set password=password(‘abc’) where user=’user’ and host=’host’;
The duration of a benchmark is an important factor that helps determine how meaningful it is. Most systems have some “burstable capacity,” and this can influence the results a lot. You can see this in all areas of life — you can sprint much faster than you can run a 10k race. Your stereo system [...]
Here’s what is new in Percona Server and Percona XtraBackup since last week. We are working on compiling and checking download statistics for both pieces of software. The preliminary numbers are far higher than I thought they would be. Both Percona Server and XtraBackup are becoming amazingly popular. I am aware of deployments running into [...]
I wrote an email a week ago to several close friends titled, “[w]hy are we standing still?” I opened with “[y]ou are all good friends and you are all smart people. We need to work together more … I deal with startups all the time and I rarely find a team of smart articulated people, so why can’t we just do this?”
(This is a cross post from percona.tv – the home of percona material in video form.) Last month I gave a presentation at the PHP UK Conference on the InnoDB storage engine. I was a last minute speaker, and I want to thank them for the time-slot and their hospitality at short notice. The video [...]