MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
4 views

SQL: Refer to renamed columns in WHERE clause

SELECT name, gdp/population as capita FROM world w1 WHERE continent = 'Europe' AND capita > (SELECT gdp/population FROM world WHERE name = 'United Kingdom'); How come I can't refer to ...
0
votes
0answers
16 views

create table from another table

I have master categories table like this category_id category_name parent_name parent_id 1 animals & pet supplies null 0 2 ...
0
votes
0answers
5 views

How to calculate sum of a column in a table accessed with multiple joins and where condition

I am unable to find correct sum of vaccinated based on campaign id. no matter which campaign I choose to get sum of vaccinated on the basis of that campaign id it always returns the same data. Please ...
0
votes
1answer
8 views

best way to store tags

I'm a university student building a web application for a project with three collegues , I took the database portion. Our site is basically a link sharing site and supports tags, what is an efficient ...
0
votes
1answer
12 views

Fetch data from second table based on first table

I'm new to the world of databases and I've just started making my first DB powered site with php and MySQL. I've got it working with data from one table but now I need to get a url to the users ...
0
votes
0answers
8 views

indexable JSON datatype in MySQL/MariaDB

In PostgreSQL 9.4 there is a JSONB datatype which allows you to index on fields in the stored JSON objects. Does MySQL/MariaDB have an equivalent? I'm specifically interested in the MariaDB Galera ...
0
votes
1answer
27 views

Why people often said nosql has better write performance than sql? [on hold]

I have been hearing these comments all around the internet. But I cannot see a good justification for it. Agree that nosql use de-normalized scheme to store data, which does not require join (for ...
1
vote
1answer
7 views

MySQL 5.6 upgrade - reducing code changes / developer burden

Does anyone know the key things that should be done when moving to MySQL 5.6 to reduce the amount of code changes required? I found that new installations of it have STRICT_TRANS_TABLES set for ...
-1
votes
0answers
28 views

MySQL - Combining multiple rows as one in one table [duplicate]

I have one table employeeId | attribute | value 1 name John Doe 1 email john@example.com 1 age 28 2 name Jane Doe 2 ...
1
vote
0answers
14 views

(VS Comm./VB6) How to Select from 2 different data sources/formats in one query?

I have two working TableAdapterQueries in my project, one selects from a MySQL database on a virtual server I own, the other is an Oracle PL/SQL database on a separate server. The data (and ...
0
votes
0answers
8 views

How to get line that causes error when loading from csv to MySQL

I'm trying to load data from CSV file, but occurs error Error Code: 1366. Incorrect integer value: 'abcdxxx' for column 'col' at row 123545. I Have file with multiple breaklines CRLF's in content, ...
1
vote
1answer
13 views

Running Total: To store or compute

Say I have a product table with the following columns: product -------- product_id name And I have another table to record the transaction (IN/OUT) for each product product_transaction ...
0
votes
1answer
18 views

Are certain environment variables required for mysql login-path?

I created a bash script that backs up my database, db_backup.sh It basically just runs these commands: DB=/home/linuxuser/backups/backupfilename.sql.gz mysqldump --login-path=local db_name | gzip ...
-1
votes
0answers
23 views

Avoid order by clause [on hold]

After migrating some code from Informix to MySQL, we saw that: On Informix when you issue a SELECT UNIQUE query, the result set that it returns its always sorted. However, on MySQL if you issue a ...
0
votes
1answer
30 views

MySQL InnoDB 5.6.23 cannot start segmentation fault 11

I have a Linux Gentoo server which has OwnCloud application installed. It works for about 2 months with out any problems, and sudden this morning MySQL died. I have tried to restart mysql server and ...
0
votes
0answers
10 views

MySQL: Hierarchical query to get the direct and indirect child

I am just trying to modify the code as in MySQL: Tree-Hierarchical query to get values inside single quotes and seems like the system hangs. Not sure where I am going wrong.. Here is the code. BEGIN ...
1
vote
1answer
42 views

Lock in mysql database

My schema 'test' has 3 tables: 'user', 'post' and 'revision'. CREATE TABLE IF NOT EXISTS `test`.`user` ( `iduser` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(45) NOT NULL, PRIMARY KEY ...
-4
votes
0answers
8 views

phpmyadmin csv ms excel export with results different than phpmyadmin [on hold]

I'm trying to export a CSV file but the file is different than the results shown in phpMyAdmin interface. I think that it could be a phpmyadmin bug.
0
votes
1answer
25 views

Query calculating AVG per minute GROUP BY timestamp

I'm trying to query the average for each minute, so I can generate graph per 5, 15, 30 minutes. Here is my table, date stored in MySQL DateTime data type field. timestamp vif_2_rx ...
2
votes
1answer
23 views

MySQL stored procedure user privilege

I have a query regarding user permission on a stored procedure. If a user that does not have permissions to create tables in a database, but it does have permissions to create and execute stored ...
0
votes
1answer
16 views

Not all MySQL processes are killed when restarting

We have a MySQL 5.6 server running on Ubuntu 12.04 using the MySQL 5.6 PPA. The service comes up fine when rebooting the box, but whenever we restart the MySQL process via /etc/init.d/mysql restart, ...
0
votes
1answer
11 views

merge multiple fields of csv file while running mysqlimport command

I have a mysql table like this +----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | ...
0
votes
1answer
19 views

Mysql: How does circular replication avoid infinite looping of a transaction

In case of circular replication A -> B -> C -> A. How come a transaction started on A will be ignored from being replicated from C to A at the end of one complete cycle ? I believe parent server-id ...
0
votes
1answer
20 views

Optimization for aggregation and grouping with MySQL

I have an application that is pulling data on a daily basis from numerous APIs, storing it and then presenting it on the front end in various charts, tables, etc.. I'm having some issues avoiding ...
0
votes
1answer
17 views

Mysql: binary log vs transaction log

In mysql with innodb, there are two types of logs: binary log and transaction log. I know transaction log is specific to innodb. But when comes to replication, backup and crash recover, what roles ...
0
votes
0answers
7 views

MySQL ODBC Mirror/Failover

I am wondering if it is possible with the Windows MySQL ODBC driver to mirror the data writing on a local (Access) database or, at least, to write on the local database if the writing on the remote ...
0
votes
0answers
31 views

What happens when a mysql connection gets lost?

I hope this is a question for the dba board. Otherwise blame me and i'll switch to unix. imagine the following situation: you have a Mysql server S and two clients A and B. Both clients connect to S ...
0
votes
0answers
12 views

Foreign keys in MySQL Workbench

I am defining an EER model in MySQL Workbench. I have a library with multiple copies of each book and each book has its location in the library listed in the system. When I'm creating one-to-many ...
0
votes
0answers
12 views

Normalization and multivalued attributes

I am designing a relational database in mySQL - a library management system. I want to show examples of the data in 1NF, 2NF, 3NF, BCNF, etc. My example of 1NF looks something like this 'A relation ...
0
votes
1answer
30 views

MySQL: check max chracter length (ERROR 1118 (42000): Row size too large)

I'm trying to convert/copy MyISAM to InnoDB table and I'm getting the following error message: mysql> INSERT INTO test.innodb_table SELECT * FROM test.myisam_table ERROR 1118 (42000): Row size ...
0
votes
1answer
22 views

Exclude entries from SELECT COUNT

I'm new to MySQL and I have a problem with one task. I have a table like this: +------------+------------+-------------+ | code | name | location | ...
1
vote
1answer
14 views

Data normalization (from 0NF to 1NF)

I am designing a relational database in mySQL - a library management system. I want to show examples of the data in 1NF, 2NF, 3NF, BCNF, etc. My example of 1NF looks something like this "A relation ...
0
votes
0answers
9 views

problems with database replication mysql_config_editor

I would like to share with you the problem I have been having for almost a week. I am trying to create a replication between 2 servers. One is in hostgator and the other is a virual machine in Azure. ...
0
votes
0answers
14 views

Mysql 5.0 and 5.6 INSERT_LAST_ID() difference

Migrating from MySQL 5.0 to 5.6 i noticed that the INSERT_LAST_ID() function behaves different when using inside a trigger. My simplified situation: Table A has the trigger: insert into table_B ...
1
vote
2answers
24 views

MySQL Error when importing CSV with empty fields

I have CSV file with exported table, that has rows with fields that do not contain values. Columns are separated using "," and if fields have no values they look like that: ,,,,,, I tried to load data ...
1
vote
0answers
16 views

Is there any option to import specific databases from all databases dump

Is there any option to import only required databases from a all database back up .
2
votes
2answers
27 views

longtext in select makes query extremely slow, even if not used in where clause and empty result set (MySQL)

As soon as I include a "longtext" type in the select clause, the query times go from 8s to 3min (Amazon RDS t2.small). The longtext isn't used in the where clause, and the result set is empty. See ...
0
votes
1answer
18 views

Can combine five mysql statements into just one statement?

Can I combine all the five statements into just one statement? update mytable set myfield1 = replace(myfield1, '…' ,'-') ; update mytable set myfield1 = replace(myfield1, '‖' ,'|') ; update mytable ...
0
votes
0answers
13 views

how to boost range count query performace [on hold]

I have a table with single column in the table. The query fired will be two numbers and I have to return the count of range. But the query is running very slow. How to increase the performance of this ...
0
votes
1answer
29 views

mysqldump Error 2013

I have a database installed, that I would like to backup in mysql. The problem is mysqldump fails on exporting the 'maia_mail' table # mysqldump -u root -p maia > maia.sql mysqldump: Error ...
0
votes
0answers
8 views

Sensu Check for Long running MySQL Queries. [migrated]

I need to build a test / checker ( ruby, python, bash , your personal pref) that will check for long running queries every few minutes. It will incorporate with sensu, and then alarm if the threshold ...
-1
votes
0answers
9 views

need HA for mysql failover [on hold]

we have mysql prod database in AWS EC2 and we like to implement a full HA solution so we have no downtime and can fail over, can you send me a details solution, much appreciated.
0
votes
0answers
14 views

My.cnf tuning for a MySQL Slave [duplicate]

I have a MySQL Slave (MyISAM) where I only run SELECT statements. I would like to have a standard configuration in order to easily duplicate it on new slaves in the future. Currently the my.cnf is ...
0
votes
0answers
15 views

How to break down a COMMIT transaction?

I suspect the following transaction is blocking a bunch of others in my mysql-5.6.19b.R1 database: ---TRANSACTION 10769842051, ACTIVE (PREPARED) 51 sec flushing log 3 lock struct(s), heap size 360, 1 ...
1
vote
1answer
36 views

Difference beetween mysql 5.5 and 5.6

I have a big performance problem beetwen my local mysql instance and the server. I have this request : DELETE a FROM a LEFT OUTER JOIN ( SELECT MAX(id) as id, `v_id`, `v_statut`, `c_controle`, ...
0
votes
1answer
18 views

mysql query matching multiple elements from a single table

I have this awkward query I'm trying to figure out. Basically it checks a table for matching / non-matching entries (data1, data2). My Table is: CREATE TABLE `test`.`tab1` ( `id` INT UNSIGNED NOT ...
0
votes
0answers
20 views

MySQL: “CREATE DATABASE mydb” command hangs

On my MySQL 5.6 server, when logged in as root, the command CREATE DATABASE hangs. No error message - nothing. The MySQL error log doesn't show anything special neither. What could I look into to ...
0
votes
0answers
20 views

Counting per status group makes query very slow

I have an Intranet system developed that takes in orders and every order item has their own status, i.e. "Printed", "Labelled", "Filed", etc. This query will need to count how many items there are in ...
2
votes
3answers
74 views

get all dates in the current month

i have a query in MySQL which serves me very well by getting all the records within the current month; SELECT date_field,val FROM MY_TABLE WHERE date_field>=(CURDATE()-INTERVAL 1 MONTH); The ...
0
votes
0answers
20 views

Performance hits with MySQL Left Joins and Order By

There are a lot of questions out there regarding this issue, but most answers seem to be very case-specific. I've tried to make this general so it'll help others too. The Issue We have a smallish ...