MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
11 views

How to capture a manager highest level from bottom in mysql?

So I have a giant table of 100K employees. Every employee has a supervisor except our top boss. I want to capture a manager's level from the bottom. Sounds simple but now I have a series of views ...
0
votes
1answer
16 views

How to enable MySQL remote access?

I have a MySQL server and I want to enable remote access for a certain IP and localhost only. For some reason I couldn't manage to do it as it doesn't work every time I try. I typed the following ...
0
votes
0answers
30 views

Cleaning up orphaned metadata in information_schema

OK - so the server (Percona 5.6 in this case) 'went away' in the middle of declaring a constraint like so: alter table mytable add constraint fk_mytable_myothertable foreign key (myothertable_id) ...
1
vote
3answers
34 views

Insert if NOT EXISTS not working

I am trying to copy data from table to another mysql table from two different databases First I get all data from first table and stored them into php variable then I loop on that var to insert data ...
1
vote
1answer
22 views

Can I parse a text value from a specific column in a query (MySQL)?

I was playing around with Sakila and I ran across the actor_info view and one of its columns is film_info which is a detail of all the movies one actor has worked in. For example a query would be: ...
0
votes
0answers
11 views

Need to have many row values assigned to one row in different column

I need to assign many values from one column to only one row in different column within same table. can i do that. Example: Name Subjects John Maths History Science Ria ...
0
votes
1answer
36 views

How to convert rows into columns and query on them in Mysql?

I have three tables Patients, which contains the name of my patients, Controls which represents the UI controls which could be drawn for each illness , and ControlsValues table which contains the ...
-1
votes
1answer
37 views

Can we restore mysql db without .ibd & .frm files?

I have a data folder and the database folder with .frm & .ibd files is missing, any way to restore the database? Currently the data folder has: ibdata1 ib_logfile0 ib_logfile1
0
votes
1answer
16 views

How can I append new data from a particular mySQL table to an excel spreadsheet?

We have a database trigger that automatically adds new clients to a table when they first contact the server, it takes a number of unique identifiers that the client provides on first contact and ...
0
votes
0answers
17 views

Start MySQL Server in mac

I do not install mysql in /usr/local/mysql/ i move mysql to other folder when i start mysql server from terminal by this command: sudo MySQLDir/support-files/mysql.server start return me ERROR! ...
0
votes
1answer
23 views

Mysql slave status is completely perfect but data is not reflecting

I have setup replication using mysql utilities. Slave can able to read and execute master's position and binlog files perfectly. seconds_behind_master is also 0. But data is not reflecting into slave. ...
0
votes
0answers
12 views

Is there Merge and Snapshot replication methods for MySQL?

In distributed database systems, is Merge and Snapshot replication supported in MySQL? I am thinking of something similar to MS SQL's types of replication: ...
0
votes
2answers
36 views

Query to determine if items have tax [duplicate]

I have the following tables Item ID Name Item taxes ID percent item_id An item can have more than one tax I want to write a query that will give me all items with no tax. This query needs to ...
1
vote
1answer
23 views

(MySQL) user table and profile separate, or same table?

I'm creating a blogging site that anyone can sign up and be an author for. I want each author to have their own public profile. My main question is; would it be better practice to have a separate ...
0
votes
1answer
32 views

Index Strategy for MySQL Query that matches on one column and between two others

I have a table that contains a set of measurements for a continuous stream of processes. Although each process is individual, they are categorised into groups. The events have a start and end ...
0
votes
0answers
15 views

Formula/algorithm to merge and sort arrays into one [migrated]

I have four arrays that I need to merge/sort pragmatically. https://docs.google.com/spreadsheets/d/1e041YuQCUVu4_hgu1uCGaKILrL5a3WqReEeKtCeGLOs/edit?usp=sharing The link above shows the contents of ...
0
votes
2answers
29 views

Table JOIN and CREATE new table extremely slow

I'm using something like this to create a new table: CREATE TABLE result AS (SELECT calls.*, targ_with_planned_calls.* FROM calls INNER JOIN planned ON calls.first_id = ...
2
votes
1answer
28 views

MySQL auto increment column increases after insertion error occurs

I was doing some insertion tests in my database and I realized that when the INSERT statement fails, due error 1452, causes the auto_increment value increase by 1. Even though, there wasn't any row ...
0
votes
0answers
19 views

Facing Failed to read stream error - mysql_native_password error

I have been facing the following error intermittently on MySQL. Authentication to host '127.0.0.1' for user 'root' using method 'mysql_native_password' failed with message: Reading from the ...
3
votes
1answer
21 views

MySQL intersection on one table with time type

I've a table with 4 columns: id (int), name (varchar), timefrom (time), timeuntil (time) Now I would like to have all combinations where they have an intersection on the timefrom to timeuntil. My ...
1
vote
0answers
61 views

Why does this deadlock occur?

We're using MySQL with the INNODB storage engine. The account table is accessed by two different transactions. We didn't expect a deadlock because only one transaction is holding a lock (2): ...
1
vote
1answer
22 views

Need for backing up MySQL databases information_schema, performance_schema, mysql and phpmyadmin?

I know it's not necessary to backup the information_schema database, but what about the following databases (besides the user-defined databases)? performance_schema mysql phpmyadmin (So, in case ...
0
votes
1answer
39 views

How do I change the MySQL data folder path in a Mac?

How do I change the MySQL data folder path in a Mac? I am running OS X 10.10 & MySQL 5.6 In Windows I can edit datadir in my.ini For Mac, mysqld does not have parameter for --defaults-file=
0
votes
2answers
16 views

In MySQL, get number of pregnant women who received 3 ANC checkups

I am working on a project where it is required to find out the total number of pregnant women who have received 3 ANC(Ante-Natal Care) checkups done. A pregnant women is said to receive 3 ANC ...
2
votes
1answer
33 views

Levenshtein vs MATCH vs Others for best MySQL string match

I've a database with around 1.9 Million rows. My DB details Server: Localhost via UNIX socket Server type: Percona Server Server version: 5.5.42-37.1 - Percona Server (GPL), Release 37.1, ...
1
vote
1answer
37 views

MySQL: 'user'@'hostname' vs 'user'@'IPaddress'

I needed an user to be able to log in on our MySQL server 5.6 from machine foobarhost, IP 10.11.12.13. Therefore I created a user 'joe'@'foobarhost' but he was unable to log in. I had to create an ...
0
votes
2answers
46 views

MySQL Monitoring Script in Shell or Perl for Linux

I need a MySQL Monitoring Script in Bash or Perl for Linux. I found some but they are quite big with a lots of checks that are not useful at all for me and in this case I should customise the ...
0
votes
1answer
41 views

mysql: counting number of tickets which are open per day basis

I have a table tabName with the following rows: id(PK) .. Created(datetime) Resolved(datetime) Status(new/resolved/open) 1 2015-05-10 00:00:00 1970-01-01 .. open 2 ...
0
votes
0answers
52 views

Advice designing a stock management database

I am developing a webapp for my business, a mobile phone repair shop. The problem I have is I don't know how exactly to implement a way to manage the parts inventory. Here what i have now: ...
0
votes
1answer
23 views

Fast migration of field in MySQL

Right now I have the following tables items name (varchar) category (varchar) id ...etc I want to create a categories table and items_categories mapping table so i can start tracking categories ...
0
votes
2answers
52 views

Why do these concurrent MySQL inserts deadlock?

I am baffled by this deadlock: ------------------------ LATEST DETECTED DEADLOCK ------------------------ 150511 18:42:43 *** (1) TRANSACTION: TRANSACTION B8972CA4, ACTIVE 0 sec inserting mysql ...
0
votes
1answer
27 views

master slave crashing daily

I have implemented a master slave config several times and each time the process goes well and works for a day or two but soon bombs out saying that replication stopped because such and such table ...
0
votes
3answers
44 views

secure way to connect with remote Mysql database

I created my application using MySQL and it relies completely on the database I have around 190 tables, and I'm afraid of security breaches and another problem is for remote access I have to add the ...
0
votes
0answers
20 views

Plesk 12 Debian 7 MySQL CPU usage is too high

I have a problem with MySQL and MySQL CPU usage at Plesk. I have a news site with Joomla, and about 100-150 online user. CPU: AMD Opteron(tm) Processor 6366 HE 3 core Memory: 4GB HDD: 250 GB Plesk 12 ...
0
votes
0answers
44 views

after a crash and disk i/o error, mysql won't start

We had an i/o error (don't know yet why) but we restarted the server, run an fsck and everything seemed to be fixed, the server booted ok, just that mysql doesn't want to start. Nothing works, we have ...
1
vote
2answers
53 views

Mysql Query for Multiple table

I have two table question and answer. The structure is given below CREATE TABLE IF NOT EXISTS `question` ( `id` int(10) NOT NULL, `question` varchar(100) NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=3 ...
0
votes
0answers
23 views

Temporary tables and Fetch times

We've noticed something curious in our office which no one seems to know the answer to. I'll explain: We have some mildly complex queries, one of which executes in under 3 seconds and then has a ...
0
votes
2answers
39 views

How to calculate mysql server reads per second,writes per second?

Can anyone let me know how to calculate mysql server writes,reads,deletes,updates per second.
0
votes
1answer
27 views

SELECT ROWS WITH SIMILAR ID AND MERGE THE FILED VALUES IN ONE

My situation is as follows. I have the query below and the query is doing its job pretty well. However I have excluded one able from it which is field_data_field_luogo and the rows inside this can ...
0
votes
0answers
9 views

Mysqlfailover command - No slave is listed in health status

I have suuccessfully created replication using GTID_MODE. It works perfectly. Now i need to setup automatic failover feature in it. I have run the following command. "mysqlfailover ...
1
vote
0answers
21 views

How to display all the dates between multiple two dates in a table?

I want to display all the dates between two dates for a particular record And this is the table : ID Start_Date End_Date 1 2013-01-14 2013-01-18 2 2013-02-01 2013-02-04 and now i want to get all ...
0
votes
2answers
25 views

MYSQL Row Count Limits?

What is the maximum row count for a table in MYSQL? I have a system with around 600,000,000 rows in three tables. Average Data Length (from data_length column) for these tables is 58,000,000,000 ...
0
votes
1answer
11 views

How to remove some data not needed on new row from mysql query with rollup

Hello I have a problem with the rollup mysql query. I want to get total of each column. I use mysql SUM() and ROLLUP to get the result. But on the new row that is added it copies the data of the last ...
0
votes
0answers
31 views

MySQL my.cnf performance tuning Need some advice

Our architecture is as follows: Memory : 132GB CPUs : 12 OS & Mysql : 64-bit Disk Space : 2.0 TB DB Engine : MyISAM i only have 1 table innodb (around 400mb) all the rest are ...
0
votes
0answers
30 views

CREATE OLAP server

I have a MySQL database server along with replication server, i.e. OLTP system altogether. As I have very heavy data fetching queries for the decision making reports. I need to create data-ware house ...
0
votes
0answers
36 views

slave mysql server crash : mysqld got signal 6

Hi I am trying import a mysql logical backup file on server A.Server A and B are in master slave configuration and both running on same unix server.slave is running while import is in progress.Due to ...
1
vote
1answer
31 views

MySQL: Why statement-based binlog format cannot work with Innodb READ UNCOMMITTED or READ COMMITTED Isolation levels?

In MySQL documentation it's written: If you are using InnoDB tables and the transaction isolation level is READ COMMITTED or READ UNCOMMITTED, only row-based logging can be used. Why ...
4
votes
3answers
99 views

MySQL JOIN query produces wrong result

I have two tables complaints and complaints_reply in my MySQl database. Users can add complaints which are stored in complaints the complaints reply are stored in complaints_reply table. I am trying ...
0
votes
1answer
41 views

Having four different tables or having one table with one more field?

I have a website with 4 translation (That is Arabic with 4 different Persian translation), and I had exported each of these translations to different tables. Which one of these ways are faster and ...
0
votes
2answers
58 views

In mysql, find all instances of a named column that are not foreign keys

This one has had me trumped for a while! I want to run a query to retrieve all instances of a column (from information_schema, I guess) that ARE or ARE NOT foreign keys. Now, let me back of a little ...