MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

4
votes
2answers
766 views

Read mysql config (my.cnf) using mysql console

I have a mysql server that is not under my control (I don't have ssh on that machine). I only have access to one database using mysql client. How can I have access to config options that are declared ...
3
votes
2answers
3k views

Creating and editing my.cnf by MySQL Workbench?

I just installed MySQL Server and MySQL Workbench on a clean Snow Leopard MacBook. I hooked up Workbench with the server and was able to start the MySQL Server from within the Workbench. I enter the ...
1
vote
1answer
217 views

Is there any way to increase the mysql reserved pool for super users beyond 1?

http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html States that there is 1 connection beyond your maximum number of connections for users with the super privilege. My question is can ...
3
votes
1answer
833 views

Keeping MySQL staging database on same server updated from production

I just migrated my MySQL 5.5.20 to Amazon RDS from MySQL on EC2. The one thing I'm having difficulty with is how to keep my staging database updated from production. Before, I just ran a nightly ...
3
votes
1answer
328 views

index not being used

I have an exact same myisam table on master and slave. The indexes are not being used on Master server. mysql> explain select count(date_time) from ox_data_summary_ad_hourly where date_time = ...
2
votes
1answer
95 views

Linking identifiers across tables in MySQL (Foreign Keys)

Given a simplified example of two tables table Contact(ID int primary key, Name text not null) table ContactPhone(ContactID int not null, PhoneNumber text not null) Is there a way to tell MySQL ...
2
votes
2answers
273 views

What does Threads_connected=-1 signify in MySQL?

I was running the following: mysqladmin -u root -p ext -ri 10 | grep Threads_connected and was kind of surprised to find that Threads_connected could be -1: | Threads_connected | 1 ...
5
votes
1answer
2k views

Find out MySQL index size for a concrete index

In MySQL, for InnoDB engine, how do I find out the size of one of the indexes I have in the same table ? I know I can select the index_length from information_schema.tables, but this gives the total ...
3
votes
3answers
102 views

A join aggregate behaviour I can't understand

Query 1: SELECT c.class_id, SUM ( CASE WHEN s.student_id IS NULL THEN 0 ELSE 1 END ) as total_students FROM classes c LEFT JOIN students s ...
2
votes
2answers
479 views

What is this host?

I found this in my local MySQL installation today: mysql> select host, user from user; +--------------+---------+ | host | user | +--------------+---------+ | ::1 | root | | ...
1
vote
1answer
250 views

MySQL replication risks for the master

I have a production MySQL server, fairly heavily loaded with an INSERT-only load on one of its databases. I'd like to attach a non-production (sitting on my desk, more or less) replication slave to ...
3
votes
1answer
4k views

How can I find who holds the lock based on the hex-dumped?

I've been reading the Diagnosing MySQL InnoDB Locks article. Karl E. Jørgensen writes on 2008 so I'm consfusing it is in effect. I would like to supply a snippet of the SHOW ENGINE INNODB STATUS: ...
2
votes
2answers
1k views

MySQL Replication via DNS Failure

I'm having some trouble using replication when the machines are configured to use host names instead of IP addresses. The "skip-name-resolve" is OFF. If I use IP addresses, everything is fine. Using ...
5
votes
4answers
2k views

MySQL subquery slows down drastically, but they work fine independently

Query 1: select distinct email from mybigtable where account_id=345 takes 0.1s Query 2: Select count(*) as total from mybigtable where account_id=123 and email IN (<include all from above ...
2
votes
2answers
3k views

MySql - Read only on slave

I want to make my MySql slave read only, i've been looking and found the read_only option, but its says that users with super privalges can still write (if i understand the text correctly), here is ...
2
votes
2answers
542 views

how to insert multiple columns(around 40) into my sql database using java

i have a program to read the content of an excel file to my-sql db. i have 40 columns in excel and i created a table of 40 fields. and i want to import the data from excel into corresponding table ...
2
votes
1answer
122 views

MySQL switch between data directories for individual databases

I'm in the middle of designing a solution to an issue we're currently experiencing while writing to certain large MyISAM tables. The database in question basically stores information regarding two ...
2
votes
1answer
882 views

ACID-compliance of MySQL master-master replication?

I've created two MySQL 5.1 servers, replicating off each other (log-bin) in a low latency environment (different AZs within an EC2 region). All tables that are being replicated are using the InnoDB ...
1
vote
1answer
1k views

When to open your MySQL cursor

A relatively simple question but from all my research I have been unable to find a decent answer. Which is technically more correct, open your cursor after your handlers have been defined or before ...
1
vote
2answers
721 views

Database Design - Employee Clocking In and Out System

I want to develop Employee Clocking In and Out System (website). I am concerned two things: If staff forgot to 'Clock Out' from yesterday and they have 'Clock In' today, it should flag to the ...
2
votes
1answer
173 views

Entries disappeared, auto_increment also reversed, web app security vulnerability or DB Error?

I am using Mediatemple's Grid Hosting (GS) platform to host a wordpress site. The DB tables are using the MyISAM engine. I had noticed that a previous article had disappeared from the site. At first ...
2
votes
1answer
1k views

“Data truncated” vs “Incorrect string value”

I'm trying to figure out the difference between some warning messages related to data truncation. Consider the following table: CREATE TABLE `txttest` ( `mycol` text NOT NULL ) ...
2
votes
1answer
1k views

alter table (mysql) adding column with default value of space (' ')

On my Mac, using 5.5.11 MySQL Community Server (GPL) alter table foobaz add column ( extendedTitle varchar(3000) DEFAULT NULL, clasindxIndent int, spacedash1 enum (' ', '-', '1') default ' ', ...
1
vote
1answer
495 views

Unable to connect to MySQL cluster database

I am unable to connect to mysql cluster database after starting my management node, data node, mysql node. I made the necessary changes by adding the loadbalance in the dbURL. But I am not able to ...
3
votes
1answer
3k views

How do I show warnings when loading data created from mysqldump?

I've got a large .sql file with large insert into ... values ... statements. Many of these statements are generating warnings during execution. How can I get mysql to print the warnings? If it hit ...
5
votes
2answers
7k views

Calculating disk space usage per MySQL DB

I am currently using information_schema.TABLES to calculate the total disk space usage grouped by the database name, but it is running terribly slowly. On servers with hundreds of databases, it can ...
1
vote
1answer
417 views

Can I use the “import” tool on PHPMyAdmin multiple times?

I am moving databases between a couple of shared hosting accounts, and both of them only give access to the MySQL databases through phpmyadmin. The importing account's upload limit is 50MB. I would ...
3
votes
1answer
643 views

mysqladmin debug writes out Current locks but PROCESSLIST and INNODB STATUS don't show any

I'm using the 1.1.8 mysql-cacti-templates to gather metrics on MySQL 5.0.77 (CentOS 5.7). Both the InnoDB Current Lock Waits and InnoDB Lock Structures graphs are charting with Cur[rent] values but ...
3
votes
1answer
5k views

Creating a table from variable names

Is it possible to create a table from a variable name? For example I have the following stored procedure that I'm trying to write but it will not compile past with the create statement. CREATE ...
6
votes
4answers
7k views

How to improve InnoDB DELETE performance?

So I have this audit table (tracks actions on any table in my database): CREATE TABLE `track_table` ( `id` int(16) unsigned NOT NULL, `userID` smallint(16) unsigned NOT NULL, `tableName` ...
3
votes
1answer
1k views

Change MySQL's temp directory

I'm trying to add keys to an InnoDB table. I started with the small ones(~6.8GB) and I encountered a problem. After a while of processing it throws an 1114 error(table is full). I restarted the ...
1
vote
1answer
1k views

Soft delete: Copy row data to archive table when deleting

How can I move data from my current table to an archive table when a delete is called on the table? My current table and archive table needs to be in sync in their schema too. Can someone help ...
5
votes
2answers
14k views

How to log verbose output from mysqldump?

You typically save the verbose output of a Linux command like this: # command > output.txt But when you use a command like mysqldump, the > option outputs the dump of the database tables to ...
1
vote
3answers
169 views

how to set default charset while create new field

Is there any command in mysql that makes the following: if I create a new field and I set the type to TEXT than it automatically knows that by this I mean not latin1_swedish_ci but utf8_hungarian_ci ...
3
votes
2answers
579 views

Testing Query Speed

When I'm running a query for the first time, it takes x miliseconds to be executed. When I run it the second time it takes a lot less time. I assume that it is some caching involved in this mechanism, ...
2
votes
1answer
3k views

How is INDEX on Composite Primary Key in mysql?

When making a composite primary key for two or more columns, e.g. PRIMARY KEY(col1, col2, col3); will the system INDEX each column individually? The reason that I am asking this question is that when ...
4
votes
1answer
76 views

Internals of Windows-to-Windows SQL Server data transfer

This is a sort of generic question and I don't require a very specific answer, but let me ask it by describing a scenario. You connect to a remote db in SQL Server Studio 08, and run a select * ...
2
votes
3answers
607 views

Need help configuring Memcached to store values in MySQL Cluster

I am working on a Memcached implementation with MySQL Cluster 7.2. I have installed and configured memcached with following parameters: PORT="11211" USER="mysql" MAXCONN="1024" CACHESIZE="1024" ...
2
votes
1answer
506 views

Is the “load data infile” command in MySQL unsafe in general, or just when using statement based replication?

I'm also trying to understand why MySQL considers "load data infile" unsafe and switches to RBR if running in mixed mode, does that mean it is only unsafe when using SBR?
3
votes
1answer
2k views

How do I diagnose missing rows on a MySQL slave?

I'm running traditional master/slave replication on MySQL 5.1.52, my master is set for statement based replication. A few tables are missing rows on the slave (differing row counts), these tables are ...
2
votes
1answer
693 views

how do I limit the characters in selected row and con-cat with '…'

I have a query which return a column named comment. I want to limit the number of characters returned by select statement to 50 and if the comment row contain more than 50 characters, I want to append ...
3
votes
3answers
1k views

How to restructure this slow query containing subquery?

This query takes about 2-6 seconds to run depending which tag id(s) is/are selected: SELECT t2.id, t2.name, count(*) as kpl FROM (SELECT pt1.post_id FROM posts_tags pt1 WHERE pt1.tag_id ...
1
vote
2answers
3k views

How do you install MySQL 5.1.34 on CentOS 5.5?

I am trying to install Mysql 5.1 on cent OS. I researched a lot but could not find any link which gives step by step procedure. Everywhere, there are vague answers. Can someone please give me steps ...
5
votes
1answer
186 views

Will I need more system resources to run DB2 instead of MySQL?

I need to convert my web application from MySQL to run on DB2. I need to know in advance whether I will need a high spec server to ensure the web application performs at the same speed as it does now ...
1
vote
1answer
2k views

strategy for enabling a general query log on MySQL 5.0.95 with no restart?

I would like to configure a general query log for a busy MySQL 5.0.95 production server without effecting the availability. Obviously I can set the "log" option in the my.cnf file and restart the ...
1
vote
2answers
6k views

How to use RESTRICT for Foreign Key in mysql?

In the database structure of CREATE TABLE Country ( name varchar(40) NOT NULL, PRIMARY KEY (name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE City ( name varchar(40) NOT NULL, ...
3
votes
1answer
2k views

Can we capture only Slave_IO_Running in SHOW SLAVE STATUS in MySQL

I wanted to capture only status/result of Slave_IO_Running and Slave_SQL_Running column values, which I will be using to integrate into our application. Is there any way to get only the values of ...
0
votes
1answer
319 views

Database Design: What is the best structure for storing site offices and locations?

Background I am creating a database driven web application for the management team at the place I work. Part of this application requires fairly specific locations to be linked with where equipment ...
1
vote
1answer
645 views

Usefulness of Foreign Key WITHOUT reference option

Sorry, if this is naive question, but I searched a lot and did not get a vivid answers. Consider a simple InnoDB FOREIGN KEY without ON DELETE or ON UPDATE I think this will avoid INSERT of a value ...
2
votes
1answer
914 views

MySQL using trigger instead of check

Is there any way that I could use trigger instead of check? like I have CREATE /*!50017 DEFINER = 'root'@'localhost' */ TRIGGER test BEFORE UPDATE ON apply FOR EACH ROW BEGIN ...