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
1answer
46 views

Can't start mysql on Ubuntu 14.04

When I try to start sudo service mysql start start: Job failed to start Then I look the /var/log/mysql/error.log 160122 8:43:42 [Warning] Using unique option prefix myisam-recover instead of ...
0
votes
1answer
15 views

Fabric - Operation CREATE USER failed for 'fabric_server'@'%''

I am finding the use of fabric to be tottalyh unstable. Here is what I do and the below is the result: mysqlfabric group add druid 192.34.59.181:3306 mysqlfabric group add druid 192.34.56.66:3306 ...
0
votes
0answers
20 views

mysql returns FUNCTION .LAST_INSERT_ID does not exist

I'm new to MySQL. I have created two tables. create table Shopping( Trans_ID int not null auto_increment primary key, date date, item varchar, quantity double, rate ...
1
vote
1answer
29 views

Count from a count (distinct)

I have a query like this: select * from questions as q left join question_filters as qf on q.id = qf.question_id left join users as u on q.user_id = u.id left join trainers as t on ...
0
votes
0answers
20 views

Phpmyadmin not displaying table data

I have a table named "log", which basically stores error log for my php application. My application has database running on rds, and recently i had to delete logs from this table, so i downloaded a ...
0
votes
1answer
17 views

mixing binlog formats between master and slave

I have a pretty much straightforward Master --> Slave replication setup in MySQL 5.6 / Innodb. Both my Master and Slave are setup in MIXED binlog format. Now I need my slave to act as a master to ...
0
votes
1answer
57 views

Innodb full table Scan

mytable is an InnoDB table with (a, b) as the primary key. Does this query check all table? Select * from mytable where ( b='2' and c='3') I want to find out if 'cluster' structure ...
0
votes
0answers
30 views

Fetching data from 3 tables

Wanna fetch data from 3 tables by mysql query to display in feed. But stack. My query is "SELECT f.leaderId, f.followerId, c.ccId, c.ccTitle, c.ccCity, c.ccCountry, c.ccFlag, c.uId, ...
0
votes
0answers
32 views

How to collect prepared statements in performance_schema on MySQL 5.7

Just installed MySQL 5.7.10 64bit locally (Windows environment) and prepared statements are not being logged in performance_schema. In release notes it's being specified this feature is available ...
-1
votes
1answer
75 views

Group when there are multiple items by a particular user within a certain timeframe [closed]

SELECT * FROM ( SELECT articles.id, articles.author_id, users.username, COUNT(articles.id) AS number_of_articles, GROUP_CONCAT(DISTINCT articles.id) AS articles_published FROM articles ...
1
vote
0answers
38 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 ...
0
votes
2answers
25 views

show variables - Unknown column 'value' in 'where clause'

In mysql I ran the below: mysql> SHOW VARIABLES where variable_name = 'character_set_database'; +------------------------+-------+ | Variable_name | Value | ...
0
votes
0answers
23 views

Mysql partition - How to do list partitioning of a table that contains unique column?

I am doing mysql list partitioning. my table data is as below ---------------------------------------- id | unique_token | city | student_name | ---------------------------------------- 1 | xyz ...
0
votes
1answer
59 views

Restoring MySQL dump ERROR 1449

I took hot backup (dump) from my Master MySQL DB with below command mysqldump -uroot -p --skip-lock-tables --single-transaction --flush-logs --hex-blob --master-data=2 -A > ~/dump.sql ...
0
votes
0answers
26 views

Configuring additional data node

After configuring the data node and the config.ini for the management node. When I run the ndb_mgmd -f /var/lib/mysql-cluster/config.ini --initial The table data that were created for previous ndbd ...
0
votes
0answers
40 views

MySQL performance issue after migration

I have a MySQL performance issue with a brand new server, and am somewhat of a beginner as a database administrator (I'm mostly a general-purpose Linux sysadmin). I'm looking for pointers where to ...
0
votes
1answer
30 views

Fast copy/rename database, not mysqldump

I would like to keep a "default" setup for a database on a testing server, which can be used to "restore" a "dirty" testing database back to the default state. mysqldump is very fast, done in a few ...
1
vote
1answer
40 views

MySQL query taking too long to execute

My MySQL query is taking around 20 minutes to execute which I feel is excessive. SELECT hyp_id,MAX( player_count ) AS MAXPLAYERCOUNT , MAX( viewer_count ) AS MAXVIEWERCOUNT , SUM( player_count ...
0
votes
0answers
30 views

Cannot restart mysql (installed natively) but possibly caused by a Homebrew package

I've previously been running mySql which I had installed with the dmg files without any issues, but I also have Homebrew installed and noticed some errors today which I fixed successfully but ...
0
votes
0answers
25 views

Dynamic columns or many columns? [duplicate]

I am using MySQL and I am trying to figure out how best to store my dynamic data I get from my application so it can easily be transformed into a single row for reporting purposes. My current ...
1
vote
3answers
39 views

MySQL Slave database size >> Master Database

I have a Percona MySQL Master-Master setup (5.6) with second master as passive master(read-only). Slave: mysql> SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / ...
-1
votes
2answers
36 views

MySQL: Why is ibdata file growing? How can we shrink it?

Even though we are using "innodb_file_per_table = 1" from day one. The ibdata file still continues to grow. Total size of our database is around 800GB and the ibdata file is currently around 50GB. All ...
2
votes
1answer
54 views

SQL Query for Internal Messaging System

I'm creating an internal messaging system (No SMTP/POP3) and I'm looking for a way to query a user's list of messages. Here's my schema: Messages _MessageID (PK) _MessageParentID (if a reply this ...
0
votes
1answer
29 views

Why running queries one by one yields correct results, but running lots of them in one chunk doesn't?

Let's say I create a simple table and a stored function to populate it: CREATE TABLE t ( id INT PRIMARY KEY, val VARCHAR(255) )// CREATE FUNCTION populateIfNotAlreadyIn (idArg INT, valArg ...
-1
votes
1answer
24 views

How to execute system command in mysql stored procedure? [closed]

Here is the code, delimiter // create procedure trig () begin declare cmd varchar(50); set cmd = "sh /home/yogaraj/Documents/Maastry/firefox.sh"; system cmd; end // delimiter ; But I ...
0
votes
1answer
40 views

Left Join Not returning rows when date is in range of longer than 1 day

How do I left join Table A and B? SELECT dev_hour.hour,rtdogs.delivery_date,rtdogs.delivery_hour,rtdogs.total_offer FROM ( SELECT hour FROM ( SELECT * FROM delivery_hour ) xx ...
0
votes
1answer
25 views

How to clean up tables that don't belong into mysql/mysql database?

It seems that a *.sql file I recently imported had use mysql instead of use dbname. Now the mysql database contains a large number of tables which don't belong there. Is there an easy/efficient way ...
0
votes
1answer
30 views

MariaDB ignores binlog_format

I'm trying to make moodle work on my system, so i need to change bin_log format to MIXED or ROW. But, i'm having a lot of problems doing that. Any changes i try to do don't work; MariaDB ...
0
votes
0answers
25 views

Copy data from one table to another

I have a table named cameraInfo and another named macTable. Both tables have a column for mac address and password. Not all the mac address in macTable are in the cameraInfo table. However, if the mac ...
0
votes
1answer
22 views

MySQL connection timeouts

Apparently, a former DB administrator configured our main DB server (located in germany) so that only from certain IPs would be accessable. Now we just added a new host (which needs to access that ...
0
votes
3answers
30 views

Encrypt and keep sensitive data in MySQL

I have a process that parses a JSON API and loads the data into MySQL database. I have some sensitive data that should be encrypted, such as firstname, lastname, email, zip, address, credit card ...
0
votes
1answer
76 views

How do I write this query?

I have a table that looks like this: CREATE TABLE `message` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(10) unsigned NOT NULL, `grp_id` int(10) unsigned NOT NULL, ...
1
vote
1answer
48 views

Displaying Distinct Max Value autonumber rows from tables in MySql [duplicate]

i am trying to execute the distinct records from mysql table having max value of it sno column. I have tried the following query but having no luck. SELECT DISTINCT p.sno AS sno, ...
0
votes
1answer
20 views

6 datacenters running the same mysql database, replication layout design question

So each of the datacenters is around the conus. The Master slave replication route seems like my best option here. I have never done this with more then 1 slave and 1 master. Advice? Links? The ...
0
votes
0answers
24 views

Error Code: 1098. Can't generate a unique log-filename /data/mysql-binlog/relay-bin.(1-999)

After starting MySQL 5.5 I receive the error message: Error Code: 1098. Can't generate a unique log-filename /data/mysql-binlog/relay-bin.(1-999) Can anyone point me out what the problem is? The ...
0
votes
0answers
38 views

Column Editing is Disabled. How to Enable?

I am using MySQL Workbench, in order to design an ERD (Entity Relation Diagram). I can make use of indexes, triggers, etc. but for some reason the columns tab, which allows me to add data or just ...
0
votes
1answer
31 views

Mysql multi-master active-active replication : replication doesn't happen for all slaves

so i created a multi-master replication with bellow servers two for master and two for slave. hostname : master-1 ip : 192.168.120.107 hostname : master-2 ip : 192.168.120.111 hostname : slave-1 ip ...
0
votes
0answers
42 views

Configuring MySQL Cluster

I'm having trouble in configuring my data nodes. My setup is 1 management node, 1 SQL node and 2 data nodes. I'm running mysql-cluster-gpl-7.4.8-linux-glibc2.5-x86_64 on my cluster. My question is do ...
0
votes
1answer
91 views

MySQL server experiences periodic down time for 1 to 2 minutes

When under constant load, my MySQL server experiences periodic down times which last between 1 and 2 minutes and have no apparent causes such as too many connections or CPU overload. By down time I ...
0
votes
2answers
35 views

What is making MySQL stay in strict mode

New Mac El Capitan 10.11.2 mysql-5.7.10-osx10.10-x86_64.dmg I have to work with a database that has default dates "0000-00-00" but MySQL is in strict mode and chokes on them. I can't find a way to ...
2
votes
1answer
40 views

Why might a query not run until after I restart the MySQL server?

Why might MySQL not execute a query? Why might it freeze? It simply sits there and does nothing. Show processlist gives a result of "sending data" for as many hours as it takes for me to give up and ...
0
votes
1answer
21 views

Restoring a MySQL database to a failed master

I have a master-master configuration in MySQL with two servers. One server should stay live on the network to serve requests (call it server A) and the other should be taken offline to push new code ...
3
votes
1answer
76 views

mysql custom query logging for inter-software data exchange

Some 2-3 years I had written some triggers (one per table) in SQL server allowing me to log queries in our main software. ALTER TRIGGER [dbo].[SUIVI_REQUETE_CAT_CATBRUT] ON [dbo].[CAT_CATBRUT] AFTER ...
1
vote
1answer
66 views

Innodb composite primary key with 4 columns vs MyIsam

I've created "MY TABLE" based on Innodb with composite primary key because I am storing many trees inside this table. The PK is for example (a,b,c,d). 1- Does Innodb store rows with same (a,b,c) near ...
4
votes
1answer
56 views

Pull more records based on IDs in comma separated list returned by GROUP_CONCAT [duplicate]

Is it possible to pull more records based on IDs in comma separated list return by GROUP_CONCAT? Is a LEFT JOIN possible here? If so, how can it be done. I am constantly failing at figuring this out, ...
1
vote
1answer
20 views

How to automatically backup a MySQL/Amazon RDS database?

I would like to get automatically MySQL backups to sync them to another provider as secondary backup. The RDS Snapshots itself are not useful in this case because the are "hidden" in AWS and can only ...
-1
votes
0answers
41 views

insert performance of Mysql InnoDB vs Mongodb

I often heared that Mongodb has a better performance than mysql while mysql has more consistence than Mongodb. Then I did a experiment using the following python code based on MySQL-python and ...
0
votes
1answer
13 views

SQL design for hierarchical structure where parent unit should not exist without subunits [closed]

I'm new to SQL so I wasn't sure what to even search for this besides looking at hierarchical structures which don't seem to be exactly my use case. I'm building an app where a Post contains multiple ...
0
votes
1answer
31 views

MySQL Trigger to Update a Row in a Separate Table via Joins if Only One Row is Updated

I am trying to create a trigger so that when a column in a table called bookings is updated it will update a a calculated price value in table departments. I currently have my tables set up as so ...
2
votes
2answers
55 views

Multi level hierarchy relationship

My table design is users (id, username..., parent_id) Data is id username parent_id ------------------------------- 1 | admin | null 2 | reseller 1 | 1 3 | client 1 | 1 4 ...