MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
5 views

Select from two tables with not direct relationship

OK i found myself in a dead end, and i know must be a way but my brain is just about to explode. This is the case: I have two tables with tons of rows, one for works done (lets call it works table), ...
0
votes
0answers
8 views

Broken foreign keys on MySQLWorkbench forward engineered db. Table creation order matters?

I recently generated a forward engineered database script in MySQLWorkbench. The script wouldn't run, and by pasting chunks in the shell interpreter, I determined that a particular table was causing ...
0
votes
1answer
14 views

Footer with counter of records, using union of query

I have a report that has a header (display the current date), I use UNION to join the header with the main query that returns multiple records, it has 10 columns. After that another UNION for joining ...
0
votes
1answer
10 views

Will coloum size change when trying to use single unicode character in place of multiple ASCII characters?

I have a column in utf8_unicode_ci collation for text type in MySQL. The content is in Unicode, I have used tags like {br}, {v}, {t}, {h} etc.., throught the database. I am now thinking of changing ...
0
votes
1answer
16 views

Add linked server from SQL-Server to MySQL: “Data source name not found” (Error:7303)

I'm trying to link my SQL-Server 2005 on Windows Server 2008 R2 with MySQL 5.5.40 on a different computer. I have followed this guide: ...
0
votes
2answers
39 views

SQL Multiple JOINS Interpretation order [on hold]

I have a big problem of using multiple joins in one SQL Statement. For example i have 10 Tables which they are tbl1,tbl2, tbl3,..,tbl10. I would like to select some columns from each table from tbl1 ...
0
votes
1answer
30 views

Combine two updates [on hold]

I want to combine the following SQL statements into one: Update ENGROYLIB/UCOMPFL Set AddrLn1 = 'ELECTRIC LIGHTING STATION,', AddrLn2 ...
1
vote
1answer
16 views

Purge mysql log bins older than two weeks automatically

I have to manually write purge binary logs bin to "mysql-bin.somenumbers" ; Once in a while, I need to reduce the spaces that binlogs are taking on my web server. Is it possible to purge binary ...
0
votes
2answers
30 views

How to select the largest value of the same column in multiple tables?

I have multiple tables which have some columns with the same meaning, eg., event_timestamp. The schemas are like following: Table A: ...
1
vote
1answer
18 views

#2014 - Commands out of sync. you can't run this command now. Query was working before. But now it is not working

My table structure is ... There is Counter which has many Box in it. Box has a one BoxType. and Collection stores Box datewise revenue and data. I need data of particular 1 COUNTER (Data of All the ...
0
votes
2answers
30 views

import csv file into mysql with custom data change

I have a .csv file contains data like this: Username Password Email test123 123 test@foobar.com I'm currently using MySQL, and I have a table named user with some columns like this: ...
0
votes
1answer
16 views

Calculations involving thresholds between two tables

I have a table comment and a table price like below. The key columns in both tables are ticker_id, price_datetime and price_open. The last column threshold in table comment (which currently NULL) is ...
1
vote
1answer
35 views

Cannot add a column to an InnoDB table in Mariadb

I have this InnoDB table with less than 10 rows in mysql 5.5.40-MariaDB on Linux (x86_64). +-----------------+--------------+------+-----+-------------------+----------------+ | Field | ...
0
votes
1answer
8 views

Joining WordPress Comments with Post Titles from MySQL DB

I'm working with a wordpress database and need to get some data on the comments. The goal is to get comments from a decommissioned site. I have the database running on my local system and can ...
0
votes
1answer
23 views

Advisable number of foreign keys in a single table [on hold]

I was wondering, keeping performance and optimizations in mind, while designing the database, is there any advisable number of foreign keys you should keep in a single table? At present, few of my ...
0
votes
0answers
12 views

MySQL TRIGGER with test on minute datetime [on hold]

I try to create a TRIGGER on MySQL 5.6. In this TRIGGER, I test if the minute of my Date is equal to 0, 15, 30 OR 45. So I test this : IF (MINUTE(NEW.tb_date) IN (0, 15, 30, 45)) THEN ...; END ...
0
votes
1answer
45 views

Is making joins between different table spaces slower?

In MySQL and PostgreSQL, is making joins between different tablespaces inherently slower, compared to joining tables in the same tablespace?
-1
votes
0answers
23 views

query explain saidd row is a few but it took an hour to load [on hold]

i have a query down here select if ( month(td.date) = month('2011-01-01') and year(td.date) = year('2011-01-01') and month(td.date) = month('2011-01-02') ...
-1
votes
0answers
8 views

Access denied for user to database 'mysql' in amazon RDS [on hold]

I am trying to restore the 'Mysql' database of my master in the DR and i am facing access denied issue. I have also tried to restore only user table with no luck. Tried searching google but dont see ...
0
votes
1answer
12 views

On not public server: Host name example.com could not be resolved: Name or service not known

This is not a duplicate (please read carefully) Digging in mysql logs of a production server I found a few entries with the error above, all pointing to the same host name. Each entry appears ~30 ...
0
votes
2answers
18 views

Mysql join not working

I have database with two tables: logs & src_info mysql> describe logs; +-----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | ...
0
votes
0answers
10 views

Mariadb on Centos 7 not changing max connections based on my.cnf

The following configuration in my.cnf is not being followed. Max_connections go back to 151. please help as i have 16gb of dedicated ram that i would like to use properly. [mysqld] ...
1
vote
0answers
18 views

mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect [duplicate]

I am troubleshooting a backup script (bash), and I have limited working knowledge of the current configuration since the last 3 predecessors did not leave any documentation. I do know that my server ...
1
vote
1answer
32 views

MySQL Data Files Missing?

We are upgrading our website and I was checking on the size of the new database compared to the old one and was really surprised to find that in the /var/lib/mysql/ directory, the only files there ...
0
votes
1answer
15 views

Can a trasaction be rolled back if a table is edited outside a transaction?

I am learning how transactions work using this short script CREATE TABLE t_test (id INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; START TRANSACTION; INSERT INTO t_test VALUES (1); SELECT * FROM ...
0
votes
1answer
23 views

Mysql daemon failed to start: unknown variable password=xxx

Mysqld don't restart anymore...In the log, the apparently obvious reason: mysqld started [Warning] Ignoring user change to 'root' because the user was set to 'mysql' earlier on the command line ...
0
votes
0answers
5 views

How to display multiple row records of similar ID's in single row?

I have two tables user and work. Work table has multiple user's work experience.I have to retrieve most recent 2 companies on the basis of start date. Conditions : 1.If Work Table has multiple ...
1
vote
1answer
25 views

Is it possible to pick next row's cell value on same column if condition not matched?

I have a table flaggedcomment and a table price. In flaggedcomment, there are two empty columns Price_DateTime and Price_Open which I want to copy from price, depending on the ON conditions. Query as ...
1
vote
1answer
39 views

UPDATE/INSERT into Dynamic Columns

I am trying to update columns based on the value of the inserted column of the table 'my_table'. I want to be able to record the timestamp of the values changed. I am using the triggers but I can't ...
1
vote
1answer
9 views

Mysql Master-Slave replication catchup and bin_logs

I have set up MYSql Replication using 2x 128gig ram 24 core cloud servers. we have a massive live database that cannot experience down time due to the high volume of data input. I have found while ...
0
votes
0answers
16 views

MySQL : How to know if Trigger was fired

Someone can help me please , I want to log error about triggers in MySQL 5.5 I'll like to know if it's possible to know if a trigger was'nt fired ?
0
votes
0answers
11 views

Did this trigger break replication?

I added a trigger to a replicated database. DELIMITER $$ USE `database`$$ DROP TRIGGER /*!50032 IF EXISTS */ `some_ins_after`$$ CREATE /*!50017 DEFINER = 'user'@'%' */ TRIGGER ...
1
vote
0answers
10 views

How to set the trigger when field(contain json value) is updated?

I have one table in which there is one field called info.This field hold json value. I want to create trigger on this field.I want to split this json format string into record I mean I want to insert ...
0
votes
0answers
16 views

MySQL Script to automate creation of audit (history) tables and triggers?

For regulatory and fraud requirements, we need to record every change to most of the tables in the DB. The way we did this very successfully with a previous project is to have a copy of each table, ...
1
vote
2answers
26 views

MySQL 5.7 - Where is the mysql_secret file on Windows 7?

I've just installed a copy of MySQL 5.7 for testing, and I love the fact that it now only creates a single root account, and puts the password into a file called .mysql_secret. There's just one ...
-2
votes
0answers
24 views

Databases is not valid [on hold]

I am getting this error: One or more selected databases is not valid , how do I resolve this error.
0
votes
0answers
13 views

Manage orders based off product attributes and quantity

I'm developing a database for an online store in which the Products have multiple attributes and attribute types. ATRIBUTES TYPES atrtype_id name (like size, color...) ATRIBUTES atribute_id ...
-1
votes
0answers
13 views

ID That Will Never Be Used

I'm writing some tests for a Django application and in these tests I need to provide an ID for the view in question. I also need to test for an ID that is not in the DB. At the moment I am using ...
0
votes
1answer
18 views

Mysql query hangs on import

I dumped all my databases in order to import them into a slave. mysqldump --all-databases > dump.sql The import seems to be very very slow. Checking the processlist, I saw a simple insert on a ...
0
votes
0answers
34 views

Can an index be added to a PRIMARY with a null key?

I have a query that takes a long time to return, roughly 12-15 seconds, which I'd like to optimize. The query below is the result of running the original query with SHOW WARNINGS. If I run EXPLAIN ...
1
vote
1answer
29 views

MySQL Count where all conditions evaluate to 1

What is the best way to get count for all the records, where case evaluates to one for all the conditions. I have the query as: SELECT uuid , COUNT( CASE WHEN (( dt = 1 or level0 = ...
0
votes
1answer
20 views

Deadlock caused by INSERT trigger - thread looking for lock it already has?

Using MySQL 5.6.17. I have a table with an INSERT trigger that reads values from that table and 4 other tables, combines the results and writes that to a sixth table. Ever since I added this trigger, ...
0
votes
1answer
18 views

Can I extrapolate from the progress reporting in MyISAM ALTER?

I'm migrating a 300 million row MyISAM table to add some indexes. Just because it might be relevant, here's my ALTER statement: ALTER TABLE my_table ADD UNIQUE INDEX my_table_abcd (a, b, c, d), ...
0
votes
0answers
13 views

How to interface a database to a mobile app and a Pc client [on hold]

I have a background as an embedded programmer (avrs and pics) and I have recently been taksed by my employer to build a data acquisition network that (i)Reads data from sensors and transmits them ...
0
votes
0answers
14 views

linking a single table (comment) to multiple tables (article,link,attachment)?

the main idea is that i can post an article , link or an attachment and i can receive comments on each of these types of posts (the structure of the comment is the same) , the problem here is that i ...
1
vote
1answer
11 views

My connection to a Mysql DB has been blocked after spamming queries, for how long?

I am creating a web application that depends on querying a legacy DB without an API. It's MySql. Off course the lack of an API eventually got me in trouble. A feedback loop while testing the app ...
0
votes
0answers
19 views

Multiple user roles with different attributes

I need to design a database that has multiple users, with multiple roles. For instance, a user can be an admin, company, employee, or customer. Each user can have any number of these roles. Right now ...
0
votes
0answers
8 views

Will a covering index save a table hit if only the commoly-used length of a `text` field is indexed?

I would like to add a covering index for a table that contains a text field. The maximum size of the field that is in use is ~2000 ASCII characters, 95% is below 800 characters. I am considering ...
1
vote
1answer
40 views

Selecting, ranking and applying a point score based on rank

I am writing an MVP system based on votes from users. The table will look like vote | game | year --------- ------ ------ player 1 | 2 | 2015 player 1 | 2 | 2015 player 2 | 2 | 2015 ...
1
vote
0answers
22 views

Grouping results with left and inner join with zero counts

I have a query like SELECT `campaign_question_options`.`text`, COUNT(`campaign_submission_answers`.`answer`) as `count` FROM `campaign_questions` INNER JOIN ...