MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

3
votes
1answer
4k views

MySQL performance tuning + queries stuck on “Copying to tmp table”

The latter part of the question's title (queries stuck on "Copying to tmp table") has been addressed many times, and I have spent a fair amount of time researching this. I would appreciate it if you ...
2
votes
1answer
186 views

How can I disable utf8mb4 entirely on MySQL 5.5?

I know you're not supposed to do this, but I have a MySQL 5.5 master and a MySQL 5.1 replication slave. That's supposed to be okay, unless I do something stupid like use utf8mb4 that isn't supported ...
1
vote
1answer
416 views

MySQL Create table syntax error

CREATE TABLE plan ( id VARCHAR(30) NOT NULL, name VARCHAR(20), amount INT, interval INT, currency CHAR(3), ...
1
vote
3answers
168 views

Anyone want to try a script bash or python?

I need to automate master binary log purging to occur so that purging never goes back further than the last slave has the updated info for. These slaves are mobile and there are 3 of them, and sync ...
1
vote
1answer
99 views

In Mysql 5.5, why is the upper bound of a character range not inclusive?

So I'm trying to query on a character range, i.e. all manufacturers with names starting with a or b: SELECT manufacturer FROM warehouse WHERE manufacturer >= 'a' AND manufacturer <= 'b' or: ...
0
votes
1answer
2k views

MySQL auto increment problem with deleting rows / archive table

A hosted server is running "maintenance" each weekend. I am not privy to the details. In a database on this server there is a MyISAM table. This table never holds more than 1000 rows and usually much ...
4
votes
1answer
154 views

Worth investing in MS SQL? [closed]

Not trying to start a war here, but I would like some thoughts. I work for a small nonprofit that is eligible for generous charity licensing from Microsoft. I am the database/web coder and my ...
1
vote
2answers
276 views

Efficient way to query set of rows from MySQL

I am using MySQL database engine. My Java application uses simple JDBC to retrieve data from database. I have following database schema: main table with two columns: (INTEGER id, BLOB data). id is ...
4
votes
2answers
5k views

Amazon RDS for MySQL vs installing MySQL on an Amazon EC2 instance

At work, we host all our webservers on Amazon EC2 and usually have used MySQL databases installed on the same box as our Apache webserver, and communicated with them on localhost. We now face a need ...
0
votes
0answers
185 views

table is full in innodb

One of the table t_keyword_stat_ga in the my DB on server(currently the master) was set as INT for a column id. This column is also set as the auto_increment. As noticed today the INT column reached ...
0
votes
1answer
112 views

Query taking long time

My query is taking around 540 seconds to get result. Please help me to rewrite it. Query: SELECT pd.domain, fd.passkeyid FROM portfolio.domains AS pd, fabulousdomains.domains AS fd WHERE ...
1
vote
1answer
700 views

MySQL Index Fragmentation

Is there any way to find out the fragmentation of indexes in MySQL ? If such an output can be obtained, it would be helpful to identify which all indexes need to be rebuilt. I'm using MySQL 5.1 on ...
4
votes
1answer
577 views

What relationship type to use for this messaging system?

I am trying to make a small messaging system. It should have these properties: One user can send a message to one or many users Messages can be sent only to registered users (i.e. to an existing ...
1
vote
1answer
356 views

What would cause Mysql database entries to be truncated to 253 characters?

Randomly seeing database entries truncated to 253 characters on a php site and can't figure out why or if it could be malicious or a corruption issue. Any thoughts would be appreciated.
6
votes
1answer
1k views

Is PostgreSQL replication production ready?

How does PostgreSQL native replication compare to MySQL? I know asynchronous replication has been supported for longer than sync, which is recent. Is synchronous reliable to be used in real projects? ...
1
vote
1answer
110 views

Issue with Storage Engine

Just got the below error in one of the slave. I just Googled it and changed the variable myisam_data_pointer_size from 4 to 6. Somehow, my ALTER TABLE was successful. Can you please let me know ...
1
vote
0answers
138 views

MySQL Workbench and Optional Many's

I have used workbench before to make databases code wise and I just started looking into its EERD functions. I created a small database for a test project and found some odd things about how MySQL ...
1
vote
1answer
657 views

MySQL InnoDB logfiles resized - review mysql-err.log for potential problems

I restarted mysqld this morning, to increase the size of the innodb logs and increase the amount of memory allocated to the innodb buffer pool. (MySQL 5.1.53-Community on Ubuntu) To increase the ...
1
vote
2answers
2k views

Which hot backup tools for MySQL InnoDB database : Percona XtraBackup, Zmanda Recovery Manager Enterprise or Community or…? [closed]

I manage a PHP/MySQL website : max 500 simultaneous users / average of 4000 per hour in update/read 1 MySQL Community Server (5.1) - (Xeon / 16 Go RAM) InnoDB Storage engine on 100 tables for 1.4 Go ...
0
votes
1answer
823 views

MySQL - Performing an IF statement for each row in a query

I have a hurdle I'm trying to overcome with a website I'm building. I know what I want to achieve but I'm still pretty new to mysql so I'm not exactly sure how it's supposed to fit together. Setup: ...
3
votes
1answer
1k views

What happens when changing column type DATETIME to TIMESTAMP in MySQL?

I want to convert a column data type from DATETIME to TIMESTAMP in a table with more than one million of lines. Is it possible? Is it slow? Will I lose the old information or MySQL can convert this ...
0
votes
1answer
1k views

What is the actual difference between innodb_autoinc_lock_mode 0,1,2

I would like to understand the differences between innodb_autoinc_lock_mode options 0,1 and 2 when parallel load data infiles are given. I see in "0" option, it locks the entire table and does the ...
0
votes
1answer
1k views

mysql fine tuning: open_tables, opened_tables

I'm a novice to database administration and have been depending on forum suggestions and answers to help resolve my database hang ups and too many connections errors; I've managed to reduce the ...
2
votes
3answers
1k views

Strange MySQL database that I can't select

I am investigating a web site server (CentOS release 6.3) that runs the traditional lamp stack; I am getting the following output my MySQL; mysql> show databases; +--------------------+ | ...
4
votes
2answers
224 views

MySQL | Complex (for me) SQL Statement, how to?

I have a table that contains posts and another table that contains meta options for each post in first table. The meta options table is a key value pare table. Lets say I have the posts tables that ...
1
vote
1answer
216 views

Efficient query plan for selecting all data duplicated on several columns

The flavour in question is PostgreSQL, but it is a generic enough query pattern that your techniques for optimising against other RDBMs should help as well. The purpose of the query is to show all ...
0
votes
1answer
69 views

Where can I read about views for MySQL?

I really don't know nothing about SQL.. I know how to insert and select data from database using PHP but besides that, nothing. I found this view And I am sure that 5 minutes for you to answer this ...
1
vote
1answer
960 views

declare keyword error mysql

This is the code I've written: delimiter // create procedure `update_pts`() begin set @ctr=1; set @cnt=(select count(*) from participant); declare cs1 cursor for select sap from participant; open ...
1
vote
0answers
42 views

Is there a canonical list of MySQL defaults which should be changed

I'm setting up a new mysql server as we're building a new app at work. Most of the developers/operations guys are familiar with mysql. Many of mysql's settings (eg strict mode) are set badly by ...
2
votes
1answer
484 views

SQL INSERT Query takes 2 seconds and sometimes much longer to execute

I know the question's title is bad, But I have an hard time figure it out my self... sometimes this query runs in 2-3 seconds and sometimes it's takes even 30 seconds I have a table named ...
0
votes
0answers
311 views

MySQL Left Join Select all rows

Hi guys I have a query which is pulling data from database : SELECT sandwich_table.id, `sandwich_name`, salad, COUNT(salad), salad_type.type, ...
1
vote
2answers
1k views

how to dump a single stored procedure from a database

I need to create a dump file that contains a single stored procedure from a database. Not all routines from that database
0
votes
0answers
199 views

Try to find a match using SUBSTRING(SHA1(value)), 0, 6)

I have a tbl where all entries for companies that participate in a online project are saved. This table is named "business". Those companies can use their employess to access the online platform i 've ...
3
votes
1answer
180 views

MySQL partitioned tables?

I have a database that supports a web application with several large tables. I'm wondering if partitioned tables will help speed up certain queries. Each of these tables has a colum called ...
1
vote
1answer
351 views

Automatic MySQL Sync from master, where Slave was offline for long period of time

Does anyone here know if there are any tools, not using mysql's built in replication that will sync up two databases when the slave has been inaccessible from the internet for extended periods of ...
1
vote
2answers
1k views

Using MySQL EXPLAIN to analyze the performance of a function

You can precede a SELECT statement in MySQL with EXPLAIN, but how would you explain a function? I have a function that does a lot of work and I would like to analyze the performance of the function as ...
2
votes
1answer
411 views

Monitor user to query processlist

We have a corporate monitoring system based in Zabbix. Its MySQL monitoring is quite basic, so I want to add more info. To do so, I've done a script that retrieves this info from MySQL and sends it to ...
3
votes
2answers
3k views

How do I dump only the data for all tables using mysqldump

I have a new database with schema and primary key, FK, index constraints created for all tables. How do I dump only the data from an existing database using mysqldump, so that I can import only the ...
0
votes
0answers
33 views

MySQL: optimal configs / methods for ALTER of large MyISAM table to InnoDB (17gb+) [duplicate]

I have a large MySQL (5.1) MyISAM table (13gb table, 4GB indexes - 40mm+ records) I'm going to be converting this table to InnoDB in a production environment. The DB is on a cloud server with ...
1
vote
1answer
225 views

MySQL selects/updates only using 1 core

I have a server with 4 physical Xeon processors, each with 8 cores and each core is capable of 2 threads. When I run MySQL queries I'm only seeing 1 CPU go to 100% in top and the total CPU usage at ...
1
vote
2answers
384 views

MySQL: optimal configs / methods for ALTER of large MyISAM table to InnoDB (17gb+)

I have a large MySQL (5.1) MyISAM table (13gb table, 4GB indexes - 40mm+ records) I'm going to be converting this table to InnoDB in a production environment. The DB is on a cloud server with ...
1
vote
2answers
2k views

MySQL case sensitivity for table names

Why is it that different platforms (linux vs windows) does not support the same naming conventions? I'm stunned by the fact that the documentation uses file names as an excuse for this. Yes, windows ...
0
votes
1answer
369 views

How do I check if a stored procedure is defined in MySQL

When I do : select routine_definition from information_schema.routines where routine_name = 'sp_name'; it returns a row, but the routine_definition column is NULL. Does this mean that this Stored ...
1
vote
1answer
584 views

MySQL Point in Time Recovery For Just a Single Schema?

Is it possible to simply restore a single schema and bring it to a point in time (Say three hours ago) without bringing the entire database back? I can think of a lengthy method of backing up each ...
0
votes
1answer
45 views

é being converted from database to site

I have a MySQL database that is storing business data... In the database, when running a select against a business name that contains an accented e (é), it comes up correctly (showing me that it is ...
2
votes
1answer
975 views

creating table syntax error 1064

I'm using workbench to create a table. This script is giving me a problem. It is saying that there is a syntax error new '). DROP TABLE IF EXISTS `waitronmain`.`managers` ; CREATE TABLE IF NOT ...
1
vote
1answer
1k views

can't create schema for mysql database

I am trying to create a schema for a mySQL database through my sites phpMyAdmin section. However when I try to run the following script: CREATE SCHEMA `mydb` I get this error and I am unsure what ...
1
vote
1answer
53 views

About GRANT statement for user creation

I am new to databases, learning MySQL through a textbook. My doubts are regarding grant statement. I am learning on a localhost environment (both server and clieat are my own system). FIRST DOUBT ...
0
votes
1answer
527 views

MySQL InnoDB locking on combined UPDATE-JOIN statements

on querying statements which contain an UPDATE combined with JOIN, we are getting the following errors: Statements writing to a table with an auto-increment column after selecting from another table ...
0
votes
0answers
75 views

How to efficiently model this simple data structure?

catId(INT) | userId(INT) | catName(VARCHAR) 0 1 Cat1 1 1 Cat2 2 2 U2Cat1 3 2 ...