Tag Info

Hot answers tagged

3

Because the value is incremented outside the scope of the transaction. This is the way you want it to work, so that separate transactions can happily insert rows or roll back without waiting for each other. If you care about gaps or want different behavior, stop using the built in and roll your own...


2

I might be guessing on this one, but I think the key distribution must be insane. POSSIBILITY #1 Please run this SELECT * FROM ( SELECT IFNULL(user_id,-1) user_id,COUNT(1) prod_count FROM products GROUP BY IFNULL(user_id,-1) ) A ORDER BY prod_count DESC; If you can send the output to a text file, look for user_id 12 and compare its prod_count to ...


2

I've written this in SQL Server so you may have to translate to MySQL but this should work for you. CREATE TABLE #ExcludeList (ExcludeVal varchar(50)) CREATE TABLE #VideoList (VideoName varchar(500)) INSERT INTO #ExcludeList VALUES ('Prob1'),('Prob2'),('DontUse1') INSERT INTO #VideoList VALUES ('This is a prob1'), ('This is clean'),('This is ...


1

You literally do not need a third party tool. STEP 01 Find out the path to the data by running mysql> SHOW GLOBAL VARIABLES LIKE 'datadir'; For this example, let's suppose it is C:\Program Files\MySQL\MySQL 5.6\data STEP 02 Pick a destination folder to copy the data directory For this example, let's pick D:\MySQLBackup STEP 03 Create batch file ...


1

As you say, temporary tables are only visible within the session, and materialized views are not available in MySQL. There are several options (including the ones you have mentioned). I will name your original query as SELECT ...: The WITH Oracle keyword is equivalent to CREATE TEMPORARY TABLE: CREATE TEMPORARY TABLE savedquery AS SELECT ...; -- you ...


1

This is related to a bug with new installs of mysql on debian wheezy whereby the error.log file is owned by root.root, as per this: http://tipstricks.itmatrix.eu/?p=1352 I fixed it with chown mysql.adm /var/log/mysql/error.log


1

Install percona-toolkit. Then you can use pt-online-schema-change. I usually use it when I have to alter tables. What it does is copy the data from your current table to another table. Triggers are automatically created, that copy incoming data to the copy while copying. This only works flawlessly if you don't have triggers on the table already. After that, ...



Only top voted, non community-wiki answers of a minimum length are eligible