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

2
votes
0answers
129 views

MySQL Partitioning Performance

I have a MyISAM table with billions of rows that is still causing me problems because the indexes, even after I shortened them as much as possible, do not fit in my 64GB of RAM. I am unable to index ...
0
votes
0answers
520 views

MySQL CSV LOAD DATA INFILE … doesn't want to load more than 72 lines

I'm trying to load a .csv file into my database with many lines of input from a website I'm working on. For some reason I can load files multiple times (over and over) into the database but they have ...
6
votes
2answers
9k views

How to design indexes for columns with NULL values in MySQL?

I have a database with 40 million entries and want to run queries with the following WHERE clause ... WHERE `POP1` IS NOT NULL && `VT`='ABC' && (`SOURCE`='HOME') && ...
1
vote
1answer
459 views

How often should MySQL (stock, Percona, etc.) be upgraded?

My organization runs several data-driven web applications backed by various flavors of MySQL on RHEL (i.e. we're just like everyone else!) Some of our web apps use the standard build of MySQL, and we ...
-1
votes
0answers
124 views

Unable to restore cpanel database backup [closed]

I recently created a complete backup of my cpanel to move it into another server. Now the insert queries generated by cpanel for wp-posts table (corresponding to WordPress posts) are too big since ...
1
vote
1answer
505 views

Trigger not Working

I created trigger on table PENDING. Pending table has 3 columns uniqueId duration maxDuration I have another table COUNT with 2 columns req_id total Here is my trigger-- CREATE TRIGGER ...
1
vote
1answer
3k views

Mysql settings for query_cache_min_res_unit

What is the best setting for query_cache_min_res_unit for these results: +-------------------------+-----------+ | Variable_name | Value | +-------------------------+-----------+ | ...
1
vote
3answers
1k views

Innodb table is taking randomly long time to execute the insert query and in show processlist showing as queryend/updating

Innodb table is taking randomly long time to execute the insert query and in show processlist showing as queryend/updating and it happens for the similar queries for the same table and the queries got ...
1
vote
2answers
2k views

How can I add a column to multiple tables at once in MySQL Workbench?

I have a MySQL Workbench model (diagram) that belongs to a Ruby on Rails application. I now need to add the created_at and updated_at timestamp columns to each of the tables. What is a quick and easy ...
3
votes
1answer
2k views

Trigger for updating a count of rows from a table into another table

I have these two tables: mysql> select * from orders; +-------------+---------+ | Customer_ID | Item | +-------------+---------+ | A01 | CPU | | A01 | Monitor | | A02 ...
0
votes
1answer
402 views

Check if bit is set in mysql

I have a field which stores the days of the week in binary representation. For example, Mon-Wed-Fri would be represented as b'0101010' with the 1st digit as Sunday and the last as Saturday. What I ...
3
votes
2answers
167 views

MySql is not optimizing the query properly

I have a table structure as follows : CREATE TABLE `sale_product_inventories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sale_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `size` ...
2
votes
3answers
455 views

Drop tables where the last update is over 1 week ago

I can see in PMA that it stores information for every table. I was wondering if there was an SQL query to drop any table in the database that have a last update time of more than 1 week ago?
1
vote
2answers
452 views

Where condition execution sequence in MySQL

I am using MySQL 5.0.88. I have a query like: select DISTINCT party.­id FROM party­ LEFT join party_­identifier AS pi ON pi.­party_­id = party.­id­ WHERE ­(pi.­source_­note=? AND ...
0
votes
0answers
21 views

Where condition execution sequence in MySQL [duplicate]

I am using MySQL 5.0.88. I have a query like select DISTINCT party.­id FROM party­ LEFT join party_­identifier AS pi ON pi.­party_­id = party.­id­ WHERE ­(pi.­source_­note=? AND first_­name LIKE ? OR ...
0
votes
2answers
985 views

mysqlcheck: unknown variable 'max_allowed_packet=100M'

I get the following error when I try to use mysqlcheck, mysqlrepair or mysqlanalyze: mysqlcheck: unknown variable 'max_allowed_packet=100M' I am trying to find whether there are any corrupt tables ...
1
vote
1answer
612 views

Percona xtrabackup Prepare Fails

I made a backup and according to Percona it completed successfully. Now I'm trying to prepare it and having the following issue: ./xtrabackup_55 --defaults-file="/etc/my.cnf" ...
1
vote
1answer
57 views

JOIN to read first table and get possible relationship in the second table

Consider a main table as CREATE TABLE groups ( group_id int(11) NOT NULL AUTO_INCREMENT, group_title varchar(255), PRIMARY KEY(group_id) ) ENGINE=InnoDB and a second table for relationship as ...
3
votes
2answers
2k views

MySQL version confusion

How is this possible: I installed mysql-5.6.11-osx10.7-x86.dmg which is supposed to be version Mac OS X ver. 10.7 (x86, 32-bit), DMG Archive (32 bit!) But upon SHOW VARIABLES LIKE "%version%"; I get ...
2
votes
1answer
51 views

How can I include more query in one query?

These are my tables: tbl_answers => aid qid answer uid dateposted emailnotify namedisplay status isbestanswer tbl_questions => qid question ...
0
votes
1answer
321 views

Does MySQL reserve memory for MEMORY tables based on max_heap_table_size

Currently I have a set of large MEMORY tables, and have previously calculated how much space I believe each will require and assigned max_heap_table_size accordingly so that the sum is not greater ...
1
vote
1answer
113 views

Migration of create statement from SQL Server to MySQL

I have a table that have the following table structure CREATE TABLE [dbo].[ASAT]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [ASATID] AS ('ASAT'+right('00000000000000000000' ...
1
vote
1answer
616 views

Would Mongo's ObjectID work well in InnoDB's clustered index?

Mongo's ObjectID is defined like this: ObjectId is a 12-byte BSON type, constructed using: a 4-byte value representing the seconds since the Unix epoch, a 3-byte machine identifier, ...
0
votes
3answers
3k views

Creating a global temp table in MySQL

I am working on a MySQL stored procedure. I need to create a temp table and I want to access this temp table whenever I execute this stored procedure. I know we can't access the temp table in ...
0
votes
2answers
3k views

Is there a good reason to store big text data outside database?

I was analyzing my MySQL database performance and found that tables containing text fields are just huge, larger than 1Gb. This data is only used when loading single record (like article or blog ...
0
votes
0answers
1k views

Properly index magento mysql tables to improve specific query performance

I am running magento community edition and its db performance is horrible. I have the following query: SELECT `width_idx`.`value`, COUNT(DISTINCT width_idx.entity_id) AS `count` FROM ...
5
votes
1answer
2k views

Best strategies to have a backup of an RDS MySQL database

I have an AWS RDS MySQL database. I'm not a DBA, so my knowledge is limited. I wish to design strategies to have zero data loss in case of a failure, in terms of replication or data backup. I know ...
1
vote
1answer
4k views

MySQL Workbench - question about creating FK relationships

Forgive me a little new at databases and I came across something while working with Workbench that I have a question on. In a very simple testing database, with three tables: Company, Department, ...
3
votes
1answer
477 views

Will creating a view on a MySQL replication slave break the replication?

We need to run some very ugly queries on a MySQL replication cluster. Does anyone know if creating a view directly on the slave will break the replication of the other, otherwise untouched data ...
2
votes
2answers
482 views

MySQL many to many relation

Sorry is this seems a stupid question, but I have a table of server addresses and a second table with a list of hardware devices which use the addresses, it is possible for multiple devices to use the ...
2
votes
1answer
2k views

Percona Node fails to join: Operation not permitted

Joining a new Percona node fails with: 130521 7:15:44 [Warning] WSREP: Failed to prepare for incremental state transfer: Local state UUID (00000000-0000-0000-0000-000000000000) does not match group ...
1
vote
1answer
3k views

ERROR 13 (HY000) When Creating Database

I'm trying to create a database and when I type in CREATE DATABASE epik; I get the error ERROR 13 (HY000): Can't get stat of './epik' (Errcode: 13) I am running kubuntu 13.04 with mysql 5.5.31.
0
votes
1answer
252 views

Do certain string patterns affect query performance on a VARCHAR column?

I am a beginner on MySQL Administration and performance problems. Now this is confusing me. I have a VARCHAR column identity, the string in it is consisted of a Class type and an id, like note:123, ...
2
votes
2answers
7k views

MySQL Workbench connect to MS Access

I have a .mdb file on my computer that I would like to convert into a MySQL Schema and I have found that there is a migration tool within Workbench. However it doesn't seem to allow you to connect to ...
6
votes
2answers
414 views

Is there any way to trace optimizer's work in MySQL?

Just like the MEMO structure in SQL Server which is kind of a "paper trail" of steps the optimizer takes in optimizing the query. Is there anything in MySQL through which I can get the information ...
1
vote
1answer
74 views

ORDER BY optimization issue

I have a query: SELECT user_details.id , user_details.first_name , user_details.last_name, user_accounts.name account_name, jtl0.account_id account_id, user_details.title , ...
1
vote
2answers
2k views

Which one to use? InnoDB Replication or MySQL Cluster?

I am building a url shortener and I use InnoDB as the storage engine for link data. I will start with a single VPS containing both application instance and MySQL database instance on the same Virtual ...
0
votes
0answers
340 views

MySQL binary log failed to generate a new one

In my Linux standalone machine, I have set up MySQL on it. In my.cnf, I have the following cofiguration: [mysqld] log-bin=mysql-bin binlog_format=mixed expire_logs_days = 10 max_binlog_size = 100M ...
1
vote
2answers
6k views

format of mysql query log

What is the format of the mysql query log? In particular, for lines like: 133 Query commit 133 Query rollback What does '133' stand for? And is it true that each line represents a round ...
0
votes
1answer
282 views

Make rows immutable allow Insert mysql5

I want to make the rows in a Mysql table immutable, once they are inserted I don't want it to be possible to change them. How can I do this? (ideally returning a suitable error message if any change ...
1
vote
2answers
336 views

MySQL Master/Slave. Actual use of Slave Machine

We have a MySQL server running in a mobile production trailer. The trailer is out on the road for weeks at a time. We have cell internet and wifi access is nearly all of our locations. Our office ...
4
votes
1answer
10k views

How to recover/restore corrupted Innodb data files?

A while ago, my Windows 7 system on which a MySQL Server 5.5.31 was running crashed and corrupted the InnoDB database. The weekly backup that's available does not cover all the tables that were ...
4
votes
1answer
5k views

Allocating 8GB memory to MySQL on a 64bit system

Specs - MySQL 5.0.x , Redhat 5.9 , Physical memory - 16GB I am trying to set innodb buffer pool size to 8GB (innodb_buffer_pool_size=8G). When i do, and start mysql, i get following error - ...
4
votes
1answer
469 views

Storing history of full/partial tables

I'm building a web-application with Django and MySQL (InnoDB) and am currently pondering over how to manage historical changes on various tables. I wonder if it's efficient to store a lot of rows ...
1
vote
0answers
64 views

Import - database not found error

When I issue the following command: mysql -u user -ppassword database_name < /path_to_database.sql I get: sh: database_name: not found And it stops processing. I have created database_name ...
2
votes
2answers
703 views

Errors while creating multiple mysql-5.5 instances

I have installed 3rd mysql instance on my testing server. 2 instances already running without any issues. When I installed 3rd instance by mysql-5.5.30 zip source, it installed successfully but when ...
3
votes
1answer
4k views

Insert Row With Foreign Key Equal to ID - Circular Reference

In MySQL database I have an events table which has a circular reference to itself with the following columns. id (PK) | user_id (FK) | event_id (FK) | title Each new row inserted has a circular ...
1
vote
3answers
193 views

Master/Slave without populating tables

So I have some Zabbix instances which are using MySQL for their backends. What I would like to do is, for DR purposes, backup the DBs for each instance using a Master/Slave configuration, with the ...
1
vote
1answer
974 views

“relation does not exist” trying to import mysql dump into postgres

environment: ubuntu 10.04 mysql server 5.1.69 postgres 9.2 Here's the sequence of steps: created a new postgres database, myDatabase executed this command: mysqldump -u root -p ...
1
vote
0answers
495 views

Mysql 5.6 and install php5-mysql , mysql-common

I install Mysql 5.6 with this documentaion(in ubuntu 13.04) , now I need to install php5-mysql and mysql-common packages. can I install them with apt-get? I think they will install mysql5.5 ...