MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
1answer
990 views

can mysql cli exit with error if no records returned?

I would like to execute a sql command in bash, and do something based on whether or not there was a result. e.g. $ LOOKUP=123; mysql -e \ 'SELECT id FROM table WHERE id='$LOOKUP dbname \ ...
1
vote
3answers
223 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 ...
2
votes
1answer
678 views

MySQL wont start after modifying /etc/my.cnf

I have Linux Red Hat 5, with Zend Server and MySQL Server installed. I am trying to change the default MySQL port to 512. However, after making this change, MySQL will no longer startup. I get the ...
3
votes
1answer
906 views

mysql: find column data size on disk

I have fairly large MyISAM table with longtext field in it Table size is somewhat 16GB. I need to know if clearing this column in old records helps to keep table small I can retrieve table wise ...
10
votes
6answers
7k views

Splitting Tables in MySQL. Good practice?

I have started working on an existing project and the previous developer had split up a table into 10 separate tables with identical schemas but different data. The tables look like this: ...
3
votes
2answers
2k views

pt-table-checksum with slaves using non-standard ports

Trying to run pt-table-checksum to detect slave drift in MySQL replication. My slaves are not using the standard TCP listening port however, and so when I run the tool I get an error: Cannot connect ...
0
votes
3answers
537 views

Is any tool for taking MySQL Dump Automatically with a particular time?

I am using VS2010 and MySQL for my project. My Client want to take MySQL Dump Every Day like Daily Backup. So I want to give a tool for Taking MySQL Dump with a particular time. Do you know any tool ...
0
votes
2answers
2k views

Time to import an sql dump

I'm currently uploading one of Wikipedia's dump files. It has 1GB compressed and ~7GB uncompressed. It has been importing it for 6 hours already. The size of the imported table in MySQL is at the ...
5
votes
1answer
883 views

Quick MySQL Backup (1 file per table)

I asked a relevant question few months back and got answer with wide variety of options for backup. But this time I have different scenario and I have got a database with 7 tables and 1 of them has ...
1
vote
2answers
2k views

How to keep one query from slowing down entire database?

Using MySQL 5.0.x, we have a process to generate benchmarks for our business that consolidates a bunch of data, then pull out data based on certain criteria. This process used to take 18 hours, it's ...
5
votes
3answers
4k views

How much memory will a MEMORY table take up?

Let's say I have a MyISAM table with a data length of 4.8GB and an index length of 6.2GB. So, a total data size of eleven gig. How much memory would this require, were I to convert it to a MEMORY ...
4
votes
1answer
2k views

Not enough space for MySQL optimize; do new rows overwrite existing data?

My MyISAM table consumed most of my disk space. I deleted a significant portion of the table, but the optimize command (to clean out the deleted data) does not have sufficient space. Is there any ...
1
vote
1answer
280 views

mysql event running at wrong time

I created an event to run every 24 hours and be run at 14h. Its selects some data from tabels and writes it as to a file (csv format) The query and writing to file goes ok. The event is triggered. ...
3
votes
1answer
689 views

mysql change schema on the fly

Recently I faced the problem that my Db became very huge and I cannot allow to myself downtime every time when I want to change the schema. This caused me to start looking for solution that do schema ...
9
votes
2answers
8k views

move data folder and drive mysql centos

i need to move the data to a different folder and drive on my cent os db server. i added new hard drive (since we ran low on space), i have a 1tb of hard drive and i have a new 2tb i want to put the ...
1
vote
1answer
760 views

MySQL Cluster: cannot start the management node

When I try to start the management node of MySQL Cluster on Windows platform, I get the following error: Could neither create or open key ...
1
vote
1answer
924 views

I am getting an error while trying to download binary for mysql 5.5.11

I am trying to upgrade MySQL 5.1 to 5.5.11 on Ubuntu 10.10. Everytime I try the wget command I get this error: wget ...
3
votes
4answers
6k views

Is MySql locking table during backup and how to avoid?

I have a scheduled backup that runs daily in MySQL and I have noticed that during the backup a lot of queries that query a frequently used table seem to take forever to complete. This causes the ...
2
votes
1answer
2k views

importing myisam 5.0 database into a 5.5 innodb server

I have MySQL 5.0 and 5.5 servers (but not a 5.1 server). The 5.0 server is myisam only, the 5.5 default is innodb. I need to move a database from the 5.0 server to the 5.5 server. The database is ...
2
votes
2answers
11k views

MySQL - CSV UPDATE (not INSERT) into existing table?

I have a table with the following columns: id | name | city The table has 1000 entries in it. I have a CSV file with a limited number of lines like this: id,city 34,Denver 45,Kansas City 145,New ...
3
votes
1answer
4k views

I have lots of free memory. How do I use it to increase performance?

I am running Litespeed (with suExec, PHP SAPI), MySQL, DirectAdmin, named on a VPS with a 16-core Xeon CPU and 2GB RAM. Currently, only 300 MB out of 2048 are used. It might sound a stupid, but how ...
4
votes
1answer
676 views

Mysql crashed once with an “Assertion failure” this morning, how worried should I be? best way to diagnose this?

So for the first time our production system produced the below assertion failure. The system came up without issues after mysqld automatically restarted itself and rolled back some transactions.. ...
1
vote
1answer
2k views

updating mysql primary keys

I need to be able to swap values that are used in a primary key. Meaning, in one update statement, I need to change id 1 to id 2, and id 2 to id 1. In other relational databases, (Sql Server and ...
2
votes
2answers
2k 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 ...
10
votes
5answers
16k views

Why is DROP DATABASE taking so long? (MySQL)

New CentOS installation. I was running an import of a large DB (2GB sql file) and had a problem. The SSH client seemed to lose the connection and the import seemed to freeze. I used another window to ...
3
votes
1answer
180 views

How can I find the user who performed a database transaction?

I am using MySQL database. Suppose a database "X". It is used by multiple users. I want to find those users who performed any transaction of data into this database. Is it possible? Can I find it ...
1
vote
1answer
365 views

“SQL_NO_CACHE” for innodb buffer pool

I'm guessing the answer is no, but I was wondering if there was anyway to tell innodb to not store fetched pages in the buffer pool? The reason for looking at doing this is check summing tables. I'd ...
2
votes
1answer
157 views

MySQL optimization question — how to speed up a simple query

I have a very simple database, one table with five columns (one INTEGER key, two VARCHAR, a DATE, and a DOUBLE). The table contains 909,000 records. A simple query like SELECT t.price FROM ...
3
votes
1answer
5k views

Mysql fulltext search my.cnf optimization

I have open a question on http://serverfault.com/questions/353888/mysql-full-text-search-cause-high-usage-cpu Some user recommended asking here. We built a news site. Every day we will input tens of ...
2
votes
2answers
267 views

MySql - find redundant indexes

is there a tool that spots redundant indexes in MySql? e.g. if I have the following indexes: index1(col1) index2(col1,col2) then index1 should be flagged as redundant. any ideas?
0
votes
0answers
437 views

Oracle Flashback Archive aka Total Recall in MySQL [closed]

What would you suggest as a replacement system to achieve the same functionality of Oracle Flashback Archive aka Total Recall in other DBMS, in general or specifically in MySQL or MariaDB? ...
3
votes
1answer
406 views

MySQL text field without quote

I've just run into something strange. The base_id is a varchar(255). When I do a SELECT without quote, it scans the whole table: mysql> EXPLAIN SELECT sid FROM rf_fo.scald_atoms WHERE base_id = ...
4
votes
2answers
723 views

Less RAM than Index_length MyISAM

I'm working on a database to store "time series" data (the value of X was Y at this time). The rows themselves are very small and static in size, with the primary key consisting of two smallint ...
2
votes
1answer
998 views

MySQL Tuner OPTIMIZE and Defragmentation

I have just started using mysqltuner to help keep my mysql server fast and healthy. However, I am having a little trouble optimizing my tables. When I execute mysqltuner, it all works fine and returns ...
2
votes
3answers
142 views

MySQL operations on grouped fields

I have one table t1 like this a|b|c -|-|- 1|1|2 1|1|3 1|1|6 1|2|3 1|2|4 1|2|7 1|3|5 2|3|2 I would like a query where the results would be similar to running multiple selects like this: (SELECT * ...
3
votes
1answer
693 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 ...
5
votes
1answer
1k views

Substantial difference between database size under MySQL and actual size on disk

When I check the size of my databases under MySQL I get this: MariaDB [(none)]> SELECT table_schema "Data Base Name", sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB", ...
1
vote
1answer
998 views

mysql error log issue

I have mysql server running successfully. The error log location is as.. mysql> show variables like '%log_erro%'; +---------------+------------------------+ | Variable_name | Value ...
3
votes
1answer
6k views

Mysql master-master replication auto flush old logs

I have mysql-5.1.41 master-master setup running on ubuntu machines and below is the configuration of a master: skip-host-cache skip-name-resolve event_scheduler = ON max_connections = 500 ...
8
votes
1answer
6k views

Is it possible to change ENUM() lists?

I wasn't sure if changing ENUM() list isn't possible so I made a test. In MySQL v5.1.58 I made a test InnoDB table that contains one field called 'bool' of type ENUM('yes', 'no'). Then I executed... ...
7
votes
3answers
275 views

Using Replication for Scale-Out

Having read Using Replication for Scale-Out, how can I route different queries to different servers, for example, SELECTI want to route to slaves and NON-SELECT to master. I assume as loadbalancer I ...
1
vote
1answer
1k views

Looking for a tool to convert between MySql, Sql Server CE, Sql Server and SQLite [closed]

Our old product supports 4 different database types for storing data: SQLite MySql Sql Server CE Sql Server There is also an export feature, which allows to export some data and here is the ...
1
vote
2answers
130 views

Improving MySQL efficiency

I have a table now containing over 43 million records. To execute SELECT, I usually select records with the same field, say A. Will it be more efficient to divide the table into several tables by ...
14
votes
2answers
17k views

What is the recommended way to backup a MySQL/Amazon RDS database to S3?

I have two purposes for this: To have an offsite backup in case of a region wide problem with Amazon Web Services. To copy production data from a production billing account to a beta billing ...
3
votes
1answer
7k views

MySql - ERROR 1071 Specified key was too long; max key length is 1000 bytes while restoring dump

while trying to restore a MySql Dump, i get the following error: ERROR 1071 (42000) at line 25: Specified key was too long; max key length is 1000 bytes any ideas?
3
votes
1answer
359 views

Is there a generic framework/design pattern/library for real time replication of MySQL database onto other servers?

Summary I need to backup in real time updates/inserts to a MySQL database. Cron/batch jobs appear to be unsuitable for this particular requirement due to the time interval meaning that the data would ...
1
vote
2answers
18k views

How to join two table and show one query result in MySQL?

I have a table1 (records 3), and table2 (records 3). Where i have field name in both. Now i want to make a result from those two table, which will show me both table records and take only one if there ...
2
votes
2answers
657 views

MySQL Views Authorization

Questions: Is there a way, using SQL, to identify how many views are in the database per user? How can you authorize/deny users access to delete views created by another user?
2
votes
1answer
5k views

MySQL Workbench 5.2 edition - Unable to establish the connection

I have installed MySQL (mysql-workbench-gpl-5.2.37-win32.msi ) which is a Windows Installation Workbench. Couple of times, I have done re-installation on my computer. Now, I am not able to establish ...
2
votes
1answer
3k views

Repairing Myisam Table when there was no additional Disk space & Table corrupted

I had a table which MyIsam as storage Engine contains million rows. There is a purging task and need to remove 35 days old data. i measured up the rows in following manner : mysql> select ...