MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
1answer
60 views

mySql Relationships / Index - Checking for duplicates

I have this setup on innoDB: TblUser user details TblConnection User Connection TblConnection also has these indexes: User, Connection where User is the foreign key of TblUser.id and another ...
2
votes
1answer
716 views

When and why can this kind of deadlock occur?

------------------------ LATEST DETECTED DEADLOCK ------------------------ 130409 0:40:58 *** (1) TRANSACTION: TRANSACTION 3D61D41F, ACTIVE 3 sec inserting mysql tables in use 1, locked 1 LOCK WAIT ...
0
votes
1answer
675 views

Mysql: order by field or select union?

As a newbie, I expected Mysql to return the rows of this query ordered by their ids order in the id clause select * from test where id in (3,1,2) Unfortunatelly for me, that's not true. The results ...
0
votes
1answer
6k views

MySQL slave stuck in “Reading event from the relay log”?

5.5.28-log MySQL Community Server (GPL) by Remi binlog-format=MIXED My problem is similar to this question. *************************** 2. row *************************** Id: 973415 User: ...
1
vote
1answer
1k views

How to copy data from table to another and automatically change the values to match the other's data type msql

I want to copy data from table column to another and automatically change the values to match the other's data type. That is; in one table, a column is "Gender" and the values are Male & Female ...
1
vote
1answer
147 views

Changing TEXT to VARCHAR

In a MySQL database (InnoDB) we have a table containing roughly 60.000.000 rows. One of the columns is of type text. Currently the longest entry has length 360 (found using SELECT MAX(LENGTH(value)) ...
3
votes
2answers
8k views

MySQL Workbench, how to refresh EER diagram?

I'm using MySQL Workbench to design my MySQL database and model how entities would look like and how they would relate to each other. Now, sometimes I use Doctrine ORM. When using Doctrine ORM, I ...
1
vote
1answer
2k views

Should I disable triggers, timestamps in a slave in mysql?

We're using MySQL. We have a master that eventually will have 2 slaves. There are triggers in the db that execute when data changes in certain tables. I am wondering whether to disable the triggers in ...
1
vote
1answer
79 views

If MySQL isn't caching, then what is?

I ran a few commands to see whether MySQL is caching queries/result sets. It looks like this is not the case. mysql> show variables like 'query_cache_size'; -------------- show variables like ...
2
votes
1answer
1k views

Adding slave to existing master-master config in mysql throws Foreign key constraint failed error

We have two mysql servers running in master - master configuration. Now we have to add a slave to the existing configuration. But upon adding the third DB server and starting slave on it, it throws ...
1
vote
1answer
72 views

After adding a slave to Master - Master configuration, slave syncs from only one master

Futher to my previous question, Here is what we have +<------+ | ^ V | S1<---M1 M2 | ^ V | +-------+ what happens is Upon ...
0
votes
2answers
7k views

How to import data from a pair of .mdf/.ldf files into a MySQL database [duplicate]

I have two Microsoft SQL Server database files named "xxx.mdf" & "xxx.ldf" and I want to import that database into MySQL so I can run queries against it using phpMyAdmin. How would I go about ...
0
votes
1answer
2k views

Importing CSV file to MySQL via PHPMyAdmin

I am currently stuck and unable to upload a complete CSV file into a MySQL database. Unfortunately, the nice folks at Stackoverflow haven't been able to help me solve this issue, so I'm hoping someone ...
1
vote
1answer
691 views

MySQL Cluster SQL Node not synchronizing

I am new to MySQL Cluster and am trying to setup a new cluster for our new application. Here is what I have set up on 5 CentOS 64 bit VM and got the cluster to work using MySQL Cluster 7.2. I am ...
0
votes
1answer
264 views

Object-oriented programming CRUD design pattern

At first I have posted this question at http://cstheory.stackexchange.com/questions/17170/object-oriented-programming-crud-design-pattern - that's because I think it's a subect question, and it can ...
-2
votes
1answer
9k views

MySQL format numbers with comma [closed]

How can I print the integer part of a number with commas separating every three digits? For example, 12345 -> 12,345 1234.567 -> 1,234.567
1
vote
2answers
919 views

How do I find an invalid utf8 character “somewhere” in my MySQL/trac database

I have an installation of trac, which uses MySQL. It has been upgraded so many times, moved servers etc. and chances are that the MySQL character sets were not always set correctly or consistently ...
1
vote
2answers
2k views

Using MySQL EXPLAIN to analyze the performance of a function

You can precede a SELECT statement in MySQL with EXPLAIN, but how would you explain a function? I have a function that does a lot of work and I would like to analyze the performance of the function as ...
1
vote
1answer
691 views

good practices of creating tables in mysql [closed]

Hi I was thinking of developing an web apllication using php and mysql. Application will give a professor the required data about the student. i want to design application considering Engineering ...
2
votes
3answers
776 views

Which database is best for deeply embedded database or through C DLL?

I want a deeply embedded database. Deeply embedded means that the server is started by an application and closed by the application with no tcp/ip or 0 port. The main features of consideration are: ...
5
votes
1answer
547 views

“Site Offline” MySQL server failing to start and stop

I'm hosting a few sites on linode and have encountered a strange problem. For the last two years the site has been running perfectly fine, and now randomly all the websites on the server go to the ...
0
votes
3answers
3k views

How to avoid deadlock while updating 2 rows in MySQL

This is a interview problem: There is a perl program that updates the database, and it could run in different processes. One process may execute a transaction like: update row A -> update ...
0
votes
2answers
7k views

Multiple Aliases in an SQL Query

Would it be possible to give a table in MySQL query multiple aliases? If so how would I do this?
1
vote
2answers
3k views

Stress test MySQL with queries captured with general log in MySQL

Is there any tool available which can do stress testing using the log file created by MySQL general log? After a lot of search on google I found few stress testing tools which only use some benchmarks ...
0
votes
2answers
478 views

MySQL Benchmark on FreeBSD and Ubuntu [closed]

I'd like to benchmark two db servers, one is running Ubuntu the other FreeBSD. Unfortunately we are unable to install SysBench on the FreeBSD OS. Could anyone recommend any alternatives? Or should I ...
0
votes
1answer
109 views

Circular replication with servers in different locations

My service runs on single machine, and database (mysql 5.1.66) is replicated to 2 other identical slaves (with lesser system resources, mysql 5.1.66) via chained replication. Machines are located in ...
1
vote
1answer
607 views

Limit Access To mysql information_schema

In case of mysql attacks, many times user extracts information from information_schema. can i do something in mysql that can restricts user to xtracts information from information_schema while all ...
0
votes
0answers
72 views

Autoincrement by 2

I use MariaDB 5.5. It increases every auto_increment value by 2. So all my ai cols look like 1 3 5 7 9 ... Where can I change this behaviour? Or might this be a bug?
1
vote
1answer
473 views

Is there a query to set a table's engine to innodb if it's not already?

I can set a (MyISAM) table's engine to InnoDB using the query: alter table tablename engine=InnoDB which takes some time to complete for large tables. It appears though that if I run the same query ...
1
vote
1answer
260 views

For a InnoDB only DB, which of these elements can be removed?

So, I'm trying to set up a Drupal 7 my.conf file that's combining best practices from various performance blogs. I'm realizing though that some of them are older than others, and many aren't assuming ...
0
votes
1answer
57 views

How to have MySQL Slave Replicate From a Master's Master

We are using the Following: MySQL 5.1.63-community-log MySQL Community Server (GPL) OS : Red Hat Enterprise Linux Server release 5.4 We have three servers and all servers are enabled with binary ...
1
vote
1answer
169 views

Data usage increases initially when reorganize partition mysql cluster

In my MySQL cluster, the data usage of 4 data nodes is approximately 77%. I added a new data node online, and attempted to reorganize partition to redistribute data among all data nodes. But before ...
2
votes
1answer
2k views

Innodb Slow queries since convert from MyISAM

a few days ago we converted some write intensive tables from MyISAM to InnoDB hoping to have a better performance due the better locking system of InnoDB, but instead of gain performance, we start to ...
5
votes
4answers
3k views

Why are so many MPP solutions based on PostgreSQL instead of MySQL?

Astor Data, Greenplum and GridSQL all allow Massive Parallel Processing of SQL queries. They are also all built around PostgreSQL technology. Is this just because of licensing issues or are there ...
0
votes
2answers
215 views

which process has created a load spike on my server last week?

O.S.:Linux MYSQL server we got a load spike last week. how can I find the process that has created the load spike on my server last week.
0
votes
1answer
428 views

MySQL inserts/deletes slowing down after a while after Start/Reboot

The Setup here is: OS: Ubuntu 12.04 (1 Core and 1.75 GB of RAMO) MySQL Version: 5.5 There are about 8 to 9 tables in the database. On initially starting mysql the queries are fast at around 0.05 - ...
2
votes
1answer
406 views

Slow query performance

My database contains 20,000 rows and the following query is slow. Please help me to speed this up: SELECT r.report_id, r.user_id, u.user_name, u.user_mail, ...
0
votes
0answers
350 views

UPDATE / SELECT incredibly slow in MySQL InnoDB

I have 1 table with 2.5 billion records(2.5 Cr.) and I am trying to get count of records based on indexed column. it takes 115 seconds to execute same. Query : Select count(1) from table1 where ...
0
votes
1answer
515 views

Is there an easy way to replicate MySQL data?

My software is deployed in various cities, each have a database, but they have different authorizations such as: central DB /\ / \ DB1 ...
1
vote
0answers
357 views

MySQL 5.1.67 - Replication failure Mysql, Master Log Truncated or corrupted

I have run into some issues with replication After an in-place upgrade of mySQL from 5.0.77 -> 5.1.67 rel 14.4 Percona replication between a master and multiple slaves is causing issues. slaves are ...
2
votes
4answers
24k views

MySQL - ERROR 1045 (28000): Access denied for user

I just installed a fresh copy of Ubuntu 10.04.2 LTS on a new machine. I logged into MySQL as root: david@server1:~$ mysql -u root -p123 I created a new user called repl. I left host blank, so the ...
1
vote
1answer
1k views

Mysqldump from the Amazon RDS

I have a Mysql database deployed on Amazon web services RDS. I am running a crontab which runs mysqldump command. The problem is it freezes the rds instance and my website will be down for more then ...
0
votes
1answer
236 views

MySQL UPDATE statement using a table created on the fly

I want to update a table, say Table 1 using a table that I create on the fly (saytemp). To achieve this I have the following query: UPDATE Table1 SET COUNT = temp.ctemp FROM ( SELECT A, SUM(UNO) AS ...
0
votes
1answer
28 views

mysqlworkbench after cmd mysql startup went wrong

i have problems with my mysql server. I have installed the newest mysqlserver but having problems after starting my server from command line on localhost. Before that i was running xammp. The problem ...
-1
votes
1answer
475 views

Understanding MySQL Integer Types?

Please could someone explain to me how the MySQL integer types and lengths work as it is somewhat confusing. Which different integer types and lengths should I use for each of the following ranges to ...
1
vote
1answer
1k views

Insert from one row to another using cases

My original table was(being used since 2005): CREATE TABLE `request` ( `msg` VARCHAR(150) NOT NULL, `id` VARCHAR(20) NOT NULL, `ctg` VARCHAR(10) NOT NULL DEFAULT 'misc', `date` ...
0
votes
2answers
1k views

mysql trigger on update with insert statement

I am trying to create a simple trigger which is handled on update operations. The trigger is checking before update if a record of an update exists, then if not it is created. DELIMITER ;; CREATE ...
0
votes
1answer
94 views

Speed efficient query for membership first joined, latest category from membership table (min, max)

I have the following table representing membership information: CREATE TABLE IF NOT EXISTS `membership` ( `id` int(11) NOT NULL AUTO_INCREMENT, `organisation_id` int(11) NOT NULL, ...
1
vote
0answers
73 views

Toad for MySQL pauses exactly 2 seconds after executing statement [closed]

Environment: Toad for MySQL 6.3 and MySQL Server 5.6 on Windows 7 Whenever I perform any query, the Editor in Toad pauses for 2 seconds. This happens every time. Example: show tables; (Duration ...
4
votes
2answers
8k views

How do I find the median value of a column in MySQL?

I can only imagine doing this with two database queries. The first finds the number of rows in the database, and the second selects with an ORDER BY on the column I am interested in and LIMIT X, 1 ...