MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
2answers
600 views

Which is better for long term database scalability: adding columns or having key/value store

For application, which has few (5-10) settings at the moment but will have a lot more (up to 100) in the future which would be better approach: to add new columns to settings table every time new ...
1
vote
1answer
48 views

Assignment of Thread IDs?

I'm in the process of decommissioning an old mysql server. Of course there's a few things left connecting to it periodically people had since forgotten about. I turned on general query logging to ...
1
vote
1answer
328 views

How is it possible for mysql storage engine to be NULL?

I'm just reading a book and in one of the examples I get notices: That the engine in the information_schema.table is null, how is that possible? Can I create tables without any engine??, is there ...
1
vote
2answers
596 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
2answers
258 views

MySQL Cluster Node Connections

I am a brand new user to the MySQL cluster world (literally hours). I was following a tutorial just to get a simple cluster set up (one management node on one machine, a second machine with a SQL node ...
1
vote
1answer
112 views

create more logs in Mysql, pros and cons?

I just install XAMP in my mac and I'm trying to learn by my own, with books, tutorials and you guys. I'm working in the backup part and I saw I have only a LOG "mysql-bin.000001' : What happen when ...
1
vote
2answers
6k views

MySql - Clean ibdata1

I have a database that its entire size is ~44GB, out of it ibdata1 is ~35GB that doesnt make sense, the size of the data shouldnt be more then 10GB. i use the following query to get an esstimation of ...
1
vote
1answer
418 views

Which Optimistic Concurrency Control method will work out best in the long run?

These are the options I've thought of: DotNet Dave: UPDATE mytable set f1=newval where id=666 and f1 := f1ValueFromSelect Charlie Checksum: UPDATE mytable set f1=newval where id=666 and ...
1
vote
2answers
813 views

Do I need SQL_NO_CACHE for write intensive query?

When I establish a connection to DB, I have to write about 30,000 records with an INSERT statement. I've read in a book that I should do it ! Questions Do I need to do SQL_NO_CACHE ? Is it gonna ...
1
vote
2answers
314 views

why can I only install MySQL 5.1 on cent OS 6.2?

I had Ubuntu 10.10 on my server and MySQL 5.1 version. But since i wanted to update the system, I installed a fresh version of Cent OS 6 only so I could install the latest version of MySQL. But after ...
1
vote
1answer
159 views

MySQL CLuster SETUP

Good day! About MySQL Cluster, is it possible to set it up on only two machines? Is it advisable? We currently have MySQL replication setup on our two databases, and we would like to implement R/W ...
1
vote
3answers
4k views

How to convert a MySQL database to PostgreSQL?

Is there any command line tool for converting the MySQL database to PostgreSQL? I'd also like to know if there is a way to convert the database using the normal mysqldump command.
1
vote
1answer
674 views

How should I update ID field values for all records based on previous values?

I need a SQL query that can update ID fields for all records in a table from their previous values to a new value based on that previous value. For example, if the ID is 1, I want to change it to ...
1
vote
2answers
1k views

Master-Master Replication in MySQL

Good day everyone! I want to clarify something about the behavior of master-master replication in MySQL, with respect to the logs i.e. bin-log and relay-log, it use in performing replication. I ...
1
vote
2answers
2k views

Why is this MySQL proc using cursors failing to retrieve results?

I am importing data from a third-party vendor. I have already imported their tables into my existing database. Now, I just need to iterate through each of their person records, munge it a little bit, ...
1
vote
1answer
2k views

How to use ON DUPLICATE KEY for UPDATE

Consider a table of CREATE TABLE test ( id int(11) unsigned NOT NULL AUTO_INCREMENT, external_id int(11), number smallint(5), value varchar(255), UNIQUE INDEX (external_id, number), PRIMARY KEY(id) ...
1
vote
1answer
1k views

Does the order of keys in compound Primary key make any difference?

Package Package ------- PackageID PackageName CityID PRIMARY KEY (PackageID) UNIQUE KEY (PackageName) FOREIGN KEY (CityID) REFERENCES City (CityID) Package versions: PackageVersion ...
1
vote
1answer
1k views

How to recover the innodb when mysql data dir moved from one system to another system?

I have transfer the mysql data dir from one linux box to another box. When i start the mysql server. I can find that the innodb based DB are corrupted. So, may i know how to recover the corrupted ...
1
vote
1answer
109 views

what are the checklist when looking at MySQL database for first time?

What should I put on my checklist when I look at MySQL database for the first time? I would appreciate your help. Thanks.
1
vote
1answer
520 views

How do you structure a database that allows for groups to be formed/added by users and also be a part of like facebook?

I'm new to databases and web development so a laymen explanation is best for the time being. I'm only in the data modeling phase so no need for specific code. I'm just trying to wrap my head around ...
1
vote
1answer
3k views

How to set a specific directory location for individual MySQL database?

Is it possible to set each database in MySQL to use a separate datadir? I'm running a userdir development (sandbox) server and would like to put the MySQL data files for the database(s) for that user ...
1
vote
1answer
302 views

use of signal for insert statement in mysql stored procedure

I want to create a procedure in which all types of possible errors can be handled using SIGNAL. Below is my stored procedure: DROP PROCEDURE IF EXISTS `spItem`$$ CREATE PROCEDURE `spItem`( IN ...
1
vote
2answers
4k 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, ...
1
vote
1answer
129 views

Mysql database design with XML

I intend to create a wiki webpage, but it has some few more limitations than regular wikis. The content is completely user-editable, but the structure of the page is determined previously. To make ...
1
vote
2answers
920 views

Client to use the slave when the master is down in MySQL replication

Is it possible for the client to use the slave when the master is down in mysql replication? I have already setup a simple mysql replication having a master and a slave. The client connects to the ...
1
vote
1answer
155 views

Tick boxes and Dropdown

Have a look at the image below: This is "Plain Buger" item - customer can select sauces and extras with it. There are different sizes for Plain Burger. I need to translate this UI into database ...
1
vote
1answer
169 views

Okcupid.com (can find matches without accessing a database!?) [closed]

I'm doing a research project on a popular dating site called: OkCupid I would like to talk about how the database is used. After reading this explanation from the Co-Founder of the site, I became very ...
1
vote
1answer
1k views

Copy blob from one row to another

I have a corrupt blob in a row. I'd like to replace that with another blob from the same table. How can I do that with sql statements only? (No file system access if at all possible.)
1
vote
1answer
771 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 ...
1
vote
2answers
7k 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 ...
1
vote
2answers
385 views

All columns of table should be indexed or not mysql database?

I am having one table with 4 columns. I that one is primary key and other three columns are references to columns of other tables. I am using join of these four tables for search filter. These joins ...
1
vote
2answers
355 views

Moving MySQL database from UniServer to Ubuntu Server?

I have set up Ubuntu Server 11.10, and plan to host my website on it. Until this point I was using UniServer to host it in a portable fashion. Using the built in MySQL. This is fine, and through ...
1
vote
1answer
231 views

What's wrong with this update RANK query?

It was updated only the first time I ran it, after that the users_tbl_rank stays the same. $sql = "SET @r = 0; UPDATE users SET users_tbl_rank = @r := (@r + 1) ORDER BY users_tbl_points DESC"; In ...
1
vote
1answer
88 views

Basic sql query problem [closed]

Here is the scenario: lets say I have a database named sqlprac that contains a table named dept. There are two ways to write a query: use sqlprac /*1*/ SELECT dept.deptno, dept.deptname, ...
1
vote
1answer
3k views

MySQL Replication Error

I am getting an Error on Slave as: could not execute Write_rows event on table mydatabasename.atable; Duplicate entry '174465' for key 'PRIMARY', Error_code: 1062; handler error ...
1
vote
1answer
809 views

What is the Best Way to detect if server is a Master inside a Stored Procedure?

I'm want to create a stored procedure/event to do some maintenance tasks. My setups are master/slave configured for failover scenarios (meaning the slave is not used for reporting, just might be ...
1
vote
2answers
672 views

String comparison with integer is not working sometimes in MySQL 5.5

I have upgraded MySQL to version 5.5. Before upgrading when we used string comparison with integer, it was working. Code is "value = 1", here 'value' is declared as varchar(45) and its value can be ...
1
vote
2answers
445 views

Is there a tool or library to extract data from Mysql database files without having the database engine available?

I have a bunch of *.frm, *.myd and *.myi files, which are a MySQL database store. I need to extract the data kept in these files, but I do not have a MySQL database engine at my disposal. Is there a ...
1
vote
2answers
717 views

How to eradicate Mysql Slave Replication delays when huge updates from master

At my environment we had slave replication with mysql server version 5.1.47 enterprise version.When ever there is huge updates from master, slave is lagging behind the master. What is the best ...
1
vote
2answers
4k views

Deleting duplicates with group by and count

What is the fastest method to convert the following query: SELECT COUNT(*) as c FROM tbl_fields WHERE fieldnotes IS NULL GROUP BY fieldno,fieldserial,id,fielddate,fieldsid HAVING COUNT(*) > 1; ...
1
vote
1answer
2k views

Sudden MySQL error: Unable to connect to any of the MySQL Hosts

I am using MySQL Community Server 5.5.18 on Windows 7. My application was running absolutely fine without any troubles but since morning it is giving strange messages while opening reports. Reports ...
1
vote
1answer
90 views

mysql server password change while restoring

I restored all database backup from another server's dumpfile to my machine. At the end my mysql server's password changed to that mysql server's password. Why it got overwritten? What i need to do to ...
1
vote
2answers
291 views

MySQL statement in Project Voldemort site

I've just entered Project Voldemort (a NoSQL key-value datastore) site, and saw something interesting: "Unlike MySQL replication, both reads and writes scale horizontally" Well, seems like ...
1
vote
2answers
168 views

Two master databases for two separate apps

We have two different websites one is hosted in asia datacenter called it asiadata.com and other site is hosted in europe datacenter called it europedata.com. Currently we have only one master ...
1
vote
2answers
4k views

Set up a MySQL slave using mysqldump to get the initial data

I have a master database which already has some data in it. The tables in the master database include both MyISAM and InnoDB engines. Now I want use mysqldump to dump the initial data of my slave ...
1
vote
1answer
83 views

What is QP layer?

From blogs.innodb.com: InnoDB Memcached with Binlog Capability In our earlier Labs release, we presented a MySQL NoSQL solution through InnoDB Memcached Daemon Plugin (see earlier Calvin’s and my ...
1
vote
1answer
170 views

What is a better way to keep “user online”?

I'm working on software for social network and I plan it to scale a lot. Actually, I'm updating timestamp column every time user clicks, to be sure they're marked as online. When they do not click for ...
1
vote
1answer
1k views

MySQL Very Slow for REALLY Simple Operations

Something appears to be wrong with my MySQL even with very, very simple operations on almost empty (~100) tables E.g. DROP TABLE IF EXISTS hookup_gender takes 10+ seconds mysql> show processlist; ...
1
vote
4answers
4k views

Connect to MySQL (WAMP) via SSH

Hi I installed the latest WAMP on Windows 7. I would like connect via SSH to MySQL database and create dump. As SSH client I use PUTTY. I tried using the root account and also other accounts, but I ...
1
vote
1answer
4k views

Function returning “No data - zero rows fetched, selected, or processed” in MySQL 5.5

I have upgraded MySQL version to 5.5.16 After upgrading, some of the functions are giving warning as No data - zero rows fetched, selected, or processed. In those functions, cursors are there, but ...