MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

-1
votes
0answers
16 views

Does database compress data?

I have a file with 5000 rows and 10MB in size. Winrar is able to compress it to 1MB. If I store in a database, will it take 1MB or 10MB? If I retrieve it from a remote computer via c#, will it be 1MB ...
0
votes
1answer
10 views

Triggering a shell script from MySQL without any 3rd party libraries

Is it possible to call a bash script file in linux using a trigger in MySQL? I've been searching for the answer online and I ran into this articles: ...
1
vote
0answers
38 views

Handling SQL updates for production deploys

I'm researching for quite a long time now (about two months) and haven't found a good approach for this, so I'll ask you experts out there in the hope of some enlightenment. I run a pretty ...
0
votes
0answers
24 views

How alter on infobright (BRIGHTHOUSE storage engine) actually works

I have been using infobright-3.4.1 (5.1.40) for data warehousing. I know it is outdated version but there no plan to upgrade the version currently. Even though infobright is build on mysql, the way it ...
0
votes
0answers
4 views

Enable general_log in Mysql 5.0.96

I want to enable general_log in MySql 5.0.96. I have set log variable but it isn't working. [mysqld] log=/var/log/mysql.log and restart mysql with following command /etc/init.d/mysql restart But ...
0
votes
1answer
28 views

Federated table of two LEFT JOIN tables not working

For some reasons I am getting the following error when executing the below query: (What I am trying to achieve is to sync and merge two left-joined table to into one You have an error in your SQL ...
0
votes
0answers
16 views

mysql trigger help

I need to create a MySQL trigger. I don't know very well MySQL syntax but I've written something, maybe you would understand what I need, I need to insert the difference from 2 rows into a new row, ...
0
votes
1answer
31 views

(MySQL) Need an “in-place” REPLACE for adjusting historical data

I have a table with around 6,000,000 records. It is backed up every few hours. Recently a script ran that cascade updated about 2,000,000 of the older records to bad values. I have extracted those ...
1
vote
1answer
20 views

Find MySQL Patch Level

What command do you use to find the patch level of MySQL? I am currently on 5.1.73. I need to find out what patches have been applied to this database. Thanks...
0
votes
0answers
24 views

MySQL Master-Master-Slave failover

I have setup a Master-Master configuration in MySQL with one additional slave, like this: Master1 <-> Master2 <- Slave Master1 is the write master used by my application, Master2 is used ...
0
votes
1answer
54 views

Simple query is slow on 4M-rows table

I have in production a MySQL table pageviews with 4M rows that records page views of users on posts. I need to know which posts a specific user have read, but this request takes up to 15 seconds to ...
-1
votes
1answer
32 views

List two columns - MYSQL [closed]

i have a table like this: cp1 | cp2 ----------- A | 5 A | 1 A | 1 B | 3 C | 4 and i want to create a query like this: cp1 | cp2 ----------- A | 5 A | 1 ...
0
votes
0answers
22 views

Checking for replication options

I have a master/master setup with one DB in each. DB name and tables in one server are different from the other, and few 'user' tables are being replicated with the option replicate-do-table. (It's ...
0
votes
1answer
53 views

MySQL Performances Issues

I'm in debate with my database admin. He claims that my queries I'm sending through PHP are the problem and he is stating several things I believe are completely false. To begin I have a site ...
0
votes
0answers
9 views

How can I see all the incoming queries in real time to my MariaDB 10 server on windows?

I just want to see the queries coming in to MariaDB (very similar to mysql) in real time to help debug my application. What windows frontends are there that do this sort of thing? Thanks
1
vote
1answer
32 views

Slow execution of a subquery with 0 matches

In MySQL, I have two basic tables - Posts and Followers: CREATE TABLE Posts ( id int(11) NOT NULL AUTO_INCREMENT, posted int(11) NOT NULL, body varchar(512) NOT NULL, authorId int(11) NOT ...
0
votes
1answer
27 views

Should I use data type SERIAL for table id columns?

I found out that there is a mysql datatype called SERIAL, it appears to be designed for use as an id column. However some of my peers don't think that the real data type BIGINT implied by SERIAL is ...
0
votes
1answer
50 views

MySql replication from 5.1 master to 5.6 slave keep crashing

I recently updated one of the replication slaves to mysql 5.6. After importing a recent dump from the master, I run mysql_upgrade with no errors. the database deamon started correctly with no ...
1
vote
1answer
27 views

MAX (id) function with MySQli

How can I use the following statement to return only the record with the maximum PersonID from the table? /* Create the prepared statement */ if ($stmt = $mysqli->prepare("SELECT Max(PersonID) AS ...
1
vote
1answer
30 views

MySQL - OPTIMIZE TABLE for partitions

I would like to perform OPTIMIZE TABLE opearation , this table is a partitioned table. Which method can be better in this scenario: OPTIMIZE TABLE tblname; or ALTER TABLE tblname ...
2
votes
1answer
41 views

How mysql (innodb) handles auto increment column

I am working on a OLTP environment with multiple parallel write operation. I found this in documentation about auto increment locking but still i am interested to know much about it in details. Can ...
0
votes
1answer
24 views

MySQL Loop Through Each Row

I have two tables, division & template, in a MySQL database. division - DivisionID - DivisionName template - TemplateID - TemplateName Here is an example of my current data ...
0
votes
1answer
61 views

Does the order of a mysql multi-column MySQL index matter - if you're always using all columns in the query?

I'm aware that when you define a MySQL index that the order of the fields matters if the query is only using part of the index, as described here. But if your query is always going to use all columns ...
0
votes
1answer
39 views

What does SELECT ~0; do?

I've recently stumbled into an interesting Mysql query: SELECT ~0; results: 18446744073709551615 Which is the max value of a bigint unsigned. What does the tilde operator do in this case?
0
votes
0answers
22 views

WHERE in CASE in mysql

$sQuery = "SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ", implode(", ", $aColumns))." FROM (select CASE when r.agent_id=24 THEN r.Unit ELSE '--' END AS MyUnit, CASE when r.agent_id=24 THEN ...
0
votes
2answers
44 views

Do I need to reindex mysql table after bulk delete?

I have a table in MySQL with a lot of INSERT and SELECT at every second. And there is a bulk delete of some older data once in a day. Do I need to reindex the table after delete? I want to increase ...
0
votes
2answers
53 views

Do I need to reindex my table in mysql after delete?

I have a table in mysql with a lot of INSERT and SELECT at every second. And there is a bulk delete of some older data once in a day. Do I need to reindex the table after delete? I want to increase ...
0
votes
0answers
20 views

Data on the slave becomes inconsistent after couple of days

We are planning on upgrading our production MySQL server from MySQL 5.0.77 to Percona 5.6.19-67.0. Since our downtime window is small, we setup a slave of the production master on a new host and ...
0
votes
1answer
41 views

Copy Data To Different Server using SELECT * INTO?

I'm not a DBA by any means. I'm just knowledgeable enough with the MySQL command line to be capable half the time and dangerous the rest. Today I was working on exporting data from a one DB into ...
0
votes
0answers
30 views

Table maintenance after dump/source

I just completed a major DB migration, all went well. I had a 450 GB DB on old underpowered windows hardware using MySQL 5.0 and I moved everything to much more powerful (512gb memory, server 2012) ...
1
vote
1answer
31 views

MySQL InnoDB + high table creation-destruction rate

We are transferring a microsoft SQL based website (+app + plugins) structure to MySQL. The website has a high "Content + Comments + Activity Tracking" behaviour. Mainly because of the activity ...
1
vote
1answer
19 views

Adding a “position” number in Mysql

I got the following query and result currently: mysql> SELECT songname,COUNT(*) as count FROM etrstats WHERE songname != '' AND `when` >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) GROUP BY ...
1
vote
2answers
67 views

Are there any special characters that are never allowed in SQL?

I am a Java programmer. We always make database-related things configurable so that they can be easily modified by the DB team as per their requirements. I want to make some queries as configurable, ...
0
votes
1answer
32 views

How can this table possibly be converted to a MySql table?

I got a TABLE in Excel format like: This is a STEN TABLE containing FACTORS (A,B,C,D,E....etc) Each Factor is like a separate test. Each Factor i.e. Factor A has a [Raw Score] and a [Sten] ...
1
vote
1answer
39 views

optimizing query for slow queries

I have this query in my slowqueries table which essentially is taking about 5-8 seconds to complete the query time: SELECT s0_.id AS id0, s0_.updated AS updated1, s0_.created AS created2, ...
2
votes
1answer
58 views

MySQL - Old ibdata file shall I delete safely

On a production server I have changed "innodb_file_per_table=ON" and I can see separate tablespace files for each table on my server. I have used parititioning for tables so for each partition there ...
0
votes
0answers
62 views

Performance tuning self-joining MySQL query

I asked a question recently on the correct way to update a table using multiple joins to itself in order to generate the desired values. Updating MySQL innodb table based on multiple joins After ...
0
votes
1answer
41 views

Insert record only if a combination of column values doesn't exist

I have a simple MYSQL insert query: INSERT INTO table('col1','col2','col3') VALUES('123','456','some text') I want to insert only if the above combination of columns does not already exist and this ...
0
votes
0answers
34 views

Using triggers or php code

I have a table called Salons, which has over 15k Salon names. I have another table which takes count of the pageviews of each salon. My question is that if I want to update reputation of the Salons ...
0
votes
0answers
30 views

Migrate existing database onto Percona XtraDB Cluster (using innobackupex?)

I'm setting up Percona XtraDB Cluster on 3 nodes to replace an existing MySQL database server. The existing databases will need to be migrated to the cluster with as little down time as possible. ...
0
votes
0answers
48 views

Very poor MySQL query performance after upgrading from server-5.5 to server-5.6

I'm in the process of trying to migrate a database from an old server to a new one. The old server is running an Xampp installation which has been more than adequate for the use case. For the new ...
0
votes
1answer
80 views

MySQL taking significantly longer to query via PHP than CLI

TL;DR: I have a query that takes under a second to run via MySQL's CLI, but over 12 minutes via PHP and I'm at a total loss on what to check next. It's a fairly horrid query, full of joins, but the ...
0
votes
2answers
28 views

MySQL equivalent of PostgreSQL's psql \c command

I'm learning PostgreSQL though oddly enough figured out to switch users while in the psql command line to use \c database username; what is the equivalent to switch from one user to another in MySQL's ...
0
votes
1answer
28 views

Division Email Template DB Design [closed]

First question for me on the DBA SA site! This is for an Java email notification app using MySQL for backend. I have a small number of groups in our organization, [Marketing, Commerce, ...
0
votes
0answers
18 views

Recursive view for dynamic tree in MySql

Lets assume that there is a factory that produces products. the factory have catalog of a products, therefore tbl_catalog will be. ...
-1
votes
2answers
34 views

I can't find the problem? [closed]

CREATE TRIGGER request_internal_trigger AFTER INSERT ON request_internal_analysis FOR EACH ROW BEGIN INSERT INTO user_action (User_Name , Request_number , Actions , DateOfAlter , ...
0
votes
1answer
29 views

MySQL uses intersection instead compound index

I have compound index on following columns: (country_id, lazy, has_avatar, inactive, gender, id, age, challenge_count) When I run following query: SELECT COUNT(*) FROM `user_profile` WHERE ...
0
votes
1answer
21 views

How do I add databases from a crashed MySQL 5.1 server to a new MySQL 5.6 server

I was running MySQL 5.1 on a personal web server that recently died. The system drive is non-operational, but I have my second hard disk where I had installed all of my programs. This drive has my ...
0
votes
0answers
22 views

mysql uses a lot of virtual memory

I've a mysql server with a lot of small size innodb databases (each db also contains a lot of small tables) & 6GB of RAM dedicated to mysql server. Recently I've increased my ...
0
votes
2answers
39 views

moving to MySQL 6.0 is a good move?

what is most important issues and cautious we have to do before upgrade to MySQL 6.0? How do you do the upgrade? setting up a new slave and do yum upgrade? what is the best way to upgrade with ...