MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

4
votes
2answers
8k views

Is my.cnf for mysql 5.5 is suitable and well tuned for below hardware spec?

My Hardware Spec Technology: Ivy Bridge CPU: Intel Xeon E3 1245v2 Intel Smart Cache: 8MB Cores / Threads: 4 / 8 Frequency: 3.4GHz+ / 3.8GHz Turbo Boost RAM: 32 GB DDR3 Hard disk: 2x 2TB SATA3 Raid 1 ...
-4
votes
0answers
77 views

Can I move up rows in the memory itself? [closed]

Lets say i have the following table : id col2 col3 1 1 1 2 2 2 3 3 3 4 4 4 And I'm trying to move rows to different ...
1
vote
3answers
187 views

Where can I learn about MySQL master/slave, master/master, or clustering setups?

What are the best resources you've read or watched about setting up master/slave or clustering for database replication? I don't know much about this. I have a database that is getting rather large ...
3
votes
2answers
1k views

Implementing soft delete

Could someone please show or describe to me how to implement soft deletes? I have table of vouchers with these fields: id, username, password, serial. I want to display a given number of rows ...
2
votes
4answers
3k views

Tons and tons of relay logs on a master

I have a master that has 298 relay bin files as recent as today, going back well 298 days. There is no relay-log definitions in the .cnf and mysql> show variables like '%relay%'; ...
1
vote
1answer
6k views

How to return resultset from MySQL Stored Procedure using prepared statement?

DELIMITER $$ CREATE PROCEDURE List_IL() BEGIN DECLARE Project_Number_val VARCHAR( 255 ); DECLARE Temp_List_val VARCHAR(255); DECLARE Project_List_val VARCHAR(255); DECLARE FoundCount INT; ...
21
votes
5answers
13k views

Performance implications of MySQL VARCHAR sizes

Is there a performance difference in MySQL between varchar sizes? For example, varchar(25) and varchar(64000). If not, is there a reason not to declare all varchars with the max size just to ensure ...
5
votes
1answer
8k views

InnoDB - High disk write I/O on ibdata1 file and ib_logfile0

Server Specification: VPS with following info model name : Intel(R) Xeon(R) CPU E5649 @ 2.53GHz MemTotal: 2058776 kB MemFree: 244436 kB We are running IP.Board from Invision ...
2
votes
2answers
454 views

Relational database for address model

I want to design an "Address" model for all types of entities like users, businesses, etc. I have two types of main models: one is User and the other is Business. Each one has different address types ...
2
votes
1answer
4k views

16 Cores 12 GB RAM server MySql Configuration - my.cnf

The server takes 20+ seconds (wait time/slow IO response time) to response to a HTTP request even with memcached and APC installed. I believe this has something to do with MYSQL since the site as lots ...
30
votes
5answers
5k views

When is the right time to use MariaDB instead of MySQL, and Why?

What we earn and what we lost with this migration? What should I expect as drawbacks after the migration? Is it really unnecessary to change the applications in any situation?
3
votes
1answer
114 views

Screwed up replication by sharing server ids

So I had my screwup for the week today. I was adding another pair of slaves and set the same server ID on the new slave as an old slave. The layout kind of looks like Master | | \/ | oldS | ...
1
vote
1answer
460 views

Convert the IP Address range to two BIGINT for faster lookup

I am working on a project in which we need to do IP Address lookups. So for this we have got the datasets which will look like below and now the next steps is to populate this datasets in to the MySql ...
11
votes
5answers
32k views

How to properly kill MySQL?

I have CentOS 64bit with CPanel installed and I use service mysql stop However, it keeps doing ..... for minutes and it never stops. It used to be instant. Any idea why it does that and how to fix? ...
2
votes
2answers
175 views

Representing SQL constraints on a table

I have this table: CREATE TABLE `sold` ( `part_ID` INT(11) NOT NULL , `date` DATE NOT NULL , PRIMARY KEY (`part_ID`, `date`) , FOREIGN KEY (`part_ID` ) REFERENCES `part` (`part_ID` ); This ...
2
votes
1answer
49 views

How to read this output from MySQL?

Query that is being ran: INSERT INTO `log_url` (`url_id`, `visitor_id`, `visit_time`) VALUES (?, ?, ?) Error that is being thrown: SQLSTATE[23000]: Integrity constraint violation: 1062 ...
0
votes
1answer
338 views

Mysql Join with filters

I have two tables: MAINCOLOR and SUBCOLOR with the data as: MAINCOLOR : MAINID COLOR 1 RED 2 BLUE 3 GREEN SUBCOLOR: SUBID MAINID SUBCOLOR STATUS 1 1 PINK 0 2 1 ...
2
votes
1answer
289 views

Physically migrate MySQL without a dump

A client ask me to migrate his MySQL DB: The server doesn't have free space and it also has a very big table that is broken, so I can't dump it. I can't REPAIR it because of lacking of free space. ...
0
votes
1answer
88 views

Do I need tweak something for this MySQL setup?

I'm running a fairly popular website with the following stats and setup. stats: ~250,000 pageviews per day, rendering ~47 queries / second to MySQL setup: the MySQL instance is running alone on a ...
1
vote
0answers
2k views

'Incorrect datetime value: for column 'last_login' at row 1'

i am getting below error: Last_SQL_Errno: 1292 Last_SQL_Error: Error 'Incorrect datetime value: '2013-03-10 02:00:00' for column 'last_login' at row 1' on query. Default database: 'platform'. ...
0
votes
2answers
877 views

How are DB locks tied to connections and sessions?

I've heard of page- and row-level locks, but never heard them used with regards to sessions and connections. Today, our (MySQL) DBA was talking about row locks and implied that their scope can be set ...
2
votes
1answer
931 views

ON DELETE cascade alternate

I am trying to create a database for 2 Tables like: Table1 : tb1-id(pk) | tb2-id | other Table2 : tb2-id(pk) | other FOREIGN KEY Table2(tb2-id) REFERENCES Table1(tb1-id) ON DELETE ...
4
votes
1answer
3k views

mysql_connect() system error :111

I have 2 VPS. I would like to connect from the frist to the second's mysql db like this : $db = mysql_connect("94.xxx.xxx.xxx:222", "user", "pass"); I got this error: Warning: ...
1
vote
1answer
173 views

Access denied Error in MySQL and Drupal

We are trying to deploy a Drupal application on our production server. We see this strange error Lost connection to MySQL server at ''Access denied root@ipaddres password(yes) after deploying. We ...
0
votes
1answer
113 views

Implementation of stack in MySQL

I had an abstract idea of implementing a stack in MySQL. Tried a lot of Google work but couldn't reach to any logical conclusion. The Stack must be a collection of tables with the stack top pointing ...
1
vote
1answer
2k views

Permissions for a MySQL user which will monitor replication status?

I'd like to use a script to monitor the replication status of a MySQL database like in this bash script: https://gist.github.com/wesdeboer/1791632 I'd like to create a user which will only be used to ...
1
vote
1answer
5k views

What are some best monitoring tools available for mysql? [duplicate]

I have a setup a linux mysql server and would like to monitor it. I found percona plugins for nagios and cacti. Are there any other tools available?
1
vote
3answers
605 views

Complex query with multiple normalized fields

We have a fairly simple table structure, but with a LOT of fields per table (talking 40+). This data is initially produced in plain-text, user-readable tables, but then it is translated into ...
0
votes
1answer
35 views

Why isn't my includeThreadNamesAsStatementComment JDBC parameter working?

The JDBC API lists a includeThreadNamesAsStatementComment parameter that seems to indicate it will prefix all queries with the Java thread ID. I thought this would be useful in tying back DB activity ...
3
votes
1answer
976 views

How do you extend the tablespace when using innodb_file_per_table?

With innodb_file_per_table off, you can create multiple tablespaces on multiple devices if necessary to manage growth, balance I/O, etc. With the option on, how do you control growth of the files? Do ...
3
votes
1answer
345 views

MySQL licensing [closed]

I have looked at a few questions posted in stackoverflow http://stackoverflow.com/questions/225987/can-someone-explain-mysqls-license-and-what-it-means-to-closed-source-developme ...
2
votes
1answer
614 views

SQL Uniqueness Across Multiple Tables

I have two SQL tables: Users and clients. Every row in the users table has a set of clients in the clients table, linked by the users table id field and the clients table user_id field. The users ...
0
votes
1answer
533 views

Integer comparison in MySQL. does it cause lots of overhead?

I have an 8 digit number in my db. I want to do a select on the table in MySql (Innodb) and get the list of all numbers that are equal or smaller than my number. Then I sort them from larger to ...
2
votes
2answers
138 views

Logging only mySQL logins on heavily used system

I have an audit requirement where they want all database access (logins) logged. We have a very large distributed system of hundreds of mySQL servers (shards, slaves, slaves of slaves) that are ...
2
votes
2answers
272 views

Can I configure MySQL's typecasting to consider 0 != 'foo'?

This article points out the following security problem with MySQL: USERS id | email | password_reset_token 1 | one@example.com | QTlXww)uV!Hdg3U6aGwKV2FPvAqzVgPx 2 | two@example.com | ...
2
votes
1answer
292 views

How to scale MySQL transaction wrapped queries?

So I'm working on an app that wraps many of it's SQL queries in a transaction for it's SQL usage and I'm trying to think of some ways to scale the DB layer up.... Up until now we've been throwing ...
1
vote
2answers
2k views

How do I add a database in IBM DB2

I'm supposed to migrate a MySQL database into IBM DB2, but I thought I'd take baby steps first before I do something like that. So for now, I'd just like to add a database. I'll admit that I have no ...
5
votes
4answers
6k views

Handling a big table in mysql

I have a really big table (approx. > 100.000.000 rows and a size of > 50GB) and it's getting a big performance kill right now. Beneath the primary key (id) it uses a fulltext key on a varchar(500) ...
2
votes
2answers
6k views

In MySQL Workbench, insert a new column at the “top” of a table?

I must keep a table's columns as specified in a specification that changes quite often. In MySQL Workbench, adding a new columns after all the others is easy, but I can't find a way to insert a new ...
2
votes
1answer
635 views

How to improve INSERT speed in large table that has unique constraint

I have a simple MyISAM table: explain entities; +------------+-------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra ...
0
votes
1answer
30 views

Automatically create linked row in a different table

What I mean is that for example if I have a table user with id name prefId, and a second table preferences with id etc..., is it possible that when I add a row to user, it would automatically create a ...
0
votes
1answer
34 views

mySQL Quickly find rows linked to another row

For example if I have a posts table with id and a likes table width id post_id user_id, how can I set up the database to organize the likes table by post_id in order so queries are faster? I can't ...
1
vote
1answer
207 views

Is there a way to write intelligent queries against a merge table in MySQL that represents a bunch of tables partitioned by date?

I have a set of MySQL tables that are partitioned by date, with a merge table representing all of them. For the query I am writing, the results are joined by date, so rows in table A_2012-12-05 will ...
4
votes
1answer
468 views

NuoDB with Amazon S3

I think about developing my new mobile and web app against NuoDB. I believe in their technology. The thing that I care the most is backup and restore in case of data corruption and read / write speed ...
3
votes
1answer
136 views

Sequential joining of tables in order

Table albums has (among other field) field id. Table photos has column id, field album which is a foreign key referring to album id and some other fields (which are irrelevant for the question I ...
1
vote
1answer
3k views

mysqld_safe version different than mysqld?

Is it a problem that mysqld socket has a different version than the mysqld server? I noticed this in my mysqld log during startup 120420 19:30:06 mysqld_safe Starting mysqld daemon with databases ...
0
votes
0answers
56 views

How to properly kill MySQL? [duplicate]

I have CentOS 64bit with CPanel installed and I use service mysql stop However, it keeps doing ..... for minutes and it never stops. It used to be instant. Any idea why it does that and how to fix? ...
0
votes
1answer
153 views

Master Slave Replication in Mysql

I have generated a dump from Master and I have to construct slave and give privileges and binary log position and file name of master for it to obsorb from master. Master is a high transaction OLTP ...
5
votes
2answers
458 views

Determining the optimal Column Widths from a .csv File

I want to import a .CSV file into a MySQL Table. I would like to determine the optimal column widths to use based on the actual data contained in the CSV file. Are there any scripts or utilities to ...
0
votes
1answer
529 views

Unable to restore dump file in mysql5.5 [duplicate]

I'm trying to restore a mysql5.5 dump file using mysql command prompt using the command given below: mysql> -u <username> -p <password> <dbname> < <dumpfile> But it is ...