MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
30 views

MySQL - How to get multiple/batch averages from daily data

I'm really not sure how to tackle this so let me explain my goal... Lets say I have 30 people that enter a piece of information into a table and let's also say that 20 of these people do this between ...
0
votes
1answer
37 views

MySQL Rows to Columns to HBase (using Sqoop)

I have a table that looks like this in MySQL: id | date | num | avg I have found that I can use this for rows to columns and it works so far: SELECT CONCAT(id, '-', date), MAX(IF(`num` = ...
0
votes
2answers
29 views

MySQL timestamp timezone handling

Does the timestamp data type represent an instant-in-time or a year-month-date-hour-minute-second value? An instant in time is a moment, like the moment you started reading this, and it can be ...
0
votes
2answers
16 views

MySQL password is changed automatically

I'm the lone user of my computer. I haven't changed my MYSQL root user password, but it is somehow changed to empty password. Help me out ! My default sakila db is also gone. I specified ...
3
votes
2answers
436 views

A little clarification on how 'LIMIT' works

Not being a full blooded member of the DBA clan, but more of a dev clan, I find myself trying to figure out some slow running queries. The subject of my question however is not 'Why my queries are ...
0
votes
3answers
34 views

How to create an Access query to find # symbol into a field?

It seems easy but I'm missing something. I have a MySQL database that is connected from access through ODBC connector. I'm looking for the fields where there are # symbol but I'm getting zero ...
0
votes
1answer
34 views

Last used index from specific table

how can i take last used index from a specific table and add a +1 to it? database login, table cars I think i need to add it here #### $sql = 'INSERT INTO '.$this->options['db_table'] ...
1
vote
2answers
31 views

Is there a rule of thumb regarding the size and number of a buffer pool instances?

I know the consensus seems to be approximately 75% of ram should be dedicated to the buffer pool. But, I'm more interested in the optimal number of buffer pool instances. What are some things to ...
0
votes
0answers
34 views

MySQL: How to calculate potential wait time?

I'm trying understand the relationship between WAIT_MS and COUNT_STAR. Is this saying the average wait time is 3.2s and occurred 11,543 times for a total of approximately 10.5hrs of aggregate wait ...
0
votes
1answer
50 views

Why is this query slow, it seems simple

I have a very typical table of user information for my application, with an average set of columns (ints, varchars, etc). In this table are two varchar(100) fields: emailAddress and emailAddress2. ...
0
votes
1answer
16 views

Is it possible to recover from a LOST_EVENTS incident from an RDS read replica?

I was setting up a read replica of an RDS database for a reporting project, and issued an incorrect GRANT statement when configuring a user. My RDS read replica stopped, with an error message on the ...
0
votes
1answer
30 views

Restore InnoDB from .frm files

My database crashed and my PC and I now only have the .frm and .ibd files left. Is there any way to restore my database?
0
votes
1answer
26 views

How do I fix Replication event checksum verification failed while reading from network. Error_code: 1743

Our server had disk space problems. As a result, replication's IO Threads fails to start. Here are the errors in mysql error log: [Note] Slave I/O thread: connected to master ...
1
vote
1answer
17 views

Adding ID in second Table

I have two table one is photos and another one is photo_detail, this is how i have created both tables: /* creating photos table */ CREATE TABLE photos( -> pid INT(10) NOT NULL AUTO_INCREMENT, ...
0
votes
1answer
23 views

How to overwrite csv file of MySQL result set?

My SQL query is given below, select company.Company_name as COMPANY_NAME, IFNULL(followup.contact_date, ' ') AS FOLLOW_UP_DATE, IFNULL((select Full_name from user where user_id = followup.user_id), ...
3
votes
1answer
25 views

MySQL multi-source replication with identical DB names

How can I set up a multi-source master/slave relation with masters having the same database names? I am using the MySQL labs 5.7.2 release with multi-source replication. One of the use cases for ...
1
vote
0answers
29 views

Optimizing MySQL query

I have a Sql query to optimize, its execution time is 8.5 Sec. I have made index on fields (timesheetdate,deleted) and able to reduce execution time to 8 Sec. A behavior I noticed that when I change ...
0
votes
1answer
16 views

MySQL: Prevent DROP TABLE and TRUNCATE TABLE on Slaves

Can someone tell me how to prevent the following commands DROP TABLE <tbl-name>; TRUNCATE TABLE <tbl-name>; from being replicated to slaves?
0
votes
3answers
50 views

Get only future records

I have the following query: SELECT master.master_id, master.showname, MIN(CONCAT(shows.show_date, ' ', shows.show_time)) AS first_show_date, MAX(CONCAT(shows.show_date, ' ', shows.show_time)) AS ...
1
vote
1answer
24 views

merge rows based on column

I have attendance_log table : +----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | ...
0
votes
1answer
17 views

mysql - Waiting for table level lock on a table

I have a problem with my website.. The last few days, at random times the website has become very slow. I started to investigate the best I could. I saw that the MySQL process was using 85 - 95% of ...
0
votes
1answer
16 views

MyISAM recover updated row

The row (with type MEDIUMTEXT) has been accidentally updated with empty value. I can see previous data in MYD file of a table, but I can't get them neither from mysqldump or any mysql client. If I ...
1
vote
1answer
50 views

LOAD DATA INFILE decline in performance

Query for insert: LOCK TABLE tbl WRITE; ALTER TABLE tbl DISABLE KEYS; load data local infile "E:/One.txt" into table tbl fields terminated by "\t" lines terminated by "\n" (user_id, sexid, cityid); ...
0
votes
0answers
23 views

MySQL Replication with Tungsten

I am trying to setup a multi-master type of replication with each master having an additional slave using tungsten. As an example, lets say I have 4 hosts (A,B,C,D) and Hosts A and C are the Masters, ...
1
vote
1answer
37 views

Amazon RDS mysqbinlog “Could not find first log file name in binary log index file”

Preamble: We use RDS at AWS to manage our MySQL database. I know that RDS creates binary logs used for replication.. I want to harvest these binary logs and store them on S3, so that at any time, i ...
0
votes
0answers
17 views

Get categorie, subcategories and number of products assigned to each

I have a list of products, and a list of categories, and a join table. Products can be assigned to multiple categories. Categories can have one level of subcategories. The tables look something like ...
0
votes
1answer
41 views

update variable from multiple tables in one row

I have two databases, and I need to UPDATE variable 'birthday' from one row to another checking 'name' (from db1 to db2). The problem is, that 'name' variable in second db is located in another table ...
2
votes
1answer
34 views

Will MySQL be effective when selecting a row from a table with billions of records?

Note: this is a hypothetical scenario Lets say that: I'm running MySQL, InnoDB engine, UTF-8 encoding I have a table with 50+ billions of rows The tables primary key is a BIGINT The table also has ...
0
votes
1answer
22 views

Mysql will not start

Please help, I really need to recover my databases. service mysql start start: Job failed to start mysqld --verbose 140401 20:16:11 [Warning] Can't create test file ...
-4
votes
1answer
74 views

What are the disadvantages of PostgreSQL compared to other DBMS? [closed]

I am a student studying PostgreSQL. I want to know the advantages and disadvantages of PostgreSQL in comparison to other DBMS.
0
votes
1answer
33 views

MySQL: LEFT OUTER JOIN within reason

What I'm attempting to do is LEFT OUTER JOIN a table, but I only want the last inserted record of the joined table to affect the results. Currently each table row within the joined table seems to be ...
0
votes
1answer
25 views

Using non-replicated read/write databases on a MySQL slave server

I have a MySQL slave server that has two databases being replicated from a master. What I'd like to do is add a third database that I will exclude from replication and use as a read/write database. ...
0
votes
2answers
41 views

MySQL Master <=(Slave,Master)=> Slave configuration

Sorry for the wonky title if it got you confused. I want to know if a server can be a slave and master at the same time. Our problem is that we have lots of mobile units that need to be synced to the ...
0
votes
0answers
31 views

Efficient way to fetch/update X records in a loop

What I need is a simple process that handles requests. I have setup a simple table as follows: CREATE TABLE Requests ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, request_param VARCHAR(250) ...
0
votes
1answer
64 views

Delete Query takes a long time

I have a innodb table that counts circa 1 billion entries. I started a delete operation (with a small where condition on an indexed column) that should delete a lot entries, leaving circa 100 million. ...
0
votes
0answers
27 views

MySQL import gets slower and slower until it virtually grinds to a halt, what can I do to maintain constant speeds?

I'm importing a large set of sql data into a MySQL (MariaDB 5.5) database, the files are from 200mb to 3g. I'm importing it one after the other, and it starts importing at speeds around 1MiB/s to ...
0
votes
0answers
22 views

How to update Status using IF Condition in Mysql trigger

I'm trying to write an update trigger that will Design_Update_Status to Customized when a date is entered in Custom_Design_Update_Date field and if nothing is entered that field it should update ...
0
votes
1answer
31 views

Index to fix this query MySQL

We have an extremely large forum running lots of third party software (Most of which doesn't run all that well) and we're starting to optimize things as time allows. This query keeps popping up in the ...
0
votes
1answer
47 views

Rollback parent procedure on failure in MySQL

I have the following two procedures on my server: CREATE DEFINER=`someone`@`localhost` PROCEDURE `NewMagnet`( IN `nick` VARCHAR(32), IN `tth` CHAR(39), IN `name` TINYTEXT, IN ...
0
votes
0answers
26 views

Need help with data model

Schema does not list all fields, but only the relevant ones User adds credits/funds to his account using paypal or Internet Banking (which has to be verified manually, and approved, so the 'status' ...
1
vote
2answers
47 views

How to Log All mysql queries into log file?

I am using Mysql 5.6.12 under Wamp server environment. Now I want to log All queries into ".log" file, the queries which are running by PHP or from PHPMyAdmin, I want to log them...
0
votes
0answers
19 views

Which tool to use to generate an ER Diagram that will allow navigation between tables

DB= Mysql 5.X , OSX/Windows I have a DB with over 400 tables. I want to use a tool to reverse engineer the db to an ER diagram that will allow me to navigate between tables. So for example, when I'm ...
0
votes
1answer
12 views

Create table shows ERROR 1005(HY000) errno 150

i tried to create tables as per given in my textbook in MySQL server as follows: create table department (dept_name varchar(20), building varchar(15), budget numeric(12,2), ...
0
votes
1answer
38 views

mysql directory grow to 246G after one query, which failed due to table is full

I was trying to run the following statement with the hope to create a join of two existing tables. create table CRS_PAIR select concat_ws(',', a.TESTING_ID, b.TRAINING_ID, a.TESTING_C) as k, ...
0
votes
0answers
28 views

Every 30 minutes mysql stuck for 20-30 seconds [on hold]

I have very strong mysql 5.5 computer (Windows server / AWS) . My CPU ~8% ,Disk IO - 0.5% , ~Connection - 800 binlog_format=MIXED, innodb_read_io_threads=64, innodb_write_io_threads=64, ...
0
votes
1answer
30 views

MySQL database freezing after 'use'

I recently made a rather stupid mistake and corrupt my Ubuntu installation. To resolve it, I booted with a live cd and copied the database files over. However, now I have copied the folders from the ...
0
votes
1answer
61 views

How to make a better Data model

I am creating a database system using MySQL for a group in my school (a University). I am new to MySQL and its usage.I have started with the data modelling process, since this process will be the main ...
0
votes
0answers
23 views

Converting UUID's from CHAR(32) to BIN(16)

I have a few questions relating to UUID's, but before I go on, let me explain our schema a bit, first, we're on MySQL 5.5 (Percona's version to be exact)... In each applicable table, we use a two ...
0
votes
1answer
59 views

UPDATE CONCAT without duplicates

I would like to concatenate multiple values ​​and remove duplicates (case-insensitive) in the same field with SQL only. Without using a unique key or stored procedure. Ex. ...
0
votes
0answers
10 views

MySQL/MariaDB CLI limits max password?

I've got strange problem - my MariaDB instance CLI (Linux) does enforce limit on how long password can be. For example, setting password like this UPDATE mysql.user SET ...