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

0
votes
0answers
36 views

What can cause the the table cache in MySQL to consume much memory?

I have a server with a table_open_cache of ~2000, and a query cache of ~128M. We have ~350 InnoDB (no MyISAM) tables; innodb_file_per_table is disabled; there is no partitioning; MySQL is 5.6. After ...
0
votes
1answer
30 views

error 1146 when importing mysql DB

I'm trying tu dump and re-import a database, I'm using the following bash script to export (I have reasons to export each table separately) for x in `mysql --skip-column-names -h [host] -u [user] ...
0
votes
1answer
20 views

need to join Vertical row as per values in Horizontal rows

TABLE 1 +----+--------+-----+ | id | userId |state| +----+--------+-----+ | 1 | 1 |AZ | | 2 | 1 |AK | | 4 | 1 |AL | | 5 | 1 |CO | | 6 | 1 |CA | | 7 | 2 ...
0
votes
1answer
58 views

MariaDB - cannot set max_connections and wait_timeout through my.cnf

I am struggling to set max_connections and wait_timeout parameters in /etc/my.cnf but MariaDB does not seem to read the parameters from the file (it reads some of the others, I haven't checked all). ...
0
votes
0answers
17 views

Completely reset innodb logs and files

So long story short, we've been dealing with a corrupt innodb installation on a MariaDB 10.0 server after a power outage, specifically a log in the future error. Rather than try and fake the log ...
0
votes
1answer
58 views

Slow search by LIKE and other values (1 million rows+)

I'm currently developing a kind of search website where one can search for business companies in my country. The database table has 1 million rows and quite a few colums (42 columns). But I find it ...
0
votes
2answers
26 views

Complex MySQL query through relational tables

I am generating a query that returns a set of profiles that meet all the conditions posted below I am receiving the data like so in Ruby, then making a dynamic MySQL query based on the contents - ...
1
vote
0answers
29 views

MySQL/JDBC: Can a commit on server get missed on client?

I am wondering about when conducting a transaction of one or two updates/inserts from a JDBC client to MySQL Server over the network... In the event of losing the network during the commit, can I get ...
2
votes
3answers
110 views

Poor performance of JOIN, WHERE, ORDER BY combination (MySQL)

Goal: select 10 most recent rows from posts which are related to a specific user. There are two tables: posts (~5,000,000 rows) and relations (~8,000 rows). posts columns: ...
0
votes
0answers
12 views

How to use column result as column name with MySQL [duplicate]

At the moment I have sample table as such doc_name | processed_date | doc_version ---------------------------------------- doc_1 | 2015-01-01 | 1.0 doc_1 | 2015-01-02 | 1.1 doc_1 | ...
0
votes
1answer
14 views

Monitor locks over long period of time

I am having some issues with one of my tables in a production server. I know there are many diffrent threads running on this table. I need to put some kind of monitoring tool to see how many locks ...
0
votes
0answers
43 views

Generate UUID v4 automatically in MySQL

Is it possible to generate a UUID version 4 (completely random) in MySQL? I would like to use it as a primary key. Use Case Many systems will insert to the table, some may specify a UUID when ...
0
votes
1answer
50 views

Maximum number of TEXT/BLOB columns per table/performance of table with many of them?

I've created a system that generically imports CSVs into a database table with metadata columns for keeping track of when a CSV record has been changed, and it allows filtering on CSV columns instead ...
0
votes
1answer
59 views

Export .MWB to working .SQL file using command line

We recently installed a server dedicated to unit tests, which deploys updates automatically via Jenkins when commits are done, and sends mails when a regression is noticed > This requires ...
0
votes
0answers
11 views

Tools & Requirements for MySQL Database Administration [duplicate]

I have searched a lot on google about tools and requirements for MySQL Database Administration,even though i didn't get clear answer but i came to know about some tools. Now my main question is that ...
0
votes
2answers
37 views

Mysqld crashes after hold f5 in browser [duplicate]

i have cloud vps server, cpu 512 mb. i have website. if i hold f5 in browser after 10-20 sec mysql server no responding and it gives me error SQLSTATE[HY000] [2002] Can't connect to local MySQL ...
0
votes
1answer
41 views

Altering column data SQL [closed]

I have a set of car data, one of the columns represents the registration year. I want to change this column to age. As the data is from 2010 I assume that the following statement should calculate the ...
1
vote
1answer
43 views

See if an JSON array in MySQL contains an object whose key holds a specific date

i'm trying to find out if there is a row which contains a specific date inside a JSON array Let's say my data looks like this: Table applications: id | application_id | data # Rows 1 | 1 | ...
0
votes
1answer
39 views

Upgrading to MySQL 5.5 from 5.0 looks broken

I was using SLES SP3, and had earlier MySQL 5.0.67. I upgraded it to 5.5.48 (available with the CD) after upgrading my OS to SP4. I edited the /etc/my.cnf file, and replaced skip-locking to ...
0
votes
1answer
14 views

How password can be prompted in percona xtrabackup

How password can be prompted while using percona xtrabackup.--ask-pass option is not working with xtrabackup. Thanks in advance.
0
votes
0answers
78 views

MySQL replication/cluster of multiple databases

I am looking for a suitable MySQL replication technology. I'll try to explain our use case first. We have several applications: 1 public web application multiple customized enterprise web ...
1
vote
1answer
19 views

mysql replication: slave is not getting data from master

here is my problem that all setup is done for mysql replication but the slave is unable to sync the master's data. to understand i am sharing link below please visit. mysql> SHOW SLAVE STATUS \G; ...
0
votes
1answer
20 views

Get data from previous years dynamically

I have a table with columns id, fname, date_field. date_field's records are: 2011-03-01 2012-03-01 2013-03-01 2014-03-01 2015-03-01 2016-03-01 I want the data for the past 2 years for each record ...
1
vote
0answers
15 views

Wildcard in CREATE grant in MySQL

MySQL allows the use of wildcards for database names, in order to allow an user to operate only on a subset of databases: GRANT ALL PRIVILEGES ON `foobar%`.* TO 'user'@'%' IDENTIFIED BY ...
2
votes
1answer
59 views

Query with Indexes slower than without Indexes

I'm using MySQL 5.6 and my storage engine is InnoDB. I have a table with 1 million rows containing with the columns: ID (primary key) FirstName LastName foreign_key_id (foreign key, NOT NULL) ...
1
vote
0answers
23 views

MySQL Error 111 caused by remote connection

This database has been running for years, such that all connections have came from the localhost address. Recently, I have been using xampp to develop new software, and have been connecting to the ...
1
vote
1answer
37 views

Select rows until a condition is met

Given: CREATE TABLE T ( x int not null primary key , y int not null ); INSERT T(x,y) VALUES (1, 0) ,(2, 0) ,(3, 0) ,(4, 0) ,(5, 3) ,(6, 0) ,(7, 4) ,(8, 0) ,(9, 0); The ...
0
votes
1answer
54 views

MySQL Query fix and speed up

I'm newish to MySQL and a lot of my query is pieced together from this site and trial and error, so any help is appreciated. If I left out anything, or more detail is needed, I will be happy to give ...
0
votes
0answers
8 views

T-SQL to MySQL conversion for PIVOT [duplicate]

I made a garbage table with garbage data and a PIVOT on it in T-SQL format and I would like to convert it into MySQL but I can't figure out how to get it to work. Table and data: CREATE TABLE ...
0
votes
1answer
25 views

Display the the result of a substraction in a MySQL query (1 table)

I've made a table that looks like this: stop (table name) -cityName {PK} -schedule {PK} -price -routeNo Basicly the customer wants to know what's the cost difference between 2 different stops by ...
2
votes
1answer
76 views

Many to many between lots of tables?

TL;DR: How could I set up many-to-many relationship between that many tables and is it viable/recommended? Each body type has its own table Each car in each body type table can has several ...
1
vote
1answer
42 views

import TSV file into MySQL table with SET datatype column

Is it possible to use LOAD DATA INFILE to load data into a MySQL/MariaDB table, where one column uses the SET datatype? My columns are separated by tab, my set members by comma. If so, how do I ...
0
votes
1answer
27 views

On the fly MySQL balance

Please excuse my English translation that makes by Google Translate I need to solve the following in a MySQL query without php or another language: In the “A” column I have a string value, in ...
0
votes
1answer
15 views

Backup/Restore single database with MySQL Enterprise backup

From what I have found online is it is possible to backup/restore an entire mysql instance with MEB and also a single .ibd file (to my understanding is a single table). What I am trying to do is ...
1
vote
2answers
25 views

Can I remove binary log files not listed in mysql-bin.index?

We've had some problems with one of our more elderly MySQL servers (version 5.045). The database is back up and running OK but there were over twenty thousand binary log files in the mysql folder. I ...
1
vote
1answer
45 views

InnoDB: secondary key that's 'parallel' to primary--do joins wherein the resulting primary keys are contiguous perform better?

Say I have a table ( person_id INT AUTO_INCREMENT, birthday_timestamp BIGINT, country, state, ..., PRIMARY KEY (person_id), KEY (birthday_timestamp) ) where people are added the instant ...
0
votes
3answers
52 views

Mysql query larger than tmpfs (ramdisk)

I recently set up a ramdisk tmpfs on our mysql server and the performance improvement has been quite noticeable. I've allocated 24 out of 32 GB's of ram for the ramdisk. My only concern is what ...
-1
votes
1answer
50 views

Server settings with 36GB handling app+data

I'm setting up a server to handle a multi-site configuration on a beta application for a partner in a new business venture. Trying to assess sane values for MySQL. Currently I have set: ...
1
vote
0answers
31 views

Access denied when trying to use Mysqlimport Utility (using Root Credentials)

We are trying to import large CSV files through Mysqlimport as described in This & This article. But even though I am using root credentials I keep getting the following error: mysqlimport: ...
0
votes
0answers
29 views

MySQL Return average for every unique id per day

I have a table: Unique ID, DeviceID, Temperature, Epoch And 3 sensors (DeviceID's) sending temperature every minute to the database. I would like to select to return AVG(Temperature) for every ...
3
votes
2answers
77 views

Need help improving sql query performance

I have this table: CREATE TABLE `property_ads_history` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `property_ad_id` int(10) unsigned NOT NULL, `advertiser_type` varchar(255) COLLATE ...
0
votes
1answer
26 views

Result consisted of more than one row in procedure

i confused with this i try not using cursor and same get error so i back using cursor but before this day my query success and can generate but this get error please help me i already look other ...
1
vote
1answer
59 views

Is the SQL syntax for InnoDB gauranteed to be the same between MySQL, MariaDB and Percona?

I develop an application that uses MySQL and explicitly uses InnoDB table engine. In a few cases we have clients using this application with MariaDB or Percona. I understand that MariaDB and Percona ...
1
vote
1answer
63 views

When to disable MySQL Query Cache

I have a high volume MariaDB 10 server thousands of databases of with over a million tables. Currently we are only hitting around 20% query cache hits. We are already employing Memcache and other ...
1
vote
1answer
32 views

ON DELETE CASCADE doesn't work even storage table is InnoDb

I tear my hair with the ON DELETE CASCADE Clause. In fact I have two tables I'm on linux and I have installed lamp with phpmyadmin. That's the tables : CREATE TABLE a( Idatable bigint(20) ...
1
vote
3answers
38 views

Any script to auto test tune and benchmark mysql config?

I'm looking or willing to do a script to benchmark mysql config variations for a specific system. A script that would change certain mysql config values and do a sysbench, save results, change ...
1
vote
2answers
31 views

Redundant MySql Configuration

I'm trying to figure out the best way to configure MySql so that I can have redundancy - so for example - I would have two servers, both through the same host, but at different datacenters in the ...
2
votes
1answer
51 views

Can I avoid a join for my select procedures?

Here is a really simple example of a select procedure I'd like to create, although it's only partly done (it's pretty self-explanatory): delimiter // CREATE PROCEDURE mysql.selectTables (_first_name ...
0
votes
1answer
26 views

Can I load a CSV into a stored procedure that inserts into multiple tables?

OK, an example is often easier to follow, so here is my procedure: delimiter // CREATE PROCEDURE mysql.insertTables (_first_name varchar(30), _last_name varchar(45), _create_time timestamp, ...
-6
votes
1answer
30 views

SQL Simple Question [closed]

This looks correct to me, however I receive a table where figures exceed $40.0?