Tagged Questions

MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
0answers
5 views

Is this update, select combination query thread safe?

I have a table called seats, which has a schema like this id,taken For each user, I take a random untaken id and assign to that user, here for simplicity say, I make taken =1. The query I am ...
0
votes
0answers
9 views

Running two DELETE statements causes a syntax error

DELETE `member` FROM `member` WHERE `member`.`type_id` = 1; DELETE `subscriptions` FROM `subscriptions` WHERE `subscriptions`.`type_id` = 1; Table: subscriptions ...
0
votes
0answers
6 views

MySQL Remote Database Failover: Need Advice

I run a network of sites all on 1 server. To improve performance, I'm (finally) moving the MySQL database to a remote machine. I'd love anyone's advice on how to appropriately approach failover. ...
1
vote
0answers
19 views

Migrate from SQLite to MySQL (then back)

For various reasons, I must use a SQLite database with a local application. However, I wrote a Flask app that enables users to more easily classify items in the database, and it runs very slow on ...
0
votes
0answers
18 views

MySQL 5.6.19a InnoDB Concurrent Insert

I've looked through most of the threads on this topic but still had question I was hoping someone would be gracious enough to help with. I am seeing low CPU usage and write latency but transaction ...
1
vote
0answers
17 views

Need advice on optimizing database on a recurring basis

I have a search engine with approx 3.5 million rows in the searchable table. There are many suppliers that feed into the table each day, so primary keys are constantly being removed and added and the ...
3
votes
2answers
393 views

Can anybody tell me what's wrong with this query?

CREATE PROCEDURE Click( in ipaddress varchar(45)) BEGIN DECLARE ex int; SELECT COUNT(*) INTO ex FROM clickactivity WHERE IP = ipaddress; IF ex = 0 THEN INSERT INTO clickactivity (IP, ...
0
votes
1answer
24 views

MySQL-How to find that value in a column is subset with all other values in same column multiple time

I have a table named as Team where table contain 3 column (ID,Team,Task). Its datatypes are (INT,VARCHAR(255),INT). Below you will find a sample table where I would like to perform the query on column ...
1
vote
1answer
25 views

Similar hardware, Same DBconfiguration and Database but different status variables result between Windows and Linux server

I have two database servers - one is Windows - 2008 and another is RHEL5 with similar hardware configuration. MySQL 5.1.58 community edition is installed on Windows servers while MySQL 5.1.73 is ...
0
votes
2answers
41 views

Companies and addresses MySQL

I've got a database with 2 tables. companies addresses These are my tables. Adresses adress_id adress_adress adress_adressnumber adress_zipcode adress_city adress_postbus adress_country ...
0
votes
1answer
22 views

schema for mysql database with 30million rows

We am building a SaaS backend for restaurants. We integrate directly with POS, so each POS keeps sending customer orders that we store in a following table in mysql. CREATE TABLE name ( `id` ...
1
vote
0answers
21 views

Handling this multi-threading scenario in the database?

I am working on sample bus ticket booking application,in I am facing these two multi-threading scenarios. Scenario 1 1: Let's say there are two users, they both pick a particular seat and submit ...
0
votes
0answers
35 views

select sequential rows

How would I go about selecting a sequence of rows. Where every row in the sequence: Must only be 1 day apart ~ Thereby the whole sequence of rows must have sequential dates Must have a count higher ...
2
votes
3answers
47 views

Bulk Delete for Large Table in MySQL

I have a Notification table contains about 100 million rows host in Amazon RDS with 1000 IOPS, and I want to delete those rows older than one month. If I do DELETE FROM NOTIFICATION WHERE CreatedAt ...
0
votes
0answers
14 views

Reset relay files on lagging slave after MySQL crash signal 11?

MySQL crashed on this slave server with signal 11: Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013) Slave I/O: Replication event checksum ...
0
votes
1answer
23 views

MySQL any way to import a huge (32 GB) sql dump faster?

I have this huge 32 GB sql dump that I need to import into MySQL. I haven't had to import such a huge sql dump before. I did the usual: mysql -uroot dbname < dbname.sql It is taking too long. ...
1
vote
1answer
22 views

Is there a way to prevent special characters on schema objects?

I would like to prevent the creation of objects with spaces or special characters. Is there a way to allow only letters, numbers, and the underscore? Thanks!
0
votes
2answers
24 views

How to determine if open_table_cache is set properly?

Does anyone know what this really means? (from MySQL docs) You can determine whether your table cache is too small by checking the mysqld status variable Opened_tables, which indicates the ...
-1
votes
1answer
31 views

Get a teams Rank based their xp [on hold]

Table is called teams, need to get the following columns... name, wins, losses, percentage, level, xp WHERE console = 3 AND game = 23 AND laddertype = 1 I'm in need of a Rank column to be included ...
1
vote
1answer
19 views

CONCAT() between different alphabet echoes out '&' ampersand

I want to concatenate different alphabet strings and get a weird latin encoding with ampersands after the sixth greek character (I want to concatenate greek and english alphabet strings). Lets say I ...
0
votes
1answer
23 views

MySQL Circular replication with fail over

I have 3 MySQL servers which is running with circular replication. Server A version - 5.5 Server B version - 5.6.21 Server C version - 5.6.21 Master Server FOR Slave Server C ...
-1
votes
0answers
12 views

MySql Store procedures is better for large web application [on hold]

i make a large web application using php pear concept and MySql Stored procedures for better performance please tell i am right or not . and also comment about advantage and disadvantage of this ...
0
votes
2answers
47 views

How to use max function in such condition?

My query is select * from guestuser union select * from olduser ORDER BY userid DESC LIMIT 1; Is that correct query to find last userid from different table have different userid? can i change ...
0
votes
0answers
16 views

Validate MySQL/PostgreSQL backup tool [on hold]

We have some MySQL/PostgreSQL servers that we already backed up daily. Now we want to validate those backup files to see if any corruption happens. The common way to do this task is just restore the ...
1
vote
3answers
28 views

Question on having a MySQL 5.1 replicate from a MySQL 5.6 DB

I have a question in regards of what potential issues that might happen with a MySQL 5.1 DB that replicates from a MySQL 5.6 DB. I know the risks involved based on resources such as ...
0
votes
0answers
17 views

MySql backup for certain database contents

So i have a database containing custom functions and cleanup procedures and obviously content under tables which i want to back up using automating script which works but doesn't create a proper ...
1
vote
0answers
16 views

MySQL - Transactions and causality

I'm new to MySQL's LOCK and TRANSACTION and have a question about different isolation levels of a transaction: Given two transactions executing the same code (auto-commit is false): (1) get data of ...
0
votes
0answers
16 views

MySQL: migration huge tables between two databases

Hello guys (and sorry for my English). I have 2 DB's - DB1 (staging) and DB2 (production), each day some contend added/changed in some tables in DB1 and should be moved to DB2. Right now it works ...
0
votes
0answers
7 views

Is it proper to make a grand-parent key, a primary key, in its grand-child, in a multi-level identifying relationship?

I'm modeling a DB for a conference ticketing system. In this system attendees are members of an attendee group, which belong to a conference. These relationships are identifying, and therefore FKs ...
0
votes
1answer
16 views

Mysqldump without slow query

Situation: I currently monitor an instance of MySQL for slow queries. We have a mysql user dedicated to backups which performs a mysqldump, but the mysqldump gets logged as a slow query. Question: ...
0
votes
1answer
13 views

MongoDB Manual References vs DBREF

I've been researching MongoDB and trying to see if it would be a fit for my company's product catalog. I came across database references: http://docs.mongodb.org/manual/reference/database-references/ ...
0
votes
2answers
26 views

MongoDB/MySQL - auto increment vs object ID

I am in the process of evaluating MongoDB and writing some basic PHP applications around it. Typically in my PHP/MySQL applications, I would create an ID field and set it to auto-increment on each row ...
0
votes
1answer
18 views

Mysqldump throwing error 'Couldn't execute 'ROLLBACK TO SAVEPOINT sp':

Can any one please explain what is happening with our DB dumps? We are executing dump as below mysqldump -v --single-transaction --quick --lock-tables=false --skip-triggers -uXXX -pXXX ...
1
vote
2answers
48 views

return my.conf values to sane levels (total memory footprint = 220GB)

I recently took over administration responsibilities for one of our databases. The existing my.cnf has some crazy values. I should mention that one table has 1.8 billion rows of mostly unneeded ...
0
votes
0answers
32 views

Slow MySQL Query when Ordering

This query takes around 2 seconds when the order by is included, without the order it takes less than a tenth of a second. The field that is doing the sorting, qc_products.addedDate, is an index and ...
0
votes
1answer
10 views

Storing Page View Statistics

This is a rather open-ended question, but only because I'm unable to find much information on it... That being said, how would you efficiently track unique page views? From what I've read, you'd have ...
0
votes
1answer
17 views

MySQL #1005 - Can't create table 'startet' (errno: 150)

Can anyone figure out why phpMyAdmin won't create the last table? It works fine if I drop the last foreign key, but I need it in there to get my assignment approved... CREATE TABLE nasjon ( ...
0
votes
1answer
26 views

Laggy slave OK to have only one system user in processlist?

In all the examples of a processlist on a mysql slave I've seen, there are two system users. I have a slave that is very far behind the master. When I do show a processlist, there is only one system ...
1
vote
1answer
26 views

Localization: One table or multiple tables? (MySQL)

I need to be able to store string messages in various languages. I guess I need a column for each language string. For example my columns could be: ID | message_EN | message_DE | message_FR Now, I ...
0
votes
0answers
18 views

Statements in State “Copying to tmp table” disrupt performance

On a MySQL database (version 5.1.73) a Magento-Shop executes a statement (A) that uses distinct, see http://pastebin.com/A2sy45nF and therefore is "Using temporary" according to "explain". ...
0
votes
1answer
22 views

Multiple left join hangs server

i've got problem with left join query. It connect's 3 tables and calculate sales value for categories. Query: SELECT categories.name, categories.id, ...
0
votes
2answers
33 views

How can I remove only consecutive duplicate fields when the id is not consecutive in MySQL

In this table, I have a price change history. The prices are checked regularly and as you can see, sometimes the price does not change. How can I take a specific sku and delete all cases where a ...
0
votes
0answers
13 views

insert data into mysql from mssql with arabic unicode

I insert data into MSSQL with arabic unicode. I want to insert this field into MYSQL but it insert empty. In MYSQL , I choose utf8-bin , I use php for this action, I declare name , character unicode. ...
0
votes
1answer
34 views

Cannot drop databse

I am unable to either drop database, now create the database. Following is the output. How can I fix this? mysql> show databases; +--------------------+ | Database | ...
0
votes
1answer
55 views

Optimize this query

SELECT `permission_tbl`.`service_id` AS `service_id`, `permission_tbl`.`shop_id` AS `shop_id`, `permission_tbl`.`easy_id` AS `easy_id`, `permission_tbl`.`permission_type` AS ...
-1
votes
1answer
23 views

Using Select statement twice for same column of table for MySQL

I'm supposed to write a query for a database that is a little tricky for me. It has an EMPLOYEE table that has these attributes(columns): Emp_Id,Name,Age, Dept_ID, Salary It also has a DEPARTMENT ...
-2
votes
0answers
29 views

DBA MySQL experience [on hold]

I am in a programming class (Python) as well as a database concepts class. I'm also taking an HTML/CSS class. I knew HTML years ago, but much has changed in 10 years. I have a good background in ...
0
votes
1answer
75 views

SQL execution 2 seconds with LIMIT parameter, without only 0.2s why?

This is my query and I need to return only 12 rows, but it takes 2 seconds with parameter LIMIT 12 while it takes only <0.2 to process all ~600 results (without LIMIT 12 or with LIMIT 1200 for ...
0
votes
1answer
29 views

How to design a query that gives count of different parameters based on different condition from a single table

I have a table books containing columns as bookid, issue_date,return_date. Once a book is issued from library an issue_date corresponding to it is made into the table while return_date can have valid ...
0
votes
1answer
21 views

SQL: return values as column table

I am running this query to get all returns for a list of tickers: select return1 from STOCK_DATA where TDATE between 20130101 and 20131231 and TICKER in (SELECT DISTINCT TICKER FROM STOCK_DATA) ...