Tagged Questions
MySQL : Open-Source, Relational Database Management System
0
votes
1answer
19 views
Inserting data into multiple tables
For my system, students are required to create a user account by completing a registration form (personal, contact and course details; also username and password).
I need to collect registration data ...
0
votes
2answers
21 views
Sql statement to compare two table
I have two table with the same structure, i want an sql statement to compare them and see any modified line, deleted or added
Table Product1 :
________________
|Product | Price|
|Product1 | 10 |
...
0
votes
1answer
10 views
How to disable HTML output in mysql console?
I've used several mysql instances on many servers, but this one had a suprise for me tonight when I tried to use its console for the first time :
me@MYSERVER:~$ mysql -H my_base (....)
(...)
Server ...
1
vote
2answers
20 views
Perform group by with random group expression (randomly partitioning rows) MYSQL
Let's say I have a table (with millions of rows)
cat1|cat2|value
A | B| 10
...
and I want to group the data by cat1 and also split the grouping into 10 (at least roughly) equal partitions of ...
1
vote
1answer
29 views
What subquery do I need to calculate this report?
I have two tables: tickets and comments. I need to run a report that shows me which ticket is "neglected" meaning that there has not been a comment in X amount of time.
If I was to do this in PHP, I ...
0
votes
2answers
25 views
Building a dedicated physical MySQL server
I have a database that I use to mine a "primary" 20-column table with 18 million rows and growing by about 2 million a week, and that may accelerate. I am working to pre-process data by running PHP ...
0
votes
1answer
14 views
Perl - MySQL/MariaDB - slow with no identifiable bottleneck
I am running a Perl script (using DBI) which reads from raw files from a hard disk, and updates MySQL database (which is on a separate SSD). My performance is rather slow (1000 files processed in ...
0
votes
0answers
12 views
LDAP authentication with Percona Server
Reading over this post it seemed to indicate this plugin allowed user authentication via LDAP
Percona Server is bundled with the PAM plugin which opens a plethora
of ways to authenticate to ...
0
votes
2answers
30 views
Using a join to return multiple values of the same column?
I have two tables
user
Rank
In the Rank table, I saved rank_id and supervisor_id. In the Rank table, I stored the rank name. The rank_id and supervisor_id are foreign keys from the Rank table.
...
0
votes
0answers
22 views
SQL SELECT - adding field to SELECT with JOIN is changing the results
I have a SQL sentence with JOIN, running on mysql 5.5.16:
SELECT DISTINCT (ot.orders_id), ot.value
FROM orders_status_history osh
INNER JOIN orders_total ot ON ( osh.orders_id = ot.orders_id )
WHERE ...
1
vote
2answers
28 views
How to insert values into a table from two different tables?
I have three tables
students table
------------------------------------
id(PK, A_I) | student_name | nationality
teachers table
------------------------------------
id(PK, A_I) | teacher_name ...
1
vote
1answer
30 views
pass data from deleted table to another
This is the situation:
I have a table, with name TABLE_1 I would like delete TABLE_1 and then create another table with the same name and some of its columns.
TABLE_1 has records, but I need to pass ...
0
votes
1answer
26 views
Auto refreshing a query
I have a SQL statement
update test_1 set `t_mark` = (`mark_1` + `mark_2` + `mark_3`)
which works perfectly but I want the same statement to repeat automatically when a new row is added.
0
votes
1answer
24 views
Tools for migration from MySQL to PostgreSQL [on hold]
I have been trying with RazoSQL, mysql2pgsql and dbconvert. But none of this worked fine for me.
2
votes
2answers
46 views
MySQL 5.6: Slave_IO thread stops working
Standard replication breaks for no apparent reason.
mysql> SELECT @@version, @@version_comment;
+---------------+----------------------------------------------------------------------------+
| ...
-1
votes
1answer
28 views
Btree index and Bit Map Index [duplicate]
Please clarify the difference between BitMap Index and Btree index. I am using mysql version 5.5.37-0ubuntu0.12.04.1.
I can able to create Btree index but unable to create the same,
Please find the ...
0
votes
1answer
29 views
Inheritance discriminator column better int or varchar or enum?
What is the best practice for storing a discriminator column ? Does it make any difference ?
Any pros/cons of using one over the other ?
I am using MySql with Entity Framework but the question goes ...
1
vote
1answer
14 views
MySQL Cluster MaxNoOfConcurrentOperations and RAM
Why increasing of MaxNoOfConcurrentOperations lead to higher consumption of RAM?
I need high value for fast filling tables with some random data, but i noticed that my datanodes are swapping at ...
0
votes
1answer
21 views
ON creating BITMAP INDEX on a table in mysql throws error
say, i have database named "demo_dev" database and added a table named "countries".
i wanted to create bitmap index on a column say region as it has less unique values using following query.
CREATE ...
0
votes
2answers
25 views
Mysql checksum for master-slave replication returning different values, despite being identical
I've set up a master slave replication in mysql and to make sure that I know if the data starts getting out of sync I created a script that:
Locks both databases on both servers.
Prints the ...
0
votes
1answer
28 views
how to view the Image in mysql DB
Hi How to retrieve the image in mysql
I had created a table employee_details
CREATE TABLE `employee_details` (
`emp_id` int(50) NOT NULL,
`emp_name` varchar(50) NOT NULL,
`dept` varchar(50) ...
0
votes
1answer
20 views
How to connect to remote MySQL server with sshuser and mysqluser being distinct
I'm trying to connect to a remote MySQL server via ssh so that I have write-access to export some data. At the moment I can do the following:
Connect to the remote MySQL using mysql -u mysqluser ...
1
vote
2answers
55 views
Get only the oldest entry in a join
So I have a table bugs
|bugid| title|
the table is lacking a date column. But when creating a new entry, most likely always a new entry gets created in bugnotes as well saying "bug created" with the ...
1
vote
0answers
23 views
MySQL WRITE LOCK Not Preventing Inserts
This should be a simple task. Can someone tell me why the below code is still inserting rows?
lock table wp_postmeta write;
insert into wp_postmeta values (null, 1,'test','test');
I've checked my ...
0
votes
1answer
25 views
Load csv into MySQL database programmatically
I know about LOAD DATA INFILE command -- however, this requires that we already have the table with appropriate columns in place. When I have csv with hundreds of columns, it is not feasible to type ...
0
votes
1answer
17 views
How to optimized mysql query having large dataset
I have two tables in MySql with the following schema,
CREATE TABLE `open_log` (
`delivery_id` varchar(30) DEFAULT NULL,
`email_id` varchar(50) DEFAULT NULL,
`email_activity` varchar(30) DEFAULT ...
0
votes
1answer
39 views
How to simulate a table join on itself?
Let's assume this is my current data:
product_number date value
100 2010-01-01 1
100 2010-02-01 1
100 2010-03-01 1
200 2010-01-01 1
...
1
vote
1answer
12 views
Select the last logged change before a specified time from a change list
I want to get the last change for all issues issue, that was made before a specified end time. I have 3 tables.
projects
+---+------------+
|ID |project_key |
+---+------------+
|1 |bug_tracker |
...
1
vote
1answer
26 views
MySQL Cluster ndb_desc and parttions
I have mysql cluster with two datanodes and noofreplicas=2. According to documentation there must be 1 nodegroup, 2 partitions and 4 parts at all (2 primary and 2 backup).
I have a table with 1000000 ...
-3
votes
0answers
23 views
Delete & Truncatehttp://dba.stackexchange.com/questions/30325/delete-vs-truncate [duplicate]
what is the major difference DELETE vs TRUNCATE delete and truncate the data base ???
0
votes
2answers
30 views
Query Cache Implementation Details
I am new to DBA stack exchange & this is my first question. Kindly help me in finding a low level documentation for Query Cache module in MySQL since I am planning to work with the source code of ...
1
vote
2answers
56 views
Restoring MySQL Tables from .ibd, .frm and mysqllogbin files
For some reason, when I try to open up my tables that are stored in .frm and .ibd files (whether on MySQL or phpmyadmin) it gives me a syntax error or it says it does not exist. I've read the other ...
0
votes
1answer
39 views
Could not access database
I have been trying to setup a local instance for a new application. I am new to MYSQL and I cannot understand how to actually connect this database to the actual web application sitting in the ...
2
votes
2answers
65 views
I need help optimizing a not that complicated query that returns unexpedcted performance problems
I have a table that stores details about incoming and outgoing phone calls such as when a call was made, or when a call was received, the phone number of the caller, and the phone number of the ...
2
votes
1answer
6 views
MySQL Stored Procedure Requiring SUPER
I'm trying to figure out a "safe" way of allowing a non-SUPER user to execute a specific command requiring SUPER privileges, i.e. SET SESSION binlog_format = 'MIXED'. I don't want to grant the user ...
0
votes
0answers
10 views
MySQL Is there a performance difference between col = val and col IN (val)?
Is there a significant performance difference, or any other reason why I shouldn't write, for example:
SELECT * FROM table WHERE col IN (val);
Instead of:
SELECT * FROM table WHERE col = val;
I ...
0
votes
1answer
15 views
MySQL Syntax - Searching points within polygons using GeomFromText
I am trying to select points within polygons using the GIS/spatial extensions for MySQL. I'm fairly new to this, so bear with me if this is an elementary question.
I have points defined as text ...
1
vote
1answer
12 views
my phpMyAdmin data is hashed or hexed?
I have a mySQL db setup in MAMP in which I connected mySQL Workbench to administer the design of the database.
When I inserted some data today from within myPhpAdmin (localhost:8888), I noticed the ...
0
votes
0answers
17 views
How to manage “up to date” data and data “in use”
On my CMS, we can update/modify data. I want to implement a "deploy" function ,which can be used by only moderators, to save this data and enable access to it through my webservice. Only data deployed ...
0
votes
0answers
20 views
Mysql 5.5+ replication heartbeat feature
I am writing scripts to monitor replication,
and while analyzing effect of MASTER_HEARTBEAT_PERIOD keeping in mind about 3 TCP parameters viz : tcp_keepalive_time, tcp_keepalive_intvl, ...
0
votes
0answers
21 views
Function performance issue
This one is puzzling me since yesterday and maybe someone could shed some light on this.
We've got this table that records GPS data. We're currently doing some overloading tests to see how the ...
3
votes
1answer
53 views
Percona MySQL 5.5 Unique key is duplicated
I'm totally out from ideas, so maybe somebody else could answer my question.
We have a MySQL 5.5 server from Percona with high traffic. The application is in PHP and writes always to master. We have ...
0
votes
0answers
15 views
How to join two tables and fetch in android apps using js
I am doing a project on Android apps using Eclipse Juno. I am using MySQL as the database connection.
The app is about getting an appointment with a doctor of some particular department (let's say ...
2
votes
1answer
32 views
Efficiently searching geolocations - LAT/LNG and DECIMALs
I have a database with > 7.5 million rows (and growing), each with an image record that has a specific LAT/LNG geolocation representing where the photo was taken, stored as DECIMAL values -
...
0
votes
0answers
35 views
Select and sum from related columns
I have table with the following columns: date (month), hours/days (31) and daily tasks (31)
Columns:
date day1 day2 day3....task1 task2 task3....
Records:
june 4 6 2 .... run walk ...
0
votes
4answers
29 views
Converting to MyISAM, `foreign_key_checks = 0` Not Working
At the end of a long series of compromises working in a system I didn't design, own, or maintain, I need to convert a number of MySQL InnoDB tables to MyISAM tables. However, when I attempt to alter ...
1
vote
2answers
19 views
getting one day timestamp in mysql
Please consider the following stored procedure I have:
ORIGINAL Stored Procedure:
-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments ...
1
vote
1answer
45 views
How to make the SQL query more efficient?
I use mysql under Linux. My table is about 8000000 rows. The table has index(advertiser_id,activity_date),(activity_date,advertiser_id,activity_type).
The table is looks as following:
activity_date ...
0
votes
1answer
16 views
MySQL Update Multiple Rows in Large Table
I have a large InnoDB MySQL database table. I would like to run this query against the database table:
Update myBigTable Set someColumn=x WHERE userId = 7 OR userId = 88 OR userId = 22 OR userId = ...
1
vote
2answers
34 views
MySQL describe | more
With my current setup, it's going to be very hard, if not impossible, to get my terminal window to scroll up and down. That means I can only see 25 rows of text at once. If I have to display something ...