Tagged Questions

MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

7
votes
2answers
9k views

What is the safest way to switch the binlog format at runtime?

Because of the following warning in mysqld.log: [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it ...
2
votes
1answer
543 views

Estimating query time

Is it possible in MySQL to know beforehand query execution time? I mean how long it will take to execute the query. Generally its worthwhile to know how long any query can take to execute. At the ...
2
votes
1answer
4k views

Fixing MySQL errors recorded in error logs

Below is the extract of the most common lines of error being recorded in error logs on my PC: 110905 16:16:54 [Note] Plugin 'FEDERATED' is disabled. 110905 16:16:54 InnoDB: The InnoDB memory heap is ...
0
votes
4answers
455 views

MySQL - speed up execution of ALTER TABLE

I have a MySQL DB with innoDB tables. the DB size is about 30GB. I am using ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; to change all the tables characters set and it ...
4
votes
2answers
763 views

MySQL - Changing DB CHARACTER SET

I have a 30GB MySql DB, made of innoDB tables. currently the tables character set is: "utf8_unicode_ci" and I want to change it to "utf8_general_ci", what the best way to do it? currently i'm going ...
3
votes
2answers
3k views

MySQL Replication Troubleshooting

Here's what I did. On the master, change /etc/my.cnf: [mysqld] server-id=1 log-bin=mysql-bin innodb_flush_log_at_trx_commit=1 sync_binlog=1 Save and restart mysql, then log in. >GRANT ...
1
vote
1answer
74 views

Is storing values of a unique field shared between many web forms bad practice?

I am curious if it is considered a bad practice to use a unique table to store values asigned to a unique field that is shared between several webforms. The site with webforms will carry thousands or ...
3
votes
1answer
588 views

Is it possible to compare timestamps between rows?

I have a MySQL table reqs with (this is simplified from actual): | Field | Type | Null | Key | Default | Extra | ...
3
votes
3answers
13k views

Where does my.cnf get stored in Linux?

I am new to linux, and i just installed MySQL-server-5.1.59-1.glibc23.i386.rpm in my linux machine. I wanted to know where my.cnf file gets stored..? Will my.cnf gets created with the installation ...
1
vote
1answer
351 views

Precomputing expensive aggregations

I'm looking for a tool that will let me precompute expensive aggregations some time after rows have been inserted into a MySQL database. For example, if I often run a SUM() on a column, I'd like to ...
8
votes
3answers
6k views

What is the default order of records for a SELECT statement in MySQL?

Suppose you have the following table and data: create table t(k int, v int,index k(k)) engine=memory; insert into t values(10, 1), (10, 2), (10, 3); When issuing select * from t where k = 10 with ...
6
votes
2answers
2k views

How can I improve my SQL statement with weekly results with week starting on Thursday or any other day of the week?

I am a total newb, and I couldn't find a good way to do this anywhere. I have a database table that contains statistics that are recorded at various time throughout the week. The reporting week ...
1
vote
1answer
610 views

How can I get the maxium number of concurrent connections to MySQL over a specific time interval?

I have a monitoring app that checks MySQL's Threads_connected and Max_used_connections variables every X seconds. Neither of these variables tells me what I want to know: The highest number of ...
3
votes
1answer
158 views

Extreme storage beasts

Intro I have derived this question from my previous question Single Drive vs Multiple Drives After getting a very detailed answer from a very helpful member RolandoMySQLDBA and learning the fact that ...
6
votes
2answers
932 views

Single Drive vs Multiple Drives

Generally bottleneck of RDBMS (I am a MySQL user) performance is disk access. SSD provides great performance compared with conventional spindle drives. Question : Is it possible to improve ...
3
votes
3answers
724 views

Converting CHAR to BIT

I have a column with char(16) data type and it was mistakenly set to char(16) actually it should be bit(1) because it contains only three distinct values as follows: 16 characters long string 10 ...
4
votes
2answers
1k views

Trying to get multiple mysql instances running on Ubuntu dev box

I'm trying to get multiple instances of mysql running on a dev box for some testing. This guy is running ubuntu so the setup's a little different than our production setups. I'd like to find the ...
0
votes
1answer
106 views

How should I model this data?

I have a need to model the following requirement for a web application (PHP/MySQL5): A user can compete in a distance-based challenge which consists of entering progress along a defined ...
5
votes
3answers
7k views

Best of MyISAM and InnoDB

Is it possible to make InnoDB to use indexes same as MyISAM instead of clustered index due to limitation of RAM while getting benefit of its concurrency performance?
1
vote
1answer
369 views

Is it possible to fetch or update table data by table field type?

Is it possible to fetch or update table data by field type? If possible please tell me with a sample code.
1
vote
2answers
275 views

Table partitioning

Recently I have been looking to optimize my database and its size is 7GB. I have an option to partition big table. But partitioning would just divide the big table into small ones while remaining on ...
4
votes
2answers
2k views

Database design for dynamic Meta fields of an entity that shall be queried intensively

I'm designing a database structure for a system at which an entity can have a dynamic set of user-defined meta attributes. The meta fields (e.g.: popularity, conversion etc.) and skill values (int, ...
1
vote
2answers
878 views

MySQL: How does AES_ENCRYPT turn the password into a key?

I am trying to figure out how to create the best secure password for AES_ENCRYPT. Specifically, how long should the password be, and how it translates into the 128 bit key length that AES typically ...
3
votes
3answers
505 views

Dynamically changeable database

We have a database and some data is stored in a Trucrypt folder, my question is how can I include this trucrypt folder. The data type is MyISAM. I saw there is a symbolic link, but not really clear ...
14
votes
2answers
26k views

Multi cores and MySQL Performance

Importance of RAM is an established fact but far less material is available about the importance of cores and multithreading when it comes to the usage of CPU by MySQL. I am talking about the ...
4
votes
2answers
3k views

How to convert mysql database charset to utf-8

I have a vb forum with a huge amount of data I need a way to convert this forum database tables charset with thier data from latin1_swedish_ci to utf8-general-ci How to do this ?
5
votes
1answer
2k views

Replicate tables to different database name

Our QA environment has all it's database names suffixed with "test". For example dbname1 in production would have a counterpart dbname1test in QA. (This is largely to help protect against prod/qa ...
4
votes
2answers
258 views

What is the consensus on using NOT NULL constraints on all text-based fields in a table?

Some of the tables I have come across don't have any NOT NULL constraints, which has yielded to some gotchas when querying. I'm curious what the feelings are with using something like NOT NULL ...
1
vote
1answer
129 views

MySQL Index Questions

I have 2 MyISAM tables: table: search_hit with primary key: search_hit_id, and foreign key: search_id (150 million rows and growing with constant inserts) table: search with primary key: search_id ...
7
votes
3answers
1k views

Deleting all duplicates

I am trying to delete all the duplicates but keeping single record only (shorter id). Following query deletes duplicates but take lot of iterations to delete all copies and keeping original ones. ...
1
vote
2answers
3k views

How do you encrypt data while performing a mysqldump?

My OS is windows 7. How can I encrypt data while performing a mysqldump? From the command prompt, can I take a mysqldump with encrypted varchar and texts values? Please help me. Thanks
4
votes
1answer
206 views

Strictly only RAM matters?

I have to work on a project which would have a extra large table with billions of records but only two fields one is id and another is text. And id would be set to BIGINT and PK then if 8+2 (extra 2 ...
5
votes
4answers
3k views

Benefits of table level locking

What are the benefits of table level locking which is used by the MyISAM storage engine? Row level locking has lots of benefits like concurrent updates and reads that do not lock the table. Edit Its ...
0
votes
1answer
471 views

How to avoid table crash?

Couple of days back I had a table with 7GB of data and it was showing 63MB of overhead in phpMyAdmin and I mistakenly started its optimization and after working of more than 40 mins it corrupted the ...
3
votes
3answers
2k views

When do hash indexes become reasonable?

MySQL natively doesn't support hash indexes. So, making a pseudo hash column and creating an index on a hash column needs some thinking. And it seems to be widely understood that if the text field is ...
1
vote
1answer
348 views

Simple select statement not returning correct data

I am trying to return data, where I want the item name (items.name), vendor name (vendors.name), url of the price (prices.url), and the price (prices.price) from 3 different tables (items,vendors and ...
3
votes
1answer
6k views

Equivalent functions in MySQL that exist in SQL Server

In an EXIT HANDLER block, what are the MySQL equivalents of OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID) ERROR_MESSAGE() Edit What I want to do. In SQL Server I'd have CREATE PROC ...
1
vote
1answer
626 views

What is com_set_option?

As the title says, I'm wondering what is this command and why am I seeing a large amount of this query on my database? It's currently 13.30% of my total queries. I've tried googling this but there's ...
1
vote
2answers
293 views

Adding a new slave slowing down previous replicas?

I have a master I was going to start slaving to a new server to do some tests on. This master is currently being slaved to 3 other boxes. After bringing the new slave online it became clear it ...
1
vote
3answers
2k views

MySQL: Trying to update to 5.5

I've followed this instructions, but after mysqld --skip-grant-tables --user=mysql, I'm getting this: 110913 20:29:18 [Warning] Can't create test file /var/lib/mysql/my-laptop.lower-test 110913 ...
4
votes
1answer
1k views

Determining max database and table size supported and present size

One of my MySQL databases has been running on a single PC from the last four years. Here is my setup: MySQL 5.5.14 Windows XP on NTFS partition All of my tables are using InnoDB engine Here are ...
6
votes
3answers
461 views

Is there a need to keep refreshing the indexes from time-to-time?

This question is common for all the database products I use, viz. SQL Server, MySQL, Oracle and PostgreSQL. I have created a fresh database and the tables, at present, have no records. I have created ...
3
votes
1answer
920 views

How do you gain access to embedded MySQL database via localhost command line?

We run an application (Windows 2003 server) and would like to have database connectivity -- contacted the company and they do not have any documentation on how to do so. A quick glance at the ...
31
votes
3answers
46k views

Possible to make MySQL use more than one core?

I've been presented with some dedicated MySQL servers that never use more than a single core. I'm more developer then DBA for MySQL so need some help Setup The servers are quite hefty with an ...
6
votes
2answers
4k views

MySQL Auto_increment going 2 by 2

I installed MySQL Workbench the other day, accessed my company's database and made myself a table to work with. So far so good. The problem is, I noticed my auto_increment is incrementing 2 by 2. For ...
4
votes
2answers
5k views

Internal reason for killing process taking up long time in mysql

I copied a big table's structure with (it is an InnoDB table btw) CREATE TABLE tempTbl LIKE realTbl Then I changed an index, and filled it up so I could run some test. Filling it was done using: ...
2
votes
2answers
360 views

Database Transfer from PostgreSQL to MySQL

Is there any method to tranfer the data and schema from a postgresql database to mysql?
5
votes
2answers
3k views

Is this a normal set of MySQL privileges?

Using phpmyadmin on a local test wamp setup, and well as pretty much the title states, there are 3 users marked as user = ANY, password = NO, such as: USER | HOST | Password | Global Priv | Grant ...
3
votes
1answer
446 views

InnoDB has a transaction running, but “SHOW PROCESSLIST;” shows nothing

I have a replicated database setup, mostly Innodb databases/tables. The query that I believe caused the issue ran in about 20 minutes on the master database. This is where it gets weird. Show ...
4
votes
2answers
2k views

Does a view need its own foreign key constraints?

Disclaimer: I'm a programmer, not a DBA, so bear with me... I have a view that I use to just map 2 entities together. I have to do a join between a few different tables to get that: CREATE OR ...