MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
4answers
795 views

simple question about group by and custom groups

Imagine a MySQL table that only has 2 columns: an id and a name of a color. With this query, I know how many id's I have for each color: SELECT color_name, count(id) FROM color_table GROUP BY ...
1
vote
1answer
42 views

Get wall_post and profile data for several users

I'm trying to build a query for fetch wall_posts and profile fields for several user_id. First see the images at: http://www.dropmocks.com/mBjQ7P. The table with id_user_rq, id_user_ap is the table ...
3
votes
1answer
245 views

Best mysql db design to solve timezone issues

I faced problem with timezone on my last two projects. So What is best way to sort out problems with timezone on db design. I mean, What format should i added date time stamp. On of my problem. My ...
2
votes
1answer
522 views

“set-variable = innodb_thread_concurrency=4” or “innodb_thread_concurrency=4”

Based on this question, the asker wrote: set-variable = innodb_buffer_pool_size=2M set-variable = innodb_additional_mem_pool_size=500K set-variable = innodb_log_buffer_size=500K set-variable = ...
2
votes
1answer
26 views

Get the rows where id_user_rq exists in id_user_ap and viceversa

I have this table structure: http://www.dropmocks.com/mBjNvF and need to get the id_user_rq if not exists in id_user_ap as the title said. I need to get the rows where id_user_rq = 1 and id_user_ap = ...
2
votes
1answer
106 views

Get the id_user_app if not exists in id_user_rq

I'm building a application and have this table for users relationships. I need to build some queries like for example: Who invited me as a friend? Who I invited to be my friend? Who I accept as ...
6
votes
2answers
696 views

MySQL Permissions Necessary To Reset Password

On my team there is a desire for some users to periodically update their MySQL password. Our MySQL server is shared between a few projects (and certain users are assigned to certain projects). If I'm ...
4
votes
8answers
7k views

Load-balanced MySQL cluster without load balancer

I'm looking to create a load-balanced MySQL cluster, but without the actual load-balancer, in order not to add another point of failure or complexity. What I was thinking was to have the following: ...
7
votes
4answers
3k views

MySQL Cluster RAM requirement

From MySQL 5.1, the data doesn't need to be entirely in memory anymore. I've read that the indexed columns (I think the entire index structure) must still be in memory (MySQL High Availability, 2010, ...
1
vote
1answer
170 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 ...
2
votes
1answer
819 views

How do you set the MySQL password on Mac OS X?

I've downloaded mysql 5.25 on mac os x Lion (10.7.4). I just tried setting my password in the usual way, however I'm getting an access denied error which is odd: [user@Macintosh:~] #mysqladmin -uroot ...
4
votes
4answers
2k views

Exporting\Importing a large MySQL data without mysqldump

I'm attempting to export about 150GB of data from a database with hundreds of tables, and have found mysqldump to be very buggy. After running a simple --all-databases dump succeeds, but the import ...
1
vote
2answers
379 views

How to model double relationships?

Background: I have designed a solution for Filemaker to input data into a Question Database. After we are done with inputting data into Filemaker, we will be exporting the data as excel and ...
1
vote
2answers
483 views

Lost connection to MySQL server during query

Here is a part of my query SELECT * INTO OUTFILE 'Target_File_Name' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '' FROM (SELECT 'Start time','Calling no','Called ...
1
vote
1answer
285 views

MySQL lost records in a master slave scheme

We have developed a web application that uses two MySQL servers set up with replication (master-slave scheme). The application was to be used for a couple of days only, when ~ 50-60 users would enter ...
1
vote
1answer
433 views

Replication Broken, List Out of Sync Tables

In a master-slave setup on MySQL 5.5 on RHEL 6.1, when db replication breaks (for whatever reason), what is a good way to: check (and alert) replication is broken? get a list of tables that are out ...
4
votes
3answers
10k views

I've got 16GB of ram, how should I configure MySQL Server?

I've got a dedicated production server with multiple cpus and 16GB of ram. I would like to know how can I configure it better to take advantage of the server resources for better performance because ...
3
votes
1answer
340 views

Random write freezes

I have a MySQL 5.5.23 DB that performs about 3k qps, 5% of which are writes. Lately, I've been having a big problem with random write freezes. Everything is going great, and then all of a sudden any ...
3
votes
2answers
274 views

Migrating and normalizing data

We are rewriting a large Django application which uses a MySQL database, and the database schema needs to undergo major modifications. We're also porting the app to use PostgreSQL, for a couple of ...
2
votes
2answers
427 views

How to detect whether MySQL server is running as Amazon RDS

I am writing an application wherein I want to detect whether MySQL server is running as Amazon RDS instance? Can somebody help me out how to detect it? auto_increment_increment1 ...
4
votes
2answers
6k views

MySQL Event does not run

i am running mysql 5.1.41 that came bundled with xampp on windows. the problem is that the event doesnt run automatically even when the event scheduler is ON. i have a table named ta_table using ...
4
votes
2answers
711 views

Fetch first 9 records and make one more record which will be as “Others” in MySQL

I am fetching records from one table with count of one field with other field as name. I want only 10 records. out of which 9 records give me field and its count. but i want to show 10 record as ...
3
votes
1answer
1k views

Understanding optimisation of complex SELECT queries

I have a people table with basic contact info in. I have a bunch of criteria that can select Id values (fields called pid) from the people table. I want records that match ((criterion 1 or criterion ...
2
votes
1answer
284 views

datetime index skipped for same query different params

I am running two queries with same query but different parameter and one of them is extemely slow while the other is fast. Both the results are alomost the same. (500 and 575) Any idea why it skips ...
4
votes
1answer
358 views

Are InnoDB tables harder to backup and slower?

I am trying to optimize our database tables. I have some sql skills, but complete newbie at db administration. Our db operations are pretty slow, and I have been assigned to review the storage engines ...
3
votes
2answers
5k views

Trying to understand SHOW SLAVE STATUS\G

I have slave setup and looks like it is running fine. Below is a snapshot of it. show slave STATUS\G; *************************** 1. row *************************** Slave_IO_State: ...
0
votes
2answers
616 views

Creating a test database from Production database (different machines & servers)

I'd like to set up a test database on a separate server. Production database is MS SQL Server and the test server is a *nix box so I'd like to have the test server running either PostgreSQL or MySQL. ...
1
vote
2answers
169 views

Can a poor database layout cause performance issues for simple queries?

I have a database layout that is realy a mess and needs to be optimized. Does the layout of the database and some queries that are executed cause other queries to be slow too? For example, an insert ...
1
vote
1answer
689 views

The primary key issue with slave

The slave is not working due to primary key error as shown below: Last_SQL_Errno: 1062 Last_SQL_Error: Error 'Duplicate entry '550696860' for key 'PRIMARY'' on query. Default database: ...
2
votes
1answer
1k views

In InnoDB, does a Transaction imply any implicit locking of a table?

The Isolation level is REPEATABLE_READ. The logic is as under: Transaction begins Read data from Table A If (Table A has Any Data) End Transaction and exit If Table A has No Data, Proceed further ...
3
votes
1answer
3k views

mysql: deleted performance_schema, is it a problem?

Been following this tutorial http://stackoverflow.com/questions/3927690/howto-clean-a-mysql-innodb-storage-engine/4056261#comment14041132_4056261 in the process I deleted performance_schema along ...
2
votes
3answers
270 views

What is a database with “.res” in its name?

I'm not that experienced with MySQL and I'm trying to fix some databases. In mysql, a "SHOW DATABASES" shows (among others) the main database "MainDB" and another database "MainDB.res". If I'm trying ...
2
votes
1answer
255 views

Changing to InnoDB increases iostat

I have changed my MyISAM tables to InnoDB and from that day, iostat is increasing continuously. My findings on the server say that mysqld is the one who is increasing iostat. But how can it increase ...
4
votes
1answer
3k views

Can I safely kill OPTIMIZE TABLE on an InnoDB table?

MySQL's documentation for kill warns: Warning Killing a REPAIR TABLE or OPTIMIZE TABLE operation on a MyISAM table results in a table that is corrupted and unusable. Any reads or writes to ...
2
votes
1answer
990 views

php/mysql merge duplicate records in table and create a new table

please with respect to username and storetype, how can I merge rows to achieve Final table? storetype should be unique per username. There are thousands of usernames and records so php/mysql would ...
0
votes
3answers
194 views

Dog slow query, needs optimizing, please help

I found this query in our web app that has been made by hired programmers. It performs like a dog and needs optimization, but I'm no MySQL wizard (yet), unfortunately. Please help, anything is ...
2
votes
1answer
70 views

how to grant a user permission to create databases?

I use phpMyAdmin powered by Mamp (free version) to manage Mysql databases. I need to know how to grant a user permission to create databases.
6
votes
2answers
4k views

Can I have one table be an “alias”, or “symlink”, to another?

I have two tables with the same structure, A and B. A certain application is written so that it always writes the same data to both tables. After a discussion with a colleague about the potential to ...
2
votes
3answers
2k views

How do you restore a particular table in MySQL?

One of our users has deleted a table by mistake. How can I restore only that table?
2
votes
1answer
1k views

How to optimise read/write performance a MySQL table with many rows?

I am developing a django application where I use a MySQL database. In my application there is one table for domains information which has only 2 coloumns id domain_name but I have a problem when I ...
2
votes
2answers
3k views

MySQL won't start after upgrading to PHP 5.3

Just upgraded to PHP 5.3 with the latest version of mysql, but now mysql won't start. Below is mysqld.log 110516 22:24:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 110516 ...
3
votes
1answer
941 views

Need advice for a 'tag' table design

My website has different content types. All content types should be tag-able (except if specified in the model, whatever). I can think of 2 options for my design: 2 tables option : 1 table for the ...
1
vote
1answer
98 views

keeping database columns consistent with documentation

For a project, the client wanted to be able to add fields to any item and have them be searchable. To make them searchable, that would require the fields to take a column, but that would make the ...
0
votes
3answers
231 views

How to store count value in DB [closed]

I have a table as below, order field is like auto increment, but it is not defined as auto_increment because i do not want any gaps in that value +--------------+ | id | order1| ...
4
votes
1answer
762 views

Database as a service (DbaaS) over dimensions--performance, scalability, & reliability?

MySql Database as a service: Amazon Xeround Another eg. PostgreSQL Database-as-a-Service. You can get the list of similar products here. Does anyone have details on their performance, ...
0
votes
1answer
101 views

InnoDB possible error

We are moving now from MyISAM to InnoDB. We have faced previous problems in MyISAM where the index fail and the table is not available for access. So we are wondering what type of errors that InnoDB ...
2
votes
1answer
160 views

Log file for mysql

I would like to know where will my error logged for mysql server. As of now I just see one log that is in /var/log/mysqld.log. I saw some have .err files too am I missing something here? What would ...
1
vote
1answer
220 views

some InnoDB settings in My.cnf are messing up everything, why?

When I edit my.cnf in MySQL 5.0 in filemanager and add the following settings, I get logged out automatically from Kloxo and when I remove these line and restart server everything is ok then: ...
27
votes
3answers
46k views

Which is faster, InnoDB or MyISAM?

How can MyISAM be "faster" than InnoDB if MyISAM needs to do disk reads for the data? InnoDB uses the buffer pool for indexes and data, and MyISAM just for the index?
1
vote
1answer
216 views

apache hang on deadlock

i use code like this to prevent deadlock. while($retry<3 and $notsone) { try { $transaction->commit(); $notdone=false; } catch { $transaction->rollback(); $retry++; } } if ($retry==3) { ...