All versions of MySQL (not Microsoft SQL Server). Please also add a version-specific tag like mysql-5.7 if that is relevant to the question.

learn more… | top users | synonyms

6
votes
3answers
12k views

MySQL LOAD DATA INFILE slows by 80% after a few gigs of input with InnoDB engine

I'm loading a 100GB file via LOAD DATA INFILE. I've had good success with MyISAM, a few hours and done. I'm trying it now using InnoDB. The load starts fast at over 10MB/sec (watching the table file ...
0
votes
1answer
307 views

MySQL collate error occurs when sent by PHP app but does not occur in phpMyAdmin

I have a query that uses: t3.`value` LIKE "%someval%" COLLATE utf8_general_ci I load the page in my browser and get this error printed to the screen: COLLATION 'utf8_general_ci' is not valid for ...
1
vote
1answer
759 views

MySQL: To use MYISAM or INNODB engine? (plot twist enclosed)

We use INNODB for all of our tables, but I have one special table, a 100+ GB reference table (only read-queries against it). We are loading changes to this table in a nightly batch job using LOAD ...
0
votes
1answer
1k views

Group By on column from joined table

its about the following query. EXPLAIN SELECT phrase, infinitiv FROM `dict_verbs_all` `t` INNER JOIN `dict_verbs_all_language` `verbsGerman_c` ON (`t`.`id`=`verbsGerman_c`.`verb_id`) INNER JOIN ...
3
votes
2answers
10k views

Finding and fixing InnoDB index corruption

I encountered a new issue yesterday with one of my MySQL 5.5 slave DBs that runs on EC2 in AWS. The DB was created from a snapshot of another slave. The data is correct, but for at least one table a ...
1
vote
1answer
2k views

How to get SQL of single time zone

Trying to get the SQL for a single time zone results in an error message: $ mysql_tzinfo_to_sql /usr/share/zoneinfo America/Sao_Paulo mysql_tzinfo_to_sql: Error reading file '/usr/share/zoneinfo' ...
0
votes
1answer
1k views

Why would mysql “show global status” query be taking 15 minutes?

I'm reviewing the slow log, and on one of my slaves the average time for SHOW GLOBAL STATUS is 914s. Any idea how to determine the cause of this?
0
votes
1answer
965 views

Modify MySQL foreign key related column without dropping foreign key relation

I need to modify a foreign key related column. When I tried to alter it I got "Error on rename of 'x' to 'y' (errno: 150)" error. So I googled and found foreign key relation is the 'villain'. I ...
4
votes
1answer
3k views

Very Slow MySQL Queries, even with indexes

I have a relatively large 4-deep relational data setup like this: client_applications: (potentially 1,000's of records)    - ...    - account_id    - ...
3
votes
1answer
147 views

Strange behaviour of the float type

I have the following table: +------------+--------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | ...
0
votes
1answer
67 views

What would be the first things you do to find out about an MYSQL environment you are taking over?

I am new to DBA role, and wanted to know if there was any commands (or free software) that come with Mysql 5.5 (master/slave/slave) replication to quickly get familiar with the database, and also ...
0
votes
1answer
658 views

InnoDB row level locks without SELECTs?

I have several (>30) MySQL clients inserting into InnoDB tables concurrently. I keep encountering lock wait timeouts and can't figure out why. Here is the situation: Each client runs the following ...
0
votes
1answer
210 views

MySQL installation and data location on Windows

I'm gonna install MySQL 5.5 in a virtual Windows Server. I'd like to have the data in an separate partition (it may be in a different virtual disk) than the system one. I'm considering two options: ...
1
vote
2answers
4k views

mysql duplicate entry error 1062 when restoring backup

Sorry, I seen similar threads but I still couldn't find it addressing my issue plus, I needed some more info on this. Requirement: To create an exact replica 'db4' of an existing DB 'db3'. Procedure ...
2
votes
1answer
653 views

MySQL Dump/Import progress on Windows

I'm going to dump a considerable big datatabase (7gb) from a MySQL 5.1 instance running on Windows into a .sql script and import it into a MySQL 5.5 instance, also on Windows (another machine). I'd ...
4
votes
1answer
758 views

Is it possible to use the same directory for 2 MySQL servers?

I have 2 OS-es on my machine: Windows XP and Linux Slackware. Both of them have mysql installed: Windows - 5.5.25 Linux - 5.5.27 Is it possible to use the data directory from Windows on Linux? So ...
3
votes
2answers
1k views

Database space doesn't match ibdata1 size

I'm using InnoDB database with a single file configuration (in /var), so no innodb_file_per_table. In the MySql workbench, when I query for the databases used space, with this query SELECT ...
1
vote
1answer
346 views

mysqldump, preserve update_time and modify_time attributes as listed by show table status from

Does mysqldump preserve the create_time and update_time attributes that are output by show table status from? If not, is there an option that does this? From the manual it looks like mysqldump ...
1
vote
1answer
558 views

import data from csv to mysql - good database structure

I have a collection of csv files with measurements with the following 54 columns: SITE (string) TIME (integer as yyyymmddhh) PROD (double) EST.0 (double) ... EST.50 (double) I want to read this to ...
0
votes
1answer
3k views

MySQL: Can't find record in tablename

After crash: mysql> repair table lot_not_sold; +------------------------+--------+----------+---------------------------------------------------------------+ | Table | Op | ...
2
votes
1answer
659 views

How to know when to scale RDS MySQL instance? How to scale it?

I'm running 1 single medium RDS instance for my websites. How do I determine when I will need to scale it up? Is there a way to scale it horizontally or I can only upgrade it to a bigger instance?
1
vote
2answers
549 views

Is a Secondary Index in MySQL the Same Thing As a Non-Clustered Index in SQL Server?

I am assuming that a secondary index in MySQL is the same thing as a non-clustered index in SQL Server. Is this true?
2
votes
1answer
421 views

Group activities in activity feed by users and products

On my website I'm building an activity feed where I got the basics done and are now making some improvements here and there. One of them is the grouping. I've built it so that if multiple users buys ...
2
votes
1answer
338 views

How to scale MySQL transaction wrapped queries?

So I'm working on an app that wraps many of it's SQL queries in a transaction for it's SQL usage and I'm trying to think of some ways to scale the DB layer up.... Up until now we've been throwing ...
1
vote
1answer
1k views

Slow MySQL query with float using BETWEEN and ORDER BY

Trying to figure out whether it's the BETWEEN being used on a float or the ORDER BY and the lack of an index that is making this query slow. First the tables used in the BETWEEN and ORDER BY: ...
2
votes
1answer
177 views

Can I normalize my experimental data table further?

I am attempting to get a MySQL database to 3NF, but I'm unsure as to how to get there. I'm new to database design, so please correct me if my understanding is incorrect. I have 6 columns: ...
3
votes
1answer
2k views

How can I find out the last time a MySQL table was analyzed?

I'm interested in this for InnoDB mostly, but also for MyISAM. I looked around in information_schema and did not see this data anywhere. I'm using MySQL 5.5.16.
2
votes
1answer
2k views

How can I set a default session sql_mode for a given user?

I want to have a default session sql_mode that is different from the global sql_mode. I can set it manually, but I'd like to do it automatically. I thought I could add it to .my.cnf, but that ...
0
votes
1answer
113 views

mysqlbackup mysql enterprise utility issue

I recent took a backup using mysqlbackup. While restoring it, I noticed that the files that were copied into datadir are with root:root (user:group) instead of mysql:mysql. Is anything wrong with ...
4
votes
2answers
216 views

MySQL - Creating a user and specifying a password

How do I create a user and specify a password in one line: I thought CREATE USER 'foo'@'2.2.2.2' IDENTIFIED BY 'bar'; would do it but apparently it doesn't. Any thoughts? I'm on version 5.1.49 of ...
1
vote
3answers
74 views

Contains statement Query

I need to check the string with the column if the column contains that string or not. example:String 'how to make pizza' and the column if has 'pizza' i need to fetch that.. like SELECT * FROM ...
2
votes
3answers
16k views

which mysql version to use - 5.1 or 5.5?

I am designing a new database. There are going to be around 1000 write queries per second. There may be as much as 10000 read per second. Which MySQL version is recommended? I came across a post on ...
21
votes
1answer
5k views

MySQL 5.1.66 SSL connection error ERROR 2026 (HY000)

UPDATE2 Using WireShark I found out the problem string (I hope I did): 28 | 9.582638 | 192.168.18.128 | 192.168.18.129 | MySQL Response Error 1043 And the error is (according to docs): Error: ...
0
votes
1answer
302 views

Maintain table with too many insert

I have to create a table. Its size is going to increase very fast. Is there going to be any issue if many insert queries are fired at the same instant as mentioned here - User autoincrement ID for ...
5
votes
1answer
4k views

Is there a MySQL engine or trick to avoid writing so many temp tables to disk?

I've got a web application connected to a database running MySQL. Here's the problem: a not insignificant number of queries create temporary tables and many of the tables involved have BLOB fields. ...
1
vote
1answer
259 views

MySQL SELECT query: i want show duplicated entries

Example My query is: SELECT code_CAT FROM categories WHERE id_code IN(14,14,14,14); output is: 53724 Only one row. Instead I want this output: 53724 53724 53724 53724 How can I achieve ...
4
votes
1answer
2k views

does last_insert_id() returns correct result when writes from multiple sessions?

I have a table in which there is a combination of 4 columns that will act as a unique key. Instead of using a composite primary key, I want to keep an id column as the primary key. This field is on ...
1
vote
1answer
644 views

What is the best and most performant MySQL cloud solution?

I'm looking for a solid solution (~1GB of DB space). Speed is crucial and I'm happy to spend up to $100 a month on a decent solution. The database will be used by a series of desktop applications ...
3
votes
2answers
9k views

mysql_install_db: How to set the root password

mysql 5.6 seems to have a new --random-passwords option for mysql_install_db, which lets me discover the root password: ...
0
votes
2answers
2k views

Delete and archive old data from several related tables

Our schema looks like this: table tblTrip: stores start and end trip date and time table tblTripData: keeps all the trip data table tblTripEvent: stores events related to the particular trip. Then ...
4
votes
1answer
2k views

mysql statement based replication - unsafe statements

I have recently set up statement based replication and my error logs are filling up with this error 121231 21:10:55 [Warning] Unsafe statement written to the binary log using statement format ...
1
vote
2answers
324 views

mysql 5 vs 5.5 memory usage

I had a less less memory usage in mysql 5 vs 5.5 do they do something drastically different? I went from around 100mb to about 1 gb of memory usage. Does memory usage in 5.5 also grow over time?
3
votes
3answers
2k views

Count consecutive rows in mysql

I would like to get the count of consecutive rows in MySQL. It is a large database I try to avoiding the joins. Here gadget_id means vehicle and every 20/30 second the vehicle sends the current ...
2
votes
2answers
3k views

How do I use MySQL Workbench to edit an existing, in-production database?

This is basically a repost of this question, which didn't give a satisfactory answer. I'm finishing up the design of a database using an EER diagram. I now want to forward engineer and import the ...
2
votes
1answer
279 views

Performance impact of including result column in indexed columns

I have a database (in MySQL, using InnoDB) that I am using for texture identification in a 3D image. In it, there will be a table of texels(texture pixels) with hue included, in the form of: texelid ...
1
vote
1answer
870 views

Queries getting stuck on very simple COUNT queries

process list: | 16004 | metrics | xxx:64616 | metrics | Query | 29064 | Sending data | SELECT COUNT(*) FROM Plugin where LastUpdated >= '1356856200' | ...
5
votes
1answer
374 views

Deadlock free MERGE-alike in MySQL?

I am trying to implement some parts of MERGE in the MySQL driver in Drupal. Of course, Drupal has something but in truth it only works because the most frequent MERGE issuer just eats exceptions. So, ...
3
votes
3answers
20k views

Master - master replication not working

I configured two WAMP servers running on different machines for master-master replication. I am using a linksys router for the network. I created a wireless network, but one of the server boxes ...
3
votes
3answers
1k views

INNER JOIN Giving time out on large database

Getting time out on this script UPDATE uk_data AS ud INNER JOIN uk_pc AS up ON ud.cat10 = up.WardCode SET ud.cat8 = up.Latitude, ud.cat9 = up.Longitude; uk_pc Table ...
1
vote
1answer
139 views

After piping a file with SQL statements to mysql, how can I keep the command line session open?

A file, in.sql, contains a CREATE TEMPORARY TABLE statement followed by some INSERTs that populate the above table. Temporary tables are purged after the session closes, so 'mysql -u user -p pass < ...