MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

3
votes
1answer
151 views

Cannot retrieve values from LEFT JOIN (2 tables)

Here it is my query: $query_products = " SELECT p.Id , p.product_sku , p.product_name , p.hide_product , p.new_style_image , p.ext , p.product_thumb_image , ...
4
votes
2answers
325 views

How to speed up this simple mysql query?

The query is simple: SELECT TB.ID, TB.Latitude, TB.Longitude, ...
3
votes
1answer
143 views

Does MySQL Enterprise Backup work across Operating Systems?

The problem with testing is that one can never be sure (it may seem to work and then you find some thing changed later). A definitive statement from the vendor would definitely be helpful (I cannot ...
3
votes
2answers
586 views

mysqldump fails to dump database

I m using following sql query for creating db backup mysqldump -u[username] -p[password] -h[hostname] [database] | gzip > [backup file path] This generates zipped .sql file in path specified but ...
2
votes
1answer
471 views

How to write a shell script to check the mysql database backup status.

I have mysql production databases running in main server(Linux) and from this server every night the backup is taken into local server. Now i want to find a shell script to check if all the databases ...
2
votes
1answer
834 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 ...
1
vote
1answer
116 views

Circular Replication, prevent failure

I recently needed to setup MySQL replication across 4 servers, so that each one is a slave of another. After several hours of tweaking I finally got this working - it was actually quite simple. I am ...
1
vote
1answer
442 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 ...
0
votes
1answer
194 views

MySQL query took 98 seconds to run but EXPLAIN looks okay

I have a query that took 98 seconds to execute this morning, but I can't recreate the problem now, and the EXPLAIN output isn't giving me any clues. Am I missing something? Here's the SQL: SELECT ...
2
votes
1answer
83 views

MySQL query took 98 seconds to run but EXPLAIN looks okay

I have a query that took 98 seconds to execute this morning, but I can't recreate the problem now, and the EXPLAIN output isn't giving me any clues. Am I missing something? Here's the SQL: SELECT ...
1
vote
1answer
131 views

Help Optimizing Query

For the following table structure in MySQL 5.1.49: CREATE TABLE `leads` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `institution_id` int(10) unsigned NOT NULL, `lender_id` int(10) unsigned ...
1
vote
2answers
491 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 ...
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
349 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 ...
2
votes
1answer
205 views

Receive strange error during mysql auto-repair check optimize

I am running the command: /usr/bin/mysqlcheck -hlocalhost -uDATABASE_NAME -pPASSWORD --auto-repair --check --optimize DATABASE_NAME And up until this past week, this command has always run just ...
3
votes
2answers
285 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 ...
3
votes
1answer
2k 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 ...
5
votes
1answer
7k views

WAMP server performance tuning for MySQL

We have a Drupal site with nearly 2000 pages running on WAMP server. The pages also contain images, and flash videos embedded into them. So, they are taking some time to load under normal settings. ...
2
votes
1answer
286 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 ...
2
votes
2answers
442 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 ...
2
votes
1answer
378 views

Change the same field from all the tables from a particular database

Suppose I have a database sitedb and in that I have 20 tables and a primary key(say uid) for one table is used in other tables as dependencies. uid is of type int with length 10. Lets say that the ...
4
votes
1answer
361 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 ...
0
votes
2answers
647 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. ...
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 ...
1
vote
2answers
170 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 ...
3
votes
1answer
214 views

mysqld-multi with first DB as Slave and second DB as Master

Yesterday, I setup mysqld-multi in my.cnf. It works fantastic, but there is still a further Problem. The first DB on socket 1 running as Slave from a other server. The second one from socket 2 ...
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 ...
3
votes
2answers
102 views

MySQL using a index referencing a different column

I have a large table which uses a versioning system in the table. When a record is updated a new record is inserted with the old data and the original record is updated ( so to maintain the same ...
8
votes
3answers
11k views

mysql wont start after increasing innodb_buffer_pool_size and innodb_log_file_size

I am following this solution here http://stackoverflow.com/questions/3927690/howto-clean-a-mysql-innodb-storage-engine/4056261#comment14041132_4056261 and tried to increase my innodb_buffer_pool_size ...
2
votes
3answers
272 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 ...
5
votes
1answer
4k 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
1k 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 ...
1
vote
0answers
267 views

mysql server is not sending result set back after query execution to client and staying in sending data state

When I pass a query from my Java application to mysql server, it stays in Sending Data state and not returning result set back to application. When I execute the same query in SQLYog directly, it ...
3
votes
2answers
163 views

MySQL 1264 warning from libmysql

I'm using the libmysql.dll library to connect to my database from a 3rd party application (metatrader). I managed to connect and things are going almost fine. I use mysql_real_connect and ...
1
vote
1answer
704 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
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.
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: ...
1
vote
1answer
281 views

extremely slow MyISAM slave updates

I have 2 slaves and one is working as expected. The other slave is extermely slow while executing the "update" statements. The insert and deletes are fast. I used "check table tbl_name" to see if any ...
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 ...
1
vote
0answers
1k views

Tables don't exist after MySQL restart

I recently made changes to optimize performance for InnoDB engine-based DB and soon after when restarting I encounter into the following strange behavior: I have some tables with data in them I made ...
3
votes
1answer
1k 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 ...
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
1answer
421 views

Schedule replication of SQL Server views to MySQL remote database

I have a Microsoft SQL Server 2005 Database inhouse I have to publish some information on the internet and I can't (for security policy) query this database from the web server. So I came up with the ...
0
votes
3answers
240 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| ...
2
votes
1answer
162 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
222 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: ...
1
vote
0answers
205 views

Enforce a hard limit on write execution time during Amazon RDS write stalls

I am trying to recover from the situation where Amazon RDS write operations stall (some discussion on why this is here). If I show full processlist, I will see something like this: 318263 myapp1 ...
2
votes
1answer
258 views

Rewriting a query and eliminating subqueries

I have the following query : SELECT ws_id, n50, num_singletons, num_segments_less_100, kmer, num_all_reads, number_bases_in_contigs, num_bases_in_singletons FROM stats_assembly WHERE ws_id IN ( ...
4
votes
2answers
756 views

Sorting the Table and getting the position

I am able to sort a table using the following code:SELECT * FROM Persons ORDER BY LastName But I wanted to get the ranking/position of a person using that order. For example when I sort Person table ...
5
votes
3answers
11k views

How to use insert delay with the InnoDB engine and use less connection for insert statements?

I'm working on an application which involves a lot of database writes, approximately ~70% inserts and 30% reads. This ratio would also include updates which I consider to be one read and one write. ...