MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

3
votes
1answer
1k views

Does the Amazon RDS backup/snapshot service lock tables?

We have a database that is 100+GB. Most tables use the InnoDB engine. A regular dump takes 1-2 hours. If we moved to Amazon RDS, would this backup cause table locks? Does Amazon use a simple ...
4
votes
2answers
2k views

What is the best identifier for a UserID? 64 bit integers, UUID V5, or 64 character SHA256 UID?

I wish to future-proof my application. What is the best type of identifier to use? I am considering: 64 bit Integer UUID 64 character SHA256 I am not developing a distributed system, so is ...
5
votes
1answer
269 views

Prevent users deleting more than a certain number of rows in MySQL

The problem: I have a table with rows, nothing special about it When a database user removes a row, it should increment a number A database user is only allowed to remove 3 rows max in the table A ...
7
votes
1answer
866 views

Friends relations in MySQL

I'm developing a friendship relation in MySQL where friend relation is mutual. If A is friend of B, then B is friend of A. If one of the users end friendship then relation drops. I want to learn which ...
2
votes
2answers
969 views

How do I import a specific line from a text file into MySQL

I'm building an app to import data from a text file to a database. I want to import only specific lines from the text file. With Navicat I found that we could limit number of line when importing ...
10
votes
1answer
6k views

Clarification on MySQL innodb_flush_method variable

Let me begin by admitting that I'm very ignorant of the inner workings of hard disks. So when I read over the manual for the variable innodb_flush_method, it confused me. Can I get an explanation in ...
0
votes
2answers
2k views

MySQL replication fails due to duplicate keys after master is restarted

I'm new to MySQL load balancing, I want to try the master-slave concept. Whenever I setup master-slave for the first time, and both have up-to-date fresh data, that works perfectly fine. However, ...
0
votes
1answer
2k views

Db design for a quiz with variable number of answer choices, and each worth different score in a different category?

I'm working on a question/answer project and having a hard time coming up with a suitable database structure. Each question can have from 1 - "n" answers, and each answer is associated with one of ...
2
votes
0answers
7k views

Alternative OpenSource/free to MySQL Cluster Manager Client? [closed]

I need to deploy a MySQL cluster but initially no bucks for the MySQL Cluster Manager Client. It's at least $5k and I actually think in my case it will go way over that. I looked a lot on Google (a ...
3
votes
3answers
3k views

MySQL: selecting arbitrarily ordered rows after a specific id

Please excuse the awkward wording of my title, I'm not quite sure how to phrase what I'm asking. Suppose I have a table like this: id value 1 10 2 40 3 20 4 50 5 40 Running this query: ...
1
vote
1answer
814 views

MySQL Cluster over WAN: Best Architecture Options?

My company is looking at a multi-data-centre solution for high-availability, fun, and profit. We have businesses across the planet, with the need for MySQL database clustering solutions that can keep ...
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 * ...
2
votes
1answer
532 views

Should I use left join to do my job in this scenario?

What I want to do is to find out the items which appeared more than once in this table: mysql> desc tables; +-----------------+---------------------+------+-----+---------+-------+ | Field ...
4
votes
2answers
1k views

Is my EER Diagram correct? Why use relationships?

This is the first time I've made an Entity Relationship Diagram (ERD) for MySQL. Prior to this, I would never create relationships between tables, I would simply create the tables in MySQLAdmin and ...
4
votes
1answer
1k views

How can I prevent gaps in a MySQL table AUTO_INCREMENT field?

For example, I have a table for user registration: CREATE TABLE IF NOT EXISTS test_user ( user_id int(10) unsigned NOT NULL AUTO_INCREMENT, user_name varchar(50) NOT NULL, PRIMARY KEY ...
1
vote
3answers
2k views

MySQL SSL disabled on Windows

I want to enable an SSL connection to my database. I've created SSL certificates and so on, however SSL remains disabled: mysql> show variables like '%ssl%'; ...
3
votes
2answers
741 views

Rows already DELETEd on MySQL slave; How to DELETE on master?

I have a handful of rows that exist in my MySQL master but not in my slave. Replication is running ok and these rows are unlikely to ever be referenced as it is a store-and-forget type of table. ...
2
votes
1answer
791 views

Mysql: Tell InnoDB to keep a specific table or database out of pool/cache?

I have some tables that are used primarily to keep historical data, or that are only used once a day. I do not want any operations on these tables to disrupt the more important tables present in ...
2
votes
1answer
1k views

MySql - alternate of auto_increment on multiple columns

Since auto_increment on multiple columns is supported in MyISAM engine only and I can't use it because of its drawbacks (table lock, slower writes, no-transacts etc), I am looking for an alternative. ...
1
vote
1answer
245 views

Log to record activity against a database

I've been assigned to create a general log. I need a log that captures what actions were taken, by whom, to the database. Regardless of whether it is a SELECT or an ALTER or etc. We need to keep ...
4
votes
1answer
259 views

Optimizing MySQL -

I've been researching how to optimize MySQL a bit, but I still have a few questions. MySQL Primer Results http://pastie.org/private/lzjukl8wacxfjbjhge6vw Based on this, the first problem seems to be ...
1
vote
2answers
397 views

How to DELETE duplicate entries on a field

I have a huge table that has 1,990,546 users with numerous data. Sometimes I get email lists and dump them into this table also. I want to delete users with duplicate email addresses. However, I ...
0
votes
5answers
66 views

Copy my data from a existing db to a new db

I have a database which has my data's that I have been working for months. Now, I want to delete that db. What concern's me is that the data's that I have might come in handy in the future ...
9
votes
3answers
13k views

How to get the most out of MySQL on a QuadCore machine with 16 GB of RAM?

I'm running a MySQL 5.5 server on my workstation for scientific data analysis and wonder how to configure MySQL in order to get the most out of it performance-wise. The types of query that I typically ...
0
votes
2answers
183 views

How to implement Draft functionality, with attached files?

Should allow for: User can save an entity as a draft, that would normally not be valid in its table (ie some missing values) User can attach files to the draft User can find, sort, and discard their ...
0
votes
2answers
85 views

Tiered permissions to generate conditional data access

I am working to improve the confidentiality and access level of the information presented within a program interface over top of a MySQL database. My goal is to create a two tier system: one based on ...
5
votes
3answers
24k views

How to display database structure in phpMyAdmin?

Is there any way to generate a report of my database structure using phpMyAdmin? What I would like is a table format like the following, and an Entity Relationship table. Table name: List ...
1
vote
2answers
878 views

Very slow performance from MySQL

I have the following procedure: drop procedure if exists deletebatches; create procedure deletebatches() BEGIN declare acount int default 0; declare done INT default 0; declare abatchno ...
0
votes
1answer
81 views

Redundant / partially duplicated data in a DB - how to structure?

I'm building a website for which a large amount of user generated data will be stored in a back end db and will be discoverable by all users. By its nature, a portion of the user entries will be ...
1
vote
2answers
432 views

Where can I find a good tutorial or book for various MySQL performance guidelines? [closed]

Can anyone refer me a good book or a small tutorial for various use cases for database design on MySQL for high load test/high availability scenarios. It should include the following: What are ...
3
votes
2answers
5k views

How to GROUP_CONCAT DISTINCT values in a MySQL query that gets number of records and min/max values?

I'm running MySQL 5.0.88 (Coldfusion8) I have a product search which I'm querying number-of-results as well as min/max prices/rebates across the product table. I also want to include a string of ...
3
votes
3answers
6k views

Test MySQL credentials from Linux command line?

How do you test MySQL credentials from the command line on a Linux server?
1
vote
1answer
2k views

How to design a table for storing news items?

I have a script that can get result from news websites and it will run every hour. The php script will get the title and content. The things I want to store in MySQL are: title content ...
2
votes
3answers
605 views

Tuning Question

Every so often our box is HAMMERED to a crawl %Wait goes to 40 or 50% and connections grows to 300 or so. i think its due to a query running, but i wanted to see if any of the settigns on the mysql ...
1
vote
1answer
345 views

Does this normalized model for artist music records make sense?

I want to make a database about one artist's music records... CD, Vinyl, Cassette, 8 Track, Singles, Ep, Lp, etc... I believe I have a good normalized model that will achieve my needs, however before ...
0
votes
1answer
668 views

InnoDB - Use combined index with primary key on GROUP BY

As far as I know, an InnoDB index always contains the primary index. I cannot get the following to work: SELECT t1.a FROM table_1 t1 LEFT JOIN table_2 t2 on t1.id = t2.refid WHERE t1.b = 99 GROUP ...
1
vote
2answers
104 views

Distributing MySQL database on n systems

I have a webserver in my application which talks to a single MySQL node. Instead of having just one MySQL node, I want to have a cluster of n nodes which form my database. Is it possible to do ...
-1
votes
1answer
302 views

Database for an application similar to Chatroulette

I am making an app that is similar to Chatroulette. When a user starts the app it finds someone that is not currently talking to anyone and have them talk to each other. At any point a user could ...
1
vote
1answer
930 views

How to change the display of an empty string in mysql command line tool?

I'm maintaining a database with InnoDB tables. These tables have some columns of type (from show create table): `val0` varchar(30) default NULL, `val1` varchar(30) default NULL, etc... From the ...
2
votes
1answer
998 views

foreign key constraints on same table

I have a table structure like this. tblquestion ( nQuestionId1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT_NULL, nQuestionId2 INT UNSIGNED ALLOW NULL ); Here..nQuestionId2 has a foreign key ...
1
vote
1answer
226 views

What happens to existing MySQL databases when I upgrade my Ubuntu distro?

I am in the midst of upgrading my Ubuntu distro from 10.4 to 12.4. Fearfully, it asked me for root password on MySQL when I was upgrading the distro. I used to have databases on that server, would ...
1
vote
1answer
1k views

mysql /dev/shm question

I have this in my.cnf: tmpdir = /dev/shm and I'm getting this in my error logs: [23-Apr-2011 10:22:08] WordPress database error Incorrect key file for table '/dev/shm/#sql_30f1_0.MYI'; try to ...
1
vote
1answer
57 views

Handling newsletter mail subscribers data

A simple data structure for subscribers is email, name, phone, building. Currently, Building is a VARCHAR field, however data contained in the field is actually mostly numeric. How can I change the ...
3
votes
1answer
109 views

MySQL - Partially restore binary log

I have restored a dump into MySQL. I also have a binary log, which I want to partially restore, let's say from position 10 - 2500. How can I do that?
2
votes
2answers
386 views

MySql Vs. Postgresql for a blog application

I am designing a blog application. Which of these fits better? In which use cases will mysql be good and for what use cases will postgresql be good?
1
vote
1answer
103 views

Select ``,* from table?

I'm trying to upgrade our database servers to MySQL 5.5. In doing so, I'd like to convert all of our tables to InnoDB to take advantage of several performance benefits. However, we use VARCHAR(50) ...
2
votes
2answers
164 views

Beginner problems administering users on mysql

Very new MySQL user here. Two questions for the community. I seem to have created an account that I can't delete/drop. I can't seem to get MySQL to actually require newly created accounts to require ...
2
votes
2answers
270 views

Database structure for a mailing list.

I am designing a database structure for a mailing list. The data I need to record is the mail recipient data: Since the mail recipient data is not predefined, it is causing a problem. For example, ...
2
votes
1answer
133 views

Reformatting master MySQL server and temporary solution

We have MySQL master and replication servers both running on different machines. We have noticed some system files showing integrity issues in the master machine. Temporarily we would like to make the ...
1
vote
1answer
720 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 ...