Tagged Questions

MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
0answers
155 views

Query takes over 200ms [closed]

So, im using symfony2 with doctrine running in local with WAMP. I have to select from my database : latest shop comments with shop & user informations latest liked shops with shop and user ...
0
votes
1answer
52 views

Disk page size for MySQL and MySQL cluster [closed]

As I know database reads data from disk in some constant page size (even if one byte is needed, whole page will be copied from disk to memory). What are disk page sizes for MySQL and MySQL Cluster? Is ...
2
votes
1answer
710 views

Mysqld can`t start after I changed the socket path

here is the log 131229 14:55:27 [ERROR] Can't start server : Bind on unix socket: Permission denied 131229 14:55:27 [ERROR] Do you already have another mysqld server running on socket: ...
3
votes
1answer
433 views

Mysql database slow responding to connects when having only few concurrent connections

We have a database setup with in master/slave. It runs innodb and its on a 8 core with 32gb. When i run "ab" to do a load test on a website (4 frontend webservers) which does the query's with 10 ...
2
votes
1answer
489 views

LOAD DATA INFILE fatal error encountered

I use this query for loading sql data from my pc to localhost mysql database.(version 5.0.10 working witj XAMPP) The query is as below: cmd = new MySqlCommand("LOAD DATA LOCAL INFILE '" + filename + ...
0
votes
1answer
64 views

unique ID for multi tabel? (MySQL) [closed]

I have a table 'article' and each of these articles belongs to one of three different topics (topic_a, b and c). I also have a table for each of these topics with various fields. How can I connect ...
0
votes
1answer
120 views

primary key: username+current time or serial

I need to choose a primary key, but I'm not sure what the best option would be. Currently I'm in a scenario where a user has machines (workers) calculating hashes. For each user I track the current ...
0
votes
0answers
648 views

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure when executing Large queries

i am using hibernate 3.0 in my web application and using Mysql as the database. everything is working fine in normal circumstances, but the problem arises when i am trying to execute a large query ...
0
votes
2answers
108 views

How can I set columns for an entire table in one UPDATE based on the SUM of a join table column?

I have tables companies and employees: explain companies; +--------------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default ...
0
votes
0answers
49 views

Why so much traffic between SQL Node and Data Node?

For a MySQL cluster I use one SQL Node and two DataNodes. On one Data Node I have started the linux command tcpdump and have observed the communication between the SQL and Data Node while I have ...
0
votes
0answers
59 views

Best practices for ranking records in flexible way

Suppose we have 10000 records of any product. User search on our website with his given criteria. so we output search results based on given criteria. Now Admin want to rank products in search. so ...
0
votes
1answer
318 views

Mysql Alias IF statement

How do you query something like if parent = 0 then alias is network_id else alias is group_id Is this possible with only queries?
2
votes
1answer
189 views

MySQL cluster DataMemory and DiskPageBufferMemory parameters

I want to setup a MySQL cluster. The amount of data is more than double the amount of RAM. I have 3 Data Nodes each with 8GB RAM. QUESTIONS What is a good rule for the DataMemory and ...
0
votes
1answer
119 views

Mysql replication dump without down time? empty sql file

I try to create dump as replication master data and use followed command to create dump, but sql file only contains paramters and there is no data and structure. The command is : mysqldump ...
5
votes
1answer
3k views

What is the optimal way to upgrade production RDS instance?

I have MySQL small RDS instance as part of my production system and I want to upgrade it to medium instance with provided IOPS. As old-school DBA I'm aware about "add slave; promote to master; ...
1
vote
2answers
1k views

Mysql match on two columns and get count

How do I get a count of? +---------+-------------+ | col1 | col2 | +---------+-------------+ | Joe | April | | Fred | May | | Sam | April | | Joe | ...
1
vote
1answer
168 views

Looking for an efficient way to clone tens of millions of database records

A laboratory I work in is attempting to clone the open, biochemical database managed by PubChem found here. (Please don't ask why, I am not in charge of this project, I am simply tasked with the ...
0
votes
2answers
5k views

Access denied for user 'root'@'localhost' (using password yes)

I was trying to install MySQL 5.6.15 to my computer and got this error: unable to update security settings. access denied for user 'root'@'localhost' (using password yes) I guess current root ...
1
vote
0answers
137 views

mysql/mariadb: ifnull changes collation

It seems that 'ifnull' changes the default collation that is set to be used. I have tried on both mysql and mariadb: Server version: 5.5.34-MariaDB-1~precise-log mariadb.org binary distribution ...
2
votes
1answer
268 views

Which are the minimum privileges required to get a backup of a MySQL database schema?

Which are the minimum privileges required to get a backup of a MySQL database schema? I am interested only on the schema, not on the data. Are SELECT privileges required?
0
votes
0answers
39 views

I can't get MySQL server to stop running

The output from MySQL Workbench when I try to stop it is: Executing '/usr/local/mysql/support-files/mysql.server stop' 2013-12-23 21:08:29 - Stop server: ERROR! MySQL server PID file could not ...
0
votes
0answers
94 views

How to retrieve pkey value in mysql/python on duplicate key update

I'm currently using _mysql library in python. it uses pkey(int, auto increment) value that's created when inserting data using function conn.insert_id() This is how the query is made. INSERT INTO ...
0
votes
0answers
39 views

How do I save file data to my newly mounted SSD in mysql innodb continually?

I've recently mounted a new SSD since my disk's empty space had less than 10% (mysql unbuntu linux) and this is what I did in my.cnf file to save data to my new path: innodb_buffer_pool_size=2G ...
3
votes
1answer
3k views

Maximum possible memory usage: 16.2G (874% of installed RAM)

Why the MySQL is saying that can use about 16GB of RAM even if my server has only about 2GB? # ./mysqltuner.pl >> MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net> >> Bug ...
1
vote
1answer
265 views

MySQL with high CPU and memory usage

here we have a VPS with 3.2GHz quadcore processor with 2GB of RAM and 4GB of SWAP which need to work with a high intensive legacy system (read: bad coded). The main problem is that the CPU (~80 - ...
0
votes
1answer
501 views

MySQl master - master replication not working [closed]

I'm trying to setup a master - master setup and I see both masters connect to each other in workbench: server 1: -- Thread Id: 112 -- User: slave -- Host: 207.244.73.38:55164 -- DB: None -- ...
0
votes
1answer
49 views

Query optimization ndbcluster + order by

I'm not really all too familiar with the ndbcluster storage engine of MySQL, but I've recently written an application that does some very simple queries. However, a co-worker of mine (who is now on ...
2
votes
1answer
287 views

MySQL: What is the most optimized way to use datetime type field in query

I am working on optimization of some slow queries in my application. I found a query in which datetime comparison has been used. Below is the subquery: select * from jos_content c where c.visible = 1 ...
2
votes
2answers
1k views

Full outer join does not work for two small tables, error 1064

folks. I am currently exploring the capabilities of MySQL while doing simple exercises with diverse queries. I was reading the following article that explains how table JOIN works: ...
4
votes
2answers
96 views

Query only for the first n results of like

What I'm trying to accomplish is a huge speedup (read: incremental results) when searching a database with a like operator which is kind of a last resort, if everything else already failed, to come up ...
0
votes
2answers
181 views

bind-address how does it work in mysql

I have a mysql running with bind-address "10.4.0.211". From the documentation, I understand it like, the server accepts connections only from the IP - 10.4.0.211. But I could able to connect to ...
1
vote
1answer
2k views

Query State hangs on sending data

For some reason, the query state hangs on "Sending Data" (using show processlist;) and I have no idea why. This is the table creating script: CREATE TABLE IF NOT EXISTS `esp_game` ( `gameID` ...
0
votes
2answers
119 views

MYSQL Optimize tables on Innodb in production environment advice

According to mysqltunner.pl I have 177 Fragmented tables. I have over 5000 tables and 200 databases. If I run optimize table on each of them, do you think I should take down the application to ...
1
vote
1answer
2k views

QUERY RECORDS WITHIN 48 hours

I am storing some data intro a mysql database like this: ID | DATE | INFO ----------------------------- 1 | 1389384821 | blabla 2 | 1389384821 | blabla2 3 | 1389384821 ...
2
votes
2answers
596 views

How to SELECT rows with time duration stored in varchar column?

There is a column in table defined like this : duration varchar(10) It has value for duration of a MP3 file stored in it like : 52:19 (Minutes : Seconds) How can I create a SQL query, for ...
3
votes
2answers
114 views

optimal size of innodb buffer pool

I read a lot of optimal number of innodb_buffer_pool_size and people say it must be larger with 10% than the innodb tables size, what is 60M. Accordyngly this the optimal size of the buffer is about ...
0
votes
1answer
297 views

Shopping cart schema with multiple product tables

I have a shopping cart table used to store customer id and product id of their chosen items. However I have multiple product tables, for example cars, books, houses. I started out with one table but ...
1
vote
1answer
779 views

Using OFFSET in a large table by a simple sub-query

The slow performance for using OFFSET in large table has been widely discussed in various blogs, and the most efficient way is to use an INNER JOIN as SELECT * FROM table INNER JOIN ( SELECT id FROM ...
2
votes
0answers
1k views

MySQL Queries taking too long to execute

I have a database table, with 300,000 rows and 113.7 MB in size. I have my database running on Ubuntu 13.10 with 8 Cores and 8GB of RAM. As things are now, the MySQL server uses up an average of 750% ...
1
vote
0answers
72 views

join performance, index vs. index+foreignkey

I'm using an orm framework that handles data (and its integrity) on top of mysql. So far I ignored foreign keys because the orm handles that just fine. I recently read that foreign keys can enhance ...
0
votes
1answer
38 views

How do I create a non localhost connection with MySQL? [closed]

I'm currently hosting a small website on my college domain where people can fill out a form and post it to database. I'm trying to figure out how I can set up/edit my MySQL so that its not localhost. ...
0
votes
1answer
39 views

Should the value of a select max be indexed when the where clause is already indexed

I have a customer_orders table in a schema designed to be shared between multiple companies. Each customer_order has an invoice number that should always start at 1 and increment based on company ...
1
vote
1answer
62 views

normalization of data and duplicate rows

All right, this is a hobby question, so nothing critical if I don't get a quick response. But you guys have been so good at helping me, I thought why not chance it again. I am creating a db that can ...
0
votes
1answer
88 views

Select historical prices for an exact datetime - MySQL

I have a price_list table where I store historical prices for each item. columns are - id, name, price, start_date, item_id When a price is changed, a one new row is inserted with a current ...
0
votes
0answers
76 views

Select rows in random order from a huge MySQL database

I have a problem.. I would like to take 1000 rows in random order from a database that contains about 1.5 billion rows and increasing daily. I understood that using RAND is not that good idea because ...
0
votes
2answers
668 views

Massive MySQL delete from CSV file

To insert massive CSV file into MySQL, there is LOAD DATA INFILE, but is there any similar command to delete massive entries with keys stored in a massive CSV file? If not, what would you see as the ...
0
votes
1answer
248 views

What happens when the index size of my Mysql instance exceeds the innodb_buffer_pool_size?

I am using Amazon's RDS db.m1.small. innodb_buffer_pool_size is set to 1125.00 MB. Current index size is 1110.00 MB and growing slowly but steadily. I do not need more hard drive space. I want ...
1
vote
2answers
2k views

How can I prevent so many aborted clients in MySQL (increasing aborted_clients count)?

I am running MySQL 5.6.14 on an Ubuntu server and noticed the error log constantly filling with: Aborted connection 17201 to db: 'somedb' user: 'sdb' host: 'x.x.x.x' (Got timeout reading ...
-1
votes
2answers
2k views

Query to compare two rows in MySQL and make an UPDATE

I have a table (MySQL) like this: ID | AnotherID | Number1 | Number2 | Data 1 A 101 199 Lorem 2 A 102 ...
4
votes
2answers
94 views

StackExchange clone: where should I add my indexes?

I'm creating an open source stack exchange clone and the following is my schema. What should I add indexes on for it to be optimal? Here is the schema in Rails format (SQL format below as well): ...