MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
1answer
2k views

How to check the consistency of tables in mysql

I have few questions regarding consistency in Mysql in two scenarios 1th scenario We have two hosts with the same database A and B (the same data, different copy) if there any way to check if the ...
3
votes
1answer
485 views

Select * from statement execute very slowly, innodb io read speed is low

I have a very simple query " select * from ap_statistic " running in my servers. the servers have the same hardware and software configuration (CPU 8 core, mem :32G, OS: redhat 5.5, mysql version: ...
68
votes
6answers
116k views

How do you mysqldump specific table(s)?

How can I dump a specific table or set of tables without including the rest of the db tables?
0
votes
1answer
395 views

MySQL failover - Master to Master Replication

My company is trying to implement a MySQL failover mechanism, to achieve higher availability in our webservices tier - we commercialize a SaaS solution. To that end we have some low-end VMs scattered ...
61
votes
6answers
46k views

How can I optimize a mysqldump of a large database?

I have a symfony application with an InnoDB database that is ~2GB with 57 tables. The majority of the size of the database resides in a single table (~1.2GB). I am currently using mysqldump to ...
1
vote
1answer
1k views

MySQL: Create multiple tables with one query

Can you list multiple table names in a MySQL CREATE TABLE query? CREATE TABLE table1, table2, table3 LIKE table_template; If so, can you do it with the IF NOT EXISTS clause? CREATE TABLE IF NOT ...
2
votes
2answers
1k views

How do I add a MySQL linked server to SQL Server?

I am trying to add a linked server on SQL Server to MySQL Server. Note the SQL Server is installed on a separate machine with a different domain name. The SQL Server is 10.0.1.1 on old_domain.com. ...
0
votes
1answer
29 views

how to view the Image in mysql DB

Hi How to retrieve the image in mysql I had created a table employee_details CREATE TABLE `employee_details` ( `emp_id` int(50) NOT NULL, `emp_name` varchar(50) NOT NULL, `dept` varchar(50) ...
0
votes
2answers
144 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
1answer
225 views

MySQL: Use Sysbench on Windows

Sysbench is a tool to analyze the MySQL performance. I downloaded it and extracted but there is no executable file. Files having extensions like .sh or .c or .h are available. I gone through the ...
2
votes
2answers
54 views

How to monitor InnoDB Disk I/O using Server Status Variables?

This question is extension of my previous question "How to monitor InnoDB Disk I/O Required for MySQL? " As mention in my previous question i want to count total number of disk i/o per query, but ...
0
votes
1answer
22 views

How to connect to remote MySQL server with sshuser and mysqluser being distinct

I'm trying to connect to a remote MySQL server via ssh so that I have write-access to export some data. At the moment I can do the following: Connect to the remote MySQL using mysql -u mysqluser ...
0
votes
1answer
34 views

MySQL slave database wont start

I have a MySQL master slave configuration and the slave is not working anymore. When trying to stop and start again the slave db, I am getting this error: 140530 14:21:23 [Warning] Slave I/O: ...
3
votes
2answers
166 views

MySQL runs out of memory when importing innodb database

I have a small VPS with 512MB RAM and no swap (can't have any). I am importing a 1.5GB innodb database with mysql -u -p < database.sql Before the operation can finish it says : Lost connection ...
0
votes
1answer
37 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 ...
0
votes
1answer
60 views

How to use on delete cascade and on update cascade

I want to ask how to use the various reference options for on delete cascade along with on update cascade. My delete cascade is working. That is child table records are getting deleted on deleting ...
1
vote
0answers
23 views

MySQL WRITE LOCK Not Preventing Inserts

This should be a simple task. Can someone tell me why the below code is still inserting rows? lock table wp_postmeta write; insert into wp_postmeta values (null, 1,'test','test'); I've checked my ...
0
votes
1answer
146 views

Trying to recover/import/transfer database from MySQL data dir

I used phpMyAdmin->export to create a backup of my database but I have now discovered it did not export the whole database, some tables was missed/refused. However at the time of doing the export I ...
0
votes
2answers
32 views

Query Cache Implementation Details

I am new to DBA stack exchange & this is my first question. Kindly help me in finding a low level documentation for Query Cache module in MySQL since I am planning to work with the source code of ...
0
votes
1answer
29 views

Load csv into MySQL database programmatically

I know about LOAD DATA INFILE command -- however, this requires that we already have the table with appropriate columns in place. When I have csv with hundreds of columns, it is not feasible to type ...
1
vote
3answers
80 views

Why query_cache_type is disabled by default start from MySQL 5.6?

We've upgraded to MySQL 5.6 and start seeing the loading of db server increased significantly, and finally found out the query_cache_type is defaulted to off start from 5.6. We enabled it again and ...
0
votes
1answer
131 views

MySQL DB structure with Main category and several nested sub categories

I am looking to create a set of fields on my webpage identical to what eBay uses on their category selection page when you are selling something. For my purposes I am doing motorcycles, power sports, ...
0
votes
1answer
39 views

How to simulate a table join on itself?

Let's assume this is my current data: product_number date value 100 2010-01-01 1 100 2010-02-01 1 100 2010-03-01 1 200 2010-01-01 1 ...
0
votes
1answer
17 views

How to optimized mysql query having large dataset

I have two tables in MySql with the following schema, CREATE TABLE `open_log` ( `delivery_id` varchar(30) DEFAULT NULL, `email_id` varchar(50) DEFAULT NULL, `email_activity` varchar(30) DEFAULT ...
-1
votes
4answers
208 views

Database/Storage engine suggestion for a project involving heavy inserts?

I am looking into a project which involves large number of inserts daily.I will have a list of user's (for example a user set of 500k ) , for which I need to monitor daily certain activities ...
1
vote
1answer
12 views

Select the last logged change before a specified time from a change list

I want to get the last change for all issues issue, that was made before a specified end time. I have 3 tables. projects +---+------------+ |ID |project_key | +---+------------+ |1 |bug_tracker | ...
0
votes
1answer
99 views

Relation between multiple hierarchical taxonomies linked to a single entity

I am working on an online test application which supports multiple choice questions. I have created schema for taxonomy (classification) system to be used with questions. taxonomy(id, name, slug, ...
0
votes
2answers
318 views

Why does this procedure raise a privilege error?

I am having trouble getting the following procedure to run on a remote MySQL database - the given error is privilege based (#1227). Locally, the procedure runs fine. QUESTIONS Could somebody help ...
0
votes
1answer
39 views

Could not access database

I have been trying to setup a local instance for a new application. I am new to MYSQL and I cannot understand how to actually connect this database to the actual web application sitting in the ...
-3
votes
0answers
23 views

Delete & Truncatehttp://dba.stackexchange.com/questions/30325/delete-vs-truncate [duplicate]

what is the major difference DELETE vs TRUNCATE delete and truncate the data base ???
2
votes
3answers
940 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; +--------------------+ | ...
0
votes
0answers
393 views

MySQL is running but not working [closed]

In an attempt to tune MySQL to make it work with a recent installation of Drupal I had to modify the MySQL settings on my server. After modifying the configuration file for MySQL (/etc/my.cnf) MySQL ...
0
votes
1answer
54 views

Whether to use or not to use: DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

In one Database table, created_at & updated_at are defined as: `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP `updated_at` timestamp NOT NULL DEFAULT ...
0
votes
0answers
20 views

Help with MySQL query which is only occasionally slow? Temp tables/Disc caching?

We have an issue with one particular query whch runs regularly on our MySQL database, though I am not necessarily sure it is a problem with the query itself. 90% of the time it runs perfectly fine ...
1
vote
1answer
274 views

How to removing or reduce the size of redo logs in MySQL cluster

Can anybody tell me that how can we reduce the redo log file size or can we remove the redo log file size in MySQL Cluster and also what will be the impact of it on performance of cluster.Also can we ...
2
votes
1answer
6 views

MySQL Stored Procedure Requiring SUPER

I'm trying to figure out a "safe" way of allowing a non-SUPER user to execute a specific command requiring SUPER privileges, i.e. SET SESSION binlog_format = 'MIXED'. I don't want to grant the user ...
1
vote
2answers
36 views

MySQL describe | more

With my current setup, it's going to be very hard, if not impossible, to get my terminal window to scroll up and down. That means I can only see 25 rows of text at once. If I have to display something ...
2
votes
2answers
67 views

I need help optimizing a not that complicated query that returns unexpedcted performance problems

I have a table that stores details about incoming and outgoing phone calls such as when a call was made, or when a call was received, the phone number of the caller, and the phone number of the ...
0
votes
2answers
88 views

Database search with multi joins

I have a MySQL database and I want to perform a little bigger search. I have about 10k records in one of the tables and It's expected to grow, but slowly. The biggest problem is that to perform the ...
1
vote
1answer
506 views

Amazon RDS - Can't access MySQL DB from local machine

I read many questions/answers here but they are from a different interface from AWS Console. I created a DB Instance but can't create a rule in the security groups that's allows me to connect from my ...
0
votes
0answers
12 views

MySQL Is there a performance difference between col = val and col IN (val)?

Is there a significant performance difference, or any other reason why I shouldn't write, for example: SELECT * FROM table WHERE col IN (val); Instead of: SELECT * FROM table WHERE col = val; I ...
0
votes
1answer
68 views

Very slow update with subquery (different tables)

I run this query to update "domains" table based on "log" table: UPDATE domains SET domains.mx_collected = 0 WHERE domains.domain IN (SELECT log.mail as domain_name FROM log WHERE `time` >= ...
0
votes
3answers
879 views

Running an “ORDER BY CASE” query on MySQL view breaks it afterwards

Whenever I create a MySQL view and then run a query ordering the results with ORDER BY CASE WHEN (...), the view becomes unusable. The newly created view works properly and all SQL is correct. This ...
1
vote
1answer
12 views

my phpMyAdmin data is hashed or hexed?

I have a mySQL db setup in MAMP in which I connected mySQL Workbench to administer the design of the database. When I inserted some data today from within myPhpAdmin (localhost:8888), I noticed the ...
0
votes
1answer
15 views

MySQL Syntax - Searching points within polygons using GeomFromText

I am trying to select points within polygons using the GIS/spatial extensions for MySQL. I'm fairly new to this, so bear with me if this is an elementary question. I have points defined as text ...
3
votes
1answer
55 views

Percona MySQL 5.5 Unique key is duplicated

I'm totally out from ideas, so maybe somebody else could answer my question. We have a MySQL 5.5 server from Percona with high traffic. The application is in PHP and writes always to master. We have ...
4
votes
2answers
990 views

UNION is slow but both queries are fast in separate

Dunno what else to do about this one. I have one table that has has a start and a stop columns and I want to return the results of it joined both by start and by stop and I want a clear distinction ...
0
votes
4answers
31 views

Converting to MyISAM, `foreign_key_checks = 0` Not Working

At the end of a long series of compromises working in a system I didn't design, own, or maintain, I need to convert a number of MySQL InnoDB tables to MyISAM tables. However, when I attempt to alter ...
0
votes
0answers
21 views

Function performance issue

This one is puzzling me since yesterday and maybe someone could shed some light on this. We've got this table that records GPS data. We're currently doing some overloading tests to see how the ...
0
votes
0answers
17 views

How to manage “up to date” data and data “in use” [on hold]

On my CMS, we can update/modify data. I want to implement a "deploy" function ,which can be used by only moderators, to save this data and enable access to it through my webservice. Only data deployed ...