MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
1answer
28 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
107 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
946 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 ...
3
votes
1answer
155 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
334 views

How to speed up this simple mysql query?

The query is simple: SELECT TB.ID, TB.Latitude, TB.Longitude, ...
3
votes
1answer
148 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
717 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
510 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
961 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
117 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
477 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
197 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
85 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
133 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
523 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
11k 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
375 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
213 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
308 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
8k 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
288 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
474 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
476 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
373 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
740 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
176 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
235 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
4k 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
104 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 ...
9
votes
3answers
14k 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
277 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
301 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 ...
4
votes
2answers
179 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
727 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
71 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.
4
votes
2answers
6k 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
300 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 ...
8
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 columns id domain_name but I have a problem when I ...
2
votes
1answer
453 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
275 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
228 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
221 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 ...