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

1
vote
0answers
32 views

MySQL Update column with case on joined tables

I have 2 tables and I want to update table 1 using a case check on table 2: update cms.Clients c #c_id unique join cms.ClientDomains d #c_id not unique on c.c_id = d.c_id set c.country = case ...
1
vote
0answers
57 views

Cardinality of an index in a MySQL table is equal to table's row size

I have just included an index to a MyISAM table and the cardinality appears to be 1 million something which is exactly the number of rows in the table. In fact it needed to be 315 because distinct ...
1
vote
0answers
98 views

MySQL 5.6 Performance Tuning Issue

I have read and try lots of things about MySQL optimization and tuning. I tried most of them one by one according to our needs but nearly I got nothing. I am doing my test using some simulation ...
1
vote
0answers
38 views

Ways to recover a corrupted Wordpress database?

As a result of increasing PHP_Memory Limit our wordpress data base has apparently crashed and been corrupted. Our host, Rackspace, attempted crash recovery but all attempts failed. What commands or ...
1
vote
0answers
30 views

implement geo / spatial / proximity search with php and mysql — what have you done successfully

For my website's users, I want to implement a worldwide geo / spatial / proximity search with php and mysql. I want to do this as simply and minimally as possible. What is the minimum data I should ...
1
vote
0answers
61 views

how to force MySQL unsafe replication warnings to throw an error

I understand that MySQL WARNING statements, with respect to replication unsafe statements, are not 100% valid. That is, if you know what you are doing, if you understand the schema, there are indeed ...
1
vote
0answers
57 views

Mysql slow copying to tmp table to indexing

I try to indexing table. The table size is about 60GB. But indexing query is hang on 'copying to tmp table' 18 hours. I found advice setting 'myisam_sort_buffer_size' myisam_sort_buffer_size : 128M ...
1
vote
0answers
130 views

What is a good database design approach for my Online Quiz Android Application?

I have been working on an Android Online Quiz Application with PHP & MySQL. I know what attributes i need however when designing the relationship it becomes complex and confusing when I analysed ...
1
vote
0answers
40 views

Fetch items where related rows has different values

I have table in MySQL called attributes, and other table, attribute_values, one attribute can have multiple values, values identified by context attribute and has value_c attribute wich contain value. ...
1
vote
0answers
52 views

Finding Duplicate URLs

The following URL varchar(2000) row holds URL values in a 3rd party database that I'm accessing directly, i.e. going around the HTTP API. MySQL [database]> desc TABLE; ...
1
vote
0answers
63 views

Connecting PhpMyAdmin to two different MySQL instances on the same host

I currently have running two MySQL instances on my machine, production and development - I can connect to each one using the following: mysql --host=127.0.0.1 --port=3306 -u root -p mysql ...
1
vote
0answers
29 views

pt-table-sync fails “Turning off AutoCommit”

While trying to use pt-table-sync with the following options for a list of slaves: pt-table-sync --print --replicate schema.checksum_table --sync-to-master slave-001 I receive the following error ...
1
vote
0answers
32 views

How to sync incomplete replication records in MySQL

if replication breaks and you end up with a couple of records not pushed out to the slave, is there a way to update the slave without stopping locks on the master and manually transferring a new ...
1
vote
0answers
29 views

Classic vs. GTID replication MySQL 5.6 - how to identity which one used from errors?

Is that true? In classic replication (SQL_SLAVE_SKIP_COUNTER=1) you never see UUIDs in logs and show slave status like 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5? When you see an UUID, there is GTID ...
1
vote
0answers
24 views

The time is wrong in MySQL “data/*.err” file

I use "select now();" in MySQL client, the return time is right, is my system time. But the time in the "data/g1.err" is wrong, the "g1" is my computer name. The time's minute is right, so I think ...
1
vote
0answers
35 views

Multiple columns VS one big-capacity-column?

I have a table like this: // table_A +--------+---------------+------------+ | id | short-text | long-text | +--------+---------------+------------+ int(11) varchar(200) text ...
1
vote
0answers
18 views

Automatic incremental backup of MySql on windows

I have three Mysql Servers, Server-1, Server-2 and Server-3 all running on Windows. I have to configure Master-Master replication on Server-2 and Server-3. But Server-2 has to be a mirror of ...
1
vote
0answers
46 views

mysql innodb - strange data loss

I am running a mysql database on linux with several InnoDB tables. At some point, the ibdata1 file got quite big and I wanted to delete it. So I made a dump, deleted the file and restarted the server. ...
1
vote
0answers
35 views

Most Similar Records Query Performance

I have a mysql database table with 20 million records. It grows at roughly 25,000 records per day. Each record has a number of numeric fields. I have a similarity query that selects the 10 most ...
1
vote
0answers
35 views

Mysql Cluster Disk Storage Problem

We are currently create a Mysql Cluster with ndb distribution storage. We have a very large set of data so we want to config the ndb using the tablespace to store data in disk. I follow this link to ...
1
vote
0answers
29 views

Tracking MySQL DML Operations Source

We have a table that will get inserts and updates from 10 different jobs. We need to track each DML operation with its source i.e job name. We have used audit tables and triggers to get old and new ...
1
vote
0answers
28 views

MySQL using cpu after cancelling slow query

I had to cancel a very slow running query after it ran for a few days without completing on my ubuntu server. Since then mysql has been persistently running a process which is using 25-45% of the cpu ...
1
vote
0answers
54 views

Is this query actually working?

This is from show engine innodb status ---TRANSACTION 4FF4, ACTIVE 43350 sec, OS thread id 6232 fetching rows mysql tables in use 2, locked 2 480318 lock struct(s), heap size 46578104, 48647170 row ...
1
vote
0answers
85 views

High load on server because of one query

I have one query running from last stable version of wordpress on causing high load on my centos 6.7 server I enabled slow query log thought /etc/my.cnf file to record which sql cause this problem ...
1
vote
0answers
22 views

Mysql trigger with group_concat

I'm trying to create insert and update triggers with SELECT GROUP_CONCAT request on one of the fields; This select query perfectly works, when I trying it in console, but trigger saves only first ...
1
vote
0answers
57 views

pt-table-sync - Resync non existing table

I created my little lab where I can try different setup/scenarios. I have four machines debootsraped/chroot and this is my current layout: | Master A | < ---- > | Master B | | | Slave C | ...
1
vote
0answers
40 views

After disabling replication, should I disable binary logging?

I have a master-slave setup currently but am going to remove the replication DB server. The DBs are running on MySQL 5.6. I have a couple of questions about removing the replication: 1) I have read ...
1
vote
0answers
77 views

Is a 16,000 table database a bad idea?

I need to track stock prices for all 8,000+ stocks on the NYSE, AMX, and NASDAQ for at least 48 hours at a time, with stock price quotes for each stock every 2-4 minutes (less than a 5 minute period). ...
1
vote
0answers
33 views

Pushing pointers to followers with the metadata (MySQL Query)

I’ve seen the following question on StackOverflow, http://stackoverflow.com/questions/14004322/intelligent-mysql-group-by-for-activity-streams posted by Christian Owens 12/12/12. So I decided to try ...
1
vote
0answers
46 views

Moving to innodb_file_per_table?

I have just noticed (unfortunately while trying to restore from backup), that on my production server there is a 35GB ibdata1 file! As I understand I can reduce its size by moving to ...
1
vote
0answers
59 views

Alternative to EAV to store data with an unknown structure

For my bachelor thesis I have to build a reseach database which has to meet the requirement of provenance. In the present case it means that among other things I have to store the results of my ...
1
vote
0answers
52 views

Optimizing a group by/where in/min() query in MySQL

Assume I have a table that looks like such (The actual column names of my real table would only make things harder to explain, so I have created a mimic that behaves similarly). id | cond1 | cond2 ...
1
vote
0answers
41 views

MySQL Foreign Key Not Cascading On Delete

I have 2 tables, coupon: CREATE TABLE `coupon` ( `coupon_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `code` varchar(10) COLLATE utf8_unicode_ci ...
1
vote
0answers
22 views

MATCH(title) AGAINST('test 11' IN BOOLEAN MODE) can't search number

SELECT *, MATCH(title) AGAINST('test 11' IN BOOLEAN MODE) AS Score FROM search_table WHERE `date` > DATE_SUB(NOW(), INTERVAL 1 MONTH) AND MATCH(title) AGAINST('test 11' IN BOOLEAN MODE) ...
1
vote
0answers
223 views

Random Spikes in DB Connections - Amazon RDS

I'm running an EC2 instance (c3.large) with an RDS instance (db.t2.small). I'm frequently having issues with DB Connections spikes all of a sudden. PROBLEM: As you can see, I'm getting huge ...
1
vote
0answers
146 views

mariadb galera cluster stop one node automaticly

I have Mariadb galera cluster. I have 4 nodes. but When one node become slow, it stop itself automaticly. that's the error. What should I do? 151030 17:17:14 [Note] WSREP: view((empty)) 151030 ...
1
vote
0answers
75 views

Proper database configuration

I'm running MySQL 5.5 on Debian 7.8. My entire DB is 2200 MB large (all tables are InnoDB), the mysql process is taking up to 6G RAM but still I think that not evrything is loaded in RAM I have large ...
1
vote
0answers
193 views

`lc_time_names` has no effect

I have a Windows MySQL server running (5.6), and in the my.ini file I have the following directive under [mysqld]: lc_time_names = 'fr_FR'; But it has ZERO effect. When I start up the server, all ...
1
vote
0answers
47 views

Get a parent and the children using a child ID or the parent ID

I have a hierarchical table with 2 levels of depth – that is, parents and children. Having a parent ID, I want to extract the parent and its children. Having a child ID, I want to extract the parent ...
1
vote
0answers
45 views

Matching same unknown characters in two columns

So here is the situation. I have a database with values in columns that look something like this field_0_data1, field_0_data2, field_1_data1, field_1_data2 Is it possible to only select the columns ...
1
vote
0answers
44 views

Find the last record of group of overlapped records

I have a little dilemma with filtering out result. The result and what I want to achieve is not very trivial and I didn't find an answer anywhere after extensive search. So here is my problem: I ...
1
vote
0answers
61 views

Restoring MySQL Master-Master Replication

I am trying to restore Master-Master MySQL 5.6 servers. The replication failed between DB1=>DB2 and so DB2 went out of sync. GTIDs are enabled. I have done an export and import from DB1 to DB2 and ...
1
vote
0answers
53 views

Inexplicable differences between 2 almost identical databases on the same server

Our situation is as follows: We've got 1 MySQL (5.5.44) database server. The server hosts 2 databases. 1 database is the production database. The other is a copy database that gets copied from ...
1
vote
0answers
62 views

Design pattern for storing a database of databases

I have been tasked with designing a cloud platform that allows a user to manage the menus of a chain of restaurants from one place. The menus are basically massive TVs at the ordering counter. These ...
1
vote
0answers
63 views

Whats the difference between the following queries? Getting the top 3 salaries for different department

I am practicing SQL and came across this issue. I am trying to find the top 3 salaries for each department. The table structure is basic with one employee table with columns ...
1
vote
0answers
46 views

MySql - view out params of stored procedure when it selects from table

I have stored procedure: DELIMITER // CREATE PROCEDURE prcGetFemaleUsers() begin select firstName, lastName from tblUser where gender = 'female'; end // DELIMITER ; How can I get ...
1
vote
0answers
121 views

How to auto populate a foreign table?

This problem has been bothering me for some time now and honestly i feel like i just don't know how to solve it.I have been trying to solve it for over a week or probably two . It's pretty simple but ...
1
vote
0answers
104 views

phpmyAdmin doesn't display one table's data

Sorry if this sounds like a very basic question but I couldn't find the answer on this site or with web searches. I have a table in my database that have this structure: And these indexes: It ...
1
vote
0answers
68 views

How to import Sqlite database into another Sqlite database?

Hello everyone I am developing Desktop Application and using the WebSql Database this database is created into this path: C:\Users\Admin\AppData\Local\Google\Chrome\User ...
1
vote
0answers
54 views

how to group transaction entries?

I have this transactions table on my dvd store app: Transactions +----+-----------+--------------------+---------+------------------------+-----------------------------------------+ | id | member_id ...