MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
27 views

MYSQL View with LEFT JOIN return all possible combinations

I am working on a view that joins multiple table. The data will be entered on separate table based on RepairID. The view will gather the data that is linking to the RepairID. My problem is after I ...
0
votes
1answer
20 views

Database Dump/Backup but only to specific records?

This question is about MySQL Backup (or Dump) whereby i want to backup and store information from only information related to a person; SchoolA from the School Table in this example. So, I should not ...
2
votes
1answer
18 views

Have several rows, or one single row with a huge comma separated data?

I have many workers processes working at the same time. They grab an ID from a list called available_ids, work on that ID, and put that ID on a list, called used_ids. The list available_ids can have ...
2
votes
0answers
20 views

How can I allow a user to query a view but not the underlying table in MySQL?

I have searched for this question but cannot find an answer. Or, the answers I have found have been related to SQL Server. This is for MySQL 5.x. Anyway, say I have a table called Employees and in ...
1
vote
1answer
20 views

How to structure different types of a model in MySQL?

I am building an application where users can apply for small business loans. There are 4 types of loans (A,B,C,D). There are 10 commons questions no matter which type they choose, but then based on ...
0
votes
0answers
13 views

Mysql replication to empty db

I had a db master/slave setup that had hardware break on the slave. Now the server is backup I reinstalled mysql and setup replication the issue being backups are off. Is there a way to start mysql ...
1
vote
1answer
16 views

Can't create file /var/lib/mysql/user.lower-test

MySQL database has been problem free for a few months. Today when I checked for upgradeable packages using the Synaptic Package Manager it came up with the various MySQL components (-common, -client, ...
2
votes
0answers
11 views

Tuning Issue / Temporary Tables

I've got a MySQL database (MyISAM) that handles a lot of read/writes and uses temporary tables quite frequently. Recently it's started having massive load spikes at peak load, and noticed that there ...
1
vote
2answers
41 views

SQL - Select Rows in a Certain Order

I'm new here - if I missed anything in the question please let me know. I'm trying to build a people directory like LinkedIn has: http://www.linkedin.com/directory/people-a I don't want to fetch ...
1
vote
1answer
29 views

MySQL: not quoting WHERE conditions slows query execution

I just ran into a curious issue with MySQL. I had a very slow query, even if properly indexed, which was like this: SELECT * FROM `tbl1` WHERE `parm1` = 'taleggio' AND `parm2` = 10 As said both ...
0
votes
2answers
32 views

Where to place a foreign key column?

This isn't exactly related to modeling the database but rather about "standardizing" column placement. Where should I generally put my FK column? As the last column of the table? At the start just ...
1
vote
1answer
23 views

Need some assistance on MySQL Sub query

I have a table in MySQL. The table structure is as follows. id | emp_id | call_start | call_end | call_type -------------------------------------------------------- 1 | 20043 | ...
0
votes
1answer
24 views

MYSQL crashes on XAMPP while working with drupal

Good day, just today morning i was using drupal to add some content, it crashed and mysql shutdown unexpectedly at xampp!! last thing i was doing was inserting a data into a field with "auto complete ...
1
vote
1answer
20 views

Weed out certain rows where timestamp is within interval

Given a table structure: create table contacts ( contact_id int(8) not null auto increment, #primary key pid int(8) not null, #personal id contakt_time datetime, ...
0
votes
1answer
15 views

MySql Lock Tables Blocking Logic

The MySQL documentation (5.5) for Lock tables states: Let's say that I'm trying to lock table1 and table2 in a single query, but table2 is already locked. Will MySQL hold onto a lock on table1 and ...
2
votes
1answer
26 views

MySQL Filesort/Order By Slow

I've been struggling with a query for the past few weeks and it now just appears as gobbly-gook to me when I try to optimize. The query runs - at about 2.3 seconds, but I know there has to be a more ...
1
vote
2answers
26 views

sql join with laravel query builder

I have a transactions table with the following field: Transactions ID | amount | branch_id | supplier_id 1 | 1,200 | 2 | 1 Subsidiary ID | Name | Type 1 | supplier1 | 0 2 | ...
1
vote
1answer
22 views

MariaDB 10 InnoDB Partition with Data Directory

mysql --version mysql Ver 15.1 Distrib 10.0.20-MariaDB, for Linux (x86_64) using readline 5.1 I have a MariaDB 10 installed, though I tried with the 5.5 release in the CentOS repos. I'm ...
2
votes
4answers
89 views

Are junction tables a good practice?

Say I have a large table that holds the user's info and another table that holds several locations. Then I use another table that holds the user_id and the location_id. In order to retrieve the data ...
0
votes
0answers
25 views

Optimization of stored procedure MySQL [on hold]

I have a stored Procedure comparing two tables. This uses Cursor comparison logic , Source and the target cursors are used to compare two tables and find out the differences in tuples . This ...
2
votes
2answers
40 views

Fulltext search using multiple indexes

I have a table with several columns, say a, b, c, d that should be searchable. The problem arises when I need to search a, b, c separately from d (and vise-versa). AFAIK, there's no way to achieve ...
1
vote
0answers
21 views

Complicated MySQL table reorder

I should do really complicated tables reorder. ****The main table looks like:**** id - some data 1 - ... 2 - ... 3 - ... 6 - ... 9 - ... 12 - ... As you can see, there are "empty" IDs (no 4, 5 ...
1
vote
2answers
31 views

How to use a MySQL error handler in a stored procedure with prepare/execute

I have a procedure defined like this: drop procedure if exists drop_tables_like; delimiter $$ create procedure drop_tables_like(myint int, pattern varchar(255), db varchar(255) ) begin DECLARE ...
3
votes
1answer
45 views

Missing DB entries

I have run into a problematic situation. I oversee the administration of 5 php web pages on one server, each having their own database. All pages work like interactive forms drawing and storing data ...
-3
votes
0answers
8 views

a phpMyAdmon database question [on hold]

I have two tables in database of phpMyadmin. One table is symptoms table, and 2nd is diseases table. The symptoms table has two columns: smpid and symptom The diseases table have three columns: ...
2
votes
1answer
24 views

I created a DB schema for a project relating to collecting comments for web pages, is relational the way to go and how are my relationships?

I'm curious if relational DB is the way to go, if the current relationships in the diagram make sense, and whether it will bode well for coding.
1
vote
0answers
21 views

MySQL: Using DATE_SUB to subtract business days instead of all calendar days

I am looking for a robust solution to subtract the number of business days from a date. I am using DATE_SUB however it subtracts all calendar days. For example, if today is Monday and I subtract 2 ...
1
vote
0answers
26 views

Help with PHP code, SELECT from database [migrated]

<?php session_start(); include ('connection.php');?> <?php $username='pablorex192'; $consulta=mysql_query("SELECT question FROM users WHERE user = $username") or die ('This is the error: ...
2
votes
2answers
45 views

Modeling invoices and orders

I have a problem in modeling a database that contains orders and invoices. Actually it's more of a problem from a business point of view, but it's related to modeling the database nonetheless. Model ...
3
votes
1answer
32 views

Modeling discounts - Product specific and Customer specific discounts

I have a reasonably simple database but have the following problem: I'm modeling a store + a lot of non-relevant stuff database. I have the following problem. I want to allow for specific products to ...
3
votes
1answer
18 views

automatically change value on the table mysql

i have table invoice in my database that contain atributes 'due date', 'date' and 'status'. What i want is data on 'status' change automatically. Example, status (unpaid change to expired) when date ...
2
votes
2answers
16 views

Any ideas on how to parallelize mysql_upgrade?

I am migrating from 5.5 to 5.6 and would like to speed up the mysql_upgrade process. I have thousands of databases per machine and 200 tables (innodb) per db. Any suggestion how to speed up the ...
2
votes
0answers
17 views

Mysql high cpu usage - cpanel

After an update from whm, I see a high CPU usage from MySQL (5.6). my.cfg: [mysqld] slow_query_log=1 slow_query_log_file="/var/lib/mysql/slow-query.log" long_query_time=1 skip_name_resolve ...
1
vote
2answers
16 views

Mysql user accesable with out password from the host machine but not from the remote machine

I have setup mysql and created a user 'test' and have given a password for it. Strange thing I observed is, for test user I am able to access with out password from the machine I have installed mysql ...
2
votes
1answer
27 views

Is there any difference between 'LIMIT 0, 1' and 'LIMIT 1'?

I recently stumbled upon example codes, which differed by these notations. SELECT * FROM table LIMIT 0, 1 SELECT * FROM table LIMIT 1 The first argument should be considered as the offset if I'm ...
0
votes
0answers
17 views

nbsp character might not be passing as nbsp to the MySQL backend

I am following a tutorial where a web application written in PHP, blacklists spaces from the input(The 'id' parameter). The task is to add other characters, which essentially bypasses this blacklist, ...
2
votes
1answer
89 views

Does PostgreSQL support online schema modification (DDL)?

Recent versions of MySQL (using InnoDB) support many alter table queries without exclusive locking the table. Does PostgreSQL support this to any level? That is, can I add/drop columns from a table ...
-2
votes
0answers
17 views

performance of dml statements in mysql [on hold]

how can we increase the performance of insert and update statements in mysql procedure. and also if a procedure has only updates statements Blockquote ...
2
votes
1answer
20 views

Database design, many rows or many columns?

I am aware that this has been discussed before, but I've read conflicting information about this particular topic, so I'm hoping for a bit more decisive opinions from you. I have multiple tables, ...
1
vote
1answer
40 views

Update records from one table to another in different databases where condition is accomplish

I have two tables stored in two differents DBs and I need to perform some sync between both tables based on lastmodifieddate and lastSyncAt. Let's call them as db1 and db2. This is the DDL schema for ...
2
votes
1answer
33 views

Migrating Oracle 9i database to MySql database on a different Windows Server

I need to migrate my Oracle 9i database with all its tables from windows server 2003 to MySql on another Windows Server 2012. The oracle database is connected to Visual Studio web project. I have ...
1
vote
2answers
41 views

How can I retrieve the column names of a table in mysql?

I have a table with n columns. I want to retrieve the first 3 column names of that table. Should be something like this: Select column_name(3) from table_name="sample";
2
votes
1answer
69 views

Configuration required for a big mysql database around 20GB

I need to host a single machine database (constraints), wherein the database size is roughly 20gb. Most of the tables are in MyISAM. Any way I can actually run it with decent speed ? Alternatives I ...
1
vote
1answer
29 views

RDS Replication Error (Apply Error 1406 / Truncation)

I have a MySQL RDS instance as a master, created a Read Replica from it, and ran some schema change operations on it. To be specific, I changed the charset and collation of all the tables and columns ...
1
vote
1answer
72 views

two similar queries with different results (one very slow)

Two almost identical queries, but one is extremely slow. All tables are innodb. Explain statements attached, but I don't know how to resolve it. userHits (table structure) -id - int - primary ...
1
vote
1answer
34 views

MySQL: OPTIMIZE TABLE vs. myisamchk

I have a very large table (~50GB) and periodically rows are purged from it and I want to run OPTIMIZE TABLE to recover the space. But I do not have enough space to run it. If I do run it the server ...
1
vote
1answer
28 views

How to write marker messages into the MySQL general_log?

I'm build a performance testing harness for our distributed web app. I'm using JMeter to drive it by simulating poorly performing parts of the app from the web side. I've set up MySQL to log to the ...
1
vote
1answer
39 views

mysql replication and innodb_file_per_table

Is it possible for the master (5.1) to have innodb_file_per_table = 0 and for the slave (5.1 or 5.5) to have innodb_file_per_table = 1 ?
1
vote
0answers
39 views

Can I create a trigger in mysql and update the same to oracle database? [closed]

I am trying to replicate data from mysql to oracle db. Is that possible by creating triggers in mysql?
4
votes
4answers
667 views

SQL query to find player with maximum runs

I have the following tables with me : Table 1 Title : Runs +------------+---------+ | P_ID | Runs | +------------+---------+ ...