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
3 views

Writing SQL query for scenario

I am trying to develope a shopping application. I need to write a query for the following table structures : enter image description here GRPMT : This contains the master group of Items(like ...
0
votes
0answers
5 views

How do I do a join and exclude certain records?

Table STUDENT has columns ID, LASTNAME, FIRSTNAME Table TEACHER has columns ID, TEACHER_ID, STUDENT_ID Students can have many teachers. Teachers can add students to their class. I want to be able ...
0
votes
0answers
12 views

how to desing a database for loan management in mysql

I am not very well experienced in database design . I designed database tables for user and account information `but in case of designing table for loan management and fixed deposits.` I want to ...
1
vote
1answer
13 views

mysql - search between dates where all dates appear

search between house dates where all dates appear in a range of 2 dates (startDate, finalDate) database: mysql. tables columns are: house_id, date, status. house_id + date are unique the closest I ...
0
votes
0answers
8 views

How do Locks Work in MySQL [on hold]

There is a case which makes me a bit confused. As far as I understand deadlocks should appear if there are two query statements (including subqueries) in request (each transaction). So the ordering of ...
0
votes
0answers
16 views

Transaction Identifier - possible with MySQL?

I have quite complex code, which at the beginning starts transaction. After that several user queries are performed (more or less without my control) and at the end the transaction is committed if ...
3
votes
0answers
9 views

insufficient history for index

In MySql log, there is one error `InnoDB: insufficient history for index 0' I don't know why its occur. I have done google and found following ...
0
votes
0answers
12 views

Error: “mod_fcgid: can't apply process slot for” makes my server unresponsive for a period of time

Following error keeps appearing in my PHP error_log mod_fcgid: can't apply process slot for So far I pinpointed this issue to following settings in httpd.conf FcgidMaxProcessesPerClass 8 ...
0
votes
0answers
21 views

MySQL count multiple values in one column by PHP [migrated]

This my data in Column interested (Education; Job) I use this code: $sql3="SELECT interested, COUNT(*) as Education FROM register GROUP BY interested"; if ($result3=mysqli_query($con,$sql3)) { ...
-2
votes
0answers
16 views

My login page is returning Unknown column 'sitlanic' in 'where clause'

My login page is returning: Unknown column 'sitlanic' in 'where clause' $uname = $_POST['name']; $pass=$_POST['b']; $sql="select*from names where username=$uname and password=$pass"; ...
0
votes
0answers
20 views

mysql processes still alive from processlist

I have already posted this on stackoverflow, but I got no answer: mysql processes still alive from processlist I have this in my my.cnf: wait_timeout=1800 interactive_timeout=1800 ...
1
vote
1answer
46 views

Insert data from multiple rows into multiple columns

Cannot find, after much searching, how this would be done. My web searches get Pivots and Concats and Cases and Subqueries etc, none of it is quite solving the issue for me. The ...
-2
votes
0answers
30 views

How do we convert SQL Server query to MYSQL? [on hold]

How do we implement this SQL Server syntax: IF(SELECT MAX(DateAdded) FROM RestoreDetectors " + " WHERE CONVERT(VARCHAR,DateAdded,101) = CONVERT(VARCHAR,GETDATE(), 101) " + " AND DATEDIFF(SECOND, ...
1
vote
1answer
20 views

SELECT command denied to user ''@'localhost' for table 'pma_table_uiprefs'

I have got this error message in Vesta Control Panel, in phpMyAdmin: SELECT command denied to user ''@'localhost' for table 'pma_table_uiprefs' SELECT `prefs` FROM `phpmyadmin`.`pma_table_uiprefs` ...
0
votes
1answer
29 views

MySQL - Many to Many Join. Left Join already Present

I am building a Attendance System for a Client and have become a tad stuck with JOIN's. I already have a left JOIN running, and want to add a JOIN on a many-to-many relationship but can't get my head ...
1
vote
0answers
31 views

Memory Table and Disk Table

I'm running a pretty big (or maybe I should call it SELECT-intensive) database. Now I've heard here and there that a MEMORY-based table is better for my situation (since I now run on a RAID1 HDD ...
0
votes
0answers
20 views

Retrieving most recent X rows for each given user from a table

We've got a seemingly simple query that's running extremely slowly, but I can't quite figure out the best solution to the problem. The scenario is as follows. We have an inbox table, which has the ...
3
votes
1answer
72 views

How to show rows with 0 without any records in database

I have a lot of record in my database and for data analysis, I need to show count of records for each day including days when I do not have any record, so result is 0. For example I have these ...
0
votes
0answers
21 views

Store massive values data from remote controllers

I implemented telemetry system in order to observe state of remote objects. Every object has a controller collecting data from some sensors (about 10-30 controlled parameters, lets take average value ...
1
vote
1answer
32 views

Create MySQL trigger that updates position of each row when sorted by a specific field

Let's see an example, I've got this table that contains teams, each of them having a certain number of points: CREATE TABLE teams ( id INT(11) NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, ...
2
votes
0answers
49 views

Improve performance of query with multiple group by column and count function in select

Brief Background of issue We have a aggregate table to store activities of competitors and this table have currently 3 Million activities and we need to retrieve data from this table group by ...
1
vote
1answer
34 views

Maximum possible memory usage over 100%

During these days I experienced several problems (delay and failed restart) on my database MySQL, so I tried with some help here around (and using Percona service too) to optimize my /etc/mysql/my.cnf ...
0
votes
0answers
5 views

What are the advantages of Packet Inspection and SHOW FULL PROCESSLIST over PERFORMANCE_SCHEMA?

We have several MySQL Servers (v 5.1) scattered across different geo locations. We are considering upgrading to the latest MySQL version as we heard a lot of good things about PERFORMANCE_SCHEMA ...
0
votes
4answers
72 views

Avoid using Many to Many Relationship

I have a 3 tables, Employee, Languages, Employee Languages. Now, Employee table is a profile table. Nothing special(Id, first name, last name etc.). Languages table has two columns: Language ID ...
0
votes
0answers
10 views

How to get (category specific) rank for all items (regardless of specific category) in one query?

I am attempting to use one query to get each servers rank based on the game that it is associated to, for all servers (regardless of which game they're associated to). However, I'm struggling to ...
0
votes
3answers
27 views

Getting error while starting mysql by just typing in mysql terminal

I am getting an error while starting mysql, by just typing mysql in the terminal: The error is: amtz@amtz-VPCEA23EN:~$ mysql ERROR 1045 (28000): Access denied for user 'amtz'@'localhost' (using ...
1
vote
1answer
24 views

Does innodb_buffer_pool_size accept “*GB” values?

I thinks innodb_buffer_pool_size is specified in bytes, would typing in values with unit (i.e 1024MB or 1GB) work? Has anyone already tried this? Specs: MySQL 5.6
1
vote
1answer
25 views

Taking load off the Master server by using a slave

My gameserver utilizes a Master and a slave on one server. The reason I am wanting to use a slave is because I want to beable to run select queries (read only) to get data without affecting the Master ...
0
votes
1answer
25 views

Every “INSERT” query check a combination of column's records

Unfortunately, my mind has stacked right now and i would like to design a really simple DB schema. What i want? In a simple table, for instance Table1, there are two different columns, Series and ...
0
votes
0answers
15 views

Problem connecting to MySQL using Ruby on rails

I'm using the MySQL command line tool, and I can successfully log into my root user. However, when I have created a new user, I can't log on with the command tool, but it works fine in the MySQL ...
0
votes
0answers
28 views

Sql multiple table checks for polling

I am implementing long polling using mysql for a near realtime data update for clients. Currently, this is what I have (and it works): A messages table, that holds messages between users,there is a ...
0
votes
0answers
28 views

MySql master stopped writing to binlogs when tmp partition full

Percona MySql version is : mysql Ver 14.14 Distrib 5.5.46-37.5, for debian-linux-gnu (x86_64) using readline 5.1 OS Version is : Debian 7.9 MySql master has a separate tmp partition, of ...
0
votes
0answers
10 views

In Database administration is there any proven advantages in using/choosing a MySQL IDE over another? [on hold]

Would it really matter if I would choose a MySQL IDE between Workbench, HeidiSQL or SQLYog? Does there any difference between how these IDE's has been implemented?
0
votes
0answers
9 views

how to change relay log fie name on “Adding Slaves to a Replication Environment”?

MySQL document advised that "new slave relay log file name " should followed the "old slave relay log file name" to avoid this problem, use the same value for --relay-log on the new slave that was ...
2
votes
2answers
58 views

Creating calculated column

I want to create a rating weight and I need do calculate AVG, then find COUNT and multiply both to get weight. I have something like that: SELECT post_id, COUNT(CASE WHEN vote > 0 THEN vote ELSE ...
0
votes
0answers
29 views

How to add a trigger on table create in Mysql

I want to apply a trigger on all tables if my database. I already created a script in PHP which will add triggers in all existing tables. But if any new tables are added in database, I have to run ...
0
votes
1answer
25 views

Could I set my InnoDB MySQL Server session state for SQL_SAFE_UPDATES and INNODB_FLUSH_LOG_AT_TRX_COMMIT?

Could I set my InnoDB MySQL Server session state for SQL_SAFE_UPDATES and INNODB_FLUSH_LOG_AT_TRX_COMMIT using MySQL Workbench's SQL Query window or MySQL Connection Navigator instead of in a c# ...
1
vote
1answer
49 views

Between optimizing a 1-billion rows table and dump-restoring it, which would be faster?

Have multiple tables which had more than 1 billion rows. Archived and deleted many of them, now want to recover the disk space. Have option to either optimize the table, or dump the table and restore ...
4
votes
1answer
17 views

Checking for fields not on SET clause on before update trigger on MySQL

I want to set a before update trigger that sets a column to a given value if an update query is done and that column has no new value on the set clause. The table I'm using. (Sort of) DROP TABLE IF ...
0
votes
0answers
29 views

MySQL Errror “Cannot Connect Invalid Settings”

I was working with mysql using phpmyadmin on a local server and when I clicked on a table it took a very long time to do anything so I let it do its thing, I walked away and when I came back I had the ...
0
votes
0answers
8 views

mysqlworkbench nasty result grid with text columns

On MySQL Workbench 6.3, when you query a table with text columns that have carrier return \n in it, the Result Grid expands record's height accordingly. In the image, I've reduced the height of the ...
1
vote
2answers
27 views

Interested in counting number of threshold crossings

I would like to determine the number of times that a value has crossed a threshold in either direction in a specified time frame. As an example, lets say that I am interested in the number of times ...
0
votes
2answers
32 views

Spanish characters saved incorrect in Mysql

I have googled this already, but I couldn't find what's wrong in my situation. I have a wordpress site that has a lot of non-english users which type in words such as "español" it is printed ...
1
vote
0answers
46 views

Is there a way to throttle MySQL requests to mitigate DoS traffic?

I've a server with ~200 wordpress websites hosted. When Google Favicon bot pays us a visit it searches all the sites indexed on our IP, that means it's requesting ~200 favicons. Most of the sites ...
1
vote
1answer
38 views

Mixed based replication between two databases on the same server

I have two apps with a current configuration as follows: App1 DB on server A/MySQL Instance A App2 DB on server B/MySQL Instance B Students can apply for internship using App1 and those ...
1
vote
0answers
53 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
1answer
40 views

MySQL Database Instance size

We found 3 different size of a MySQL Database Instance as follows: Mysqldump output Data directory size (even if we exclude size of bin-logs,error-logs) SUM (data_length + index_length ) ...
3
votes
1answer
31 views

Passing multiple value for a parameter in my sql

I have written the query below: SET @City = 'London,Lyon,Kln'; SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(@City, ',',@r:=@r+1),',',-1) City FROM (SELECT @r:=0) x, (SELECT 'x' xx UNION SELECT ...
1
vote
1answer
39 views

Does varchar(n) affect the number of records which can be stored per page even if you store less than n?

I'm struggling to find enough documentation to help me answer my own question. The common story seems to be that it doesn't make a difference to actual database size when you use a much higher value ...
0
votes
2answers
26 views

ulimit 'open files' and MySQL max_connection

When running mysql on SSD, does max_connections, if set more than the kernel's ulimit open files, be limited to the kernel's limit? My understanding is that if the kernel's ulimit open files is 1024 ...