MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
1answer
1k views

How can I use a MySQL query in an openquery query on Microsoft SQL Server.?

I have the following query which works fine in MySQL: DELETE sb FROM stockbatches sb INNER JOIN batchestodelete btd ON sb.batch_batch = btd.batchno AND sb.batch_part = btd.batchpart ...
6
votes
2answers
2k views

Amazon RDS I/O requests - 1 query = 1 billable I/O?

I have an InnoDB database that I'd like to migrate onto Amazon RDS. My current implementation, hosted on my own server, shows roughly 8M queries per month. The RDS site say that I/O Rate $0.10 ...
4
votes
2answers
1k views

Import and Export database in Mongo just like MySQL

I am newbie to the Mongo.Before this I have worked only with MySQL.In MySQL we can import and export database easily.I want to know is there any option available in Mongo to import and export database ...
1
vote
1answer
2k 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 ...
2
votes
6answers
3k views

MySQL join two table if second table is not empty

I have 2 tables like below table 1: users id name 1 John 2 Jane 3 Mery 4 Alpha table 2 : notes id note owner created 1 alpha alpha 1 2013-02-03 10:30 2 yeah ...
1
vote
0answers
43 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 ...
1
vote
1answer
510 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
618 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 ...
0
votes
0answers
407 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, ...
0
votes
0answers
34 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 ...
0
votes
1answer
769 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
1answer
606 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 ...
2
votes
1answer
975 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
7k 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 ...
1
vote
1answer
377 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 ...
0
votes
2answers
12k views

how to insert data from one table to another [closed]

SELECT a.nid, a.stock, b.qty, sum( b.qty ) FROM uc_product_stock a INNER JOIN uc_order_products b ON a.nid = b.nid GROUP BY a.nid the above query give me the following result: nid stock qty ...
1
vote
1answer
64 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 ...
1
vote
1answer
998 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
51 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
2k 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
858 views

Secure method beside phpMyAdmin for remote mysql

Recently, one of my centos linux servers was hacked and the cause of due to phpMyAdmin. It was said due to this problem PhpMyAdmin vulnerability CVE-2011-2505 ...
1
vote
1answer
3k 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
722 views

MySQL Tables crashing randomly

This is one of the many random Tables that get corrupted. Any ideas why and what would be causing this? How do I keep MySQL tables from crashing and MySQL from crashing? Repairing USR_wp537 ...
1
vote
5answers
3k views

How should I save apache logs into a mysql table?

This is a php script to view apache logs. I want to save apache logs into a mysql database. Then add some rules for tagging urls using mysql REGEXP search, like: SET tag='some tag' WHERE url REGEXP ...
2
votes
1answer
326 views

Redesigning a multi-instance MySQL server for performance and resiliency

I've got a single MySQL server which currently runs N separate MySQL instances on, which are rapidly growing beyond the capabilities of that box. Is it possible to have an active-active MySQL ...
0
votes
1answer
348 views

horizontal partitioning or multiple tables?

I'm developing an application and need to propose a database schema. We plan for a MySQL database with millions of records which should be distributed over multiple machines for performance and ...
1
vote
1answer
861 views

how to run limit query within condition in mysql

I have a huge database around ~20,000,000, presently I am running a php script, which verifies if user info is 'valid or invalid'. There are several entries named 'invalid' in the database. Problem is ...
1
vote
1answer
167 views

With MyISAM is there any index size savings when using INT vs BIGINT?

There is obviously a four byte per row space savings in a data column when using INT vs a BIGINT type. But I have been trying to figure out if there is also any space savings for myisam indexes on ...
1
vote
1answer
65 views

MySql include partition key in index?

Please look at the following Mysql table: http://pastebin.com/b0NDSbdz I've partitioned the table by sent_at and I'm making sure that most of the queries pass sent_at. do I need to include sent_at in ...
3
votes
3answers
2k views

Count consecutive rows in mysql

I would like to get the count of consecutive rows in MySQL. It is a large database I try to avoiding the joins. Here gadget_id means vehicle and every 20/30 second the vehicle sends the current ...
0
votes
1answer
147 views

mysqlslap running very slow on a specific computer

I've recently discovered the tool mysqlslap and have run some simple tests with it. I currently have three test environments (2 Win 7, 1 Linux Ubuntu) where I can run these tests. However, running a ...
4
votes
1answer
3k views

What is the proper way to backup MySQL database with rsnapshot?

I want to backup my website that contains both user uploaded images and data stored in MySQL database such that they are always consistent with each other in any particular point of time. While ...
3
votes
1answer
2k views

InnoDB temporary table location

I have a busy InnoDB table that expands and contracts regularly in size on a daily basis based on it's load. Typically, we'd see the table grow to 80GB in size (50/50 data and indexes) and then shrink ...
5
votes
1answer
5k views

Which is better: many join conditions or many where conditions?

I am trying to compare two queries: Query 1: SELECT a,b,c,d,e FROM tableA LEFT JOIN tableB ON tableA.a=tableB.a WHERE tableA.b=tableB.b AND tableA.c=tableB.c AND tableA.d=tableB.d AND ...
5
votes
2answers
31k views

Grant table privileges to a user connecting from any host

I have a user account - let's call it 'wordpress' - that I need to allow to access a few catalog tables in another e-commerce database on the same server. I've configured the user with three host ...
3
votes
1answer
651 views

Make sure MySQL is not accepting remote connections

I am currently doing development for a LAMP-based website. I do not know what configuration changes have been made to MySQL since it was installed on our server. The way that we use MySQL, there is no ...
6
votes
1answer
5k views

Benefits of running the OPTIMIZE TABLE Query in MySQL DB Server

I would like to know what are the benefits [really practical] that can be reaped by running the OPTIMIZE TABLE tbl_name query in MySQL Server. I checked this once and found that after this is run, ...
1
vote
1answer
815 views

Master to Slave to Slave Configuration in MySQL

We currently have 3 MySQL Servers running; the first which contains production data and is due to be retired mysqld Ver 5.5.28-0ubuntu0.12.04.2 for debian-linux-gnu on x86_64 ((Ubuntu)) mysql> ...
1
vote
2answers
2k views

MySQL slow queries - Fast using PHPMyAdmin , low CPU and RAM usage

I have a site running on Amazon EC2 , which runs fast and contains some reasonably complex MySQL queries. Part of that site is an API which serves out data to another site. These queries are very ...
1
vote
1answer
277 views

Best way to determine if a MySQL InnoDB table is in its own file, not in system tablespace

I have a MySQL development server that uses InnoDB tables in some of the databases. It was originally setup with the defaults so all data went into the system tablespace (e.g the main ibdata1 file). ...
1
vote
1answer
304 views

How to select only the number from “show global status like 'Com_insert';”

The title says it all. How can I select only the number result from show global status like 'Com_insert' ?
1
vote
2answers
2k views

Distributed Transactions between SQL Server 2000 & MySQL Stopped Working

We have been successfully copying data from a MySQL Slave database into a SQL Server 2000 database. The MySQL server is a linked server. I have tried using v3.51 and v5.1.8 of the ODBC connector ...
3
votes
1answer
862 views

Best Approach for Mirroring Data from SQL Server to MySQL

I need help in regards to replicating data from a third party point-of-sale system with a SQL Server backend to a MySQL DB. Specifically, can anyone suggest a best way to mirror data from SQL ...
2
votes
1answer
442 views

Schedule replication of SQL Server views to MySQL remote database

I have a Microsoft SQL Server 2005 Database inhouse I have to publish some information on the internet and I can't (for security policy) query this database from the web server. So I came up with the ...
1
vote
2answers
133 views

How to Perform Two Simple Queries using Select Value from First Query

I need to perform a select operation and get the id column's value (single value returned). Using this value, I need to perform two more selects on the same table using UNION ALL (in order to select ...
5
votes
2answers
273 views

Recommended structure? %70 write %30 read. 10M row. 200 query/sec. Select, update, insert, search

Followings are what I need to do on my project: 1- If a search term is new and unique, then add the search term 2- Show lastest searched 1000 search terms (I don't need to store dates of all search ...
1
vote
1answer
3k views

MySQL cannot start

I try to start MySQL /etc/init.d/mysqld start but a get the following messages in mysqld.log 130130 12:12:53 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 130130 12:12:53 ...
3
votes
1answer
4k views

Dump of a mysql table on import replaced existing records

I took a dump using mysqldump.. mysqldump -u... -p... mydb t1 > mydb_table.sql Then I imported the dump in another database having same table, but different records.. mysql -u...-p... mydb < ...
1
vote
1answer
381 views

Which Database to choose: MySQL or Oracle

I have an application generating time series data (32 channels, 22KHz, 6 secs) once a minute. These have to be stored in a database. At the moment I'm using MySQL with InnoDB tables ...
0
votes
2answers
236 views

MySQL Cluster - partitions on disk

I have question about MySQL Cluster: Is it possible to have database larger than amount of RAM? (to not have all cluster data in-memory, but some data will reside on clusters nodes hard disks) ...