MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
11 views

MySQL script writing slow

I'm using php and the exec() function to run 2 MySQL script files one after another The first file has approx 2k update statements (see below) in and is 114kb in size. UPDATE table1 SET is_active = ...
0
votes
1answer
14 views

auto increment for the table with 1000 of records in mysql

How to reset auto increment for the table with 1000 of records in mysql. I want it to start counting from 1 again.
0
votes
1answer
10 views

Shell script for partial table backup

I have multiple database in my MYSQL server and i want to take some particular tables backup from each database. can anyone help me in writting a shell script for this scenario.
0
votes
0answers
7 views

How do I do an outer join between all nested subqueries? (getting an error of 'OUTER' is not a valid input for this position)

I have this query: SELECT AVG(a.score) AS Average1, AVG(b.score) AS Average2, AVG(c.score) AS Average3 FROM (SELECT subfactor.score, dateID, EmployeeID FROM employeescore LEFT JOIN ...
-3
votes
0answers
22 views

Hi this is my requirement can you help me?

Student sid name address phno 1001 abc nellore 1342425 1002 xyz allur 98876545 mark sid m p c 1001 45 34 34 1002 62 13 78 fee sid fee 1001 ...
0
votes
1answer
20 views

Query results that not are in previous query result

I want to retrieve from my table the id_product of the products which haven't got some attribute and it's value is not the ones i want For example i want the id_product of the products in which ...
1
vote
3answers
42 views

MySQL: List databases with tables

Is there a way to list all my databases with tables in a single command? Expectation: mysql> SHOW DATABASES, TABLES; DB1 table1 table2 DB2 table1 table2 table3 ...
0
votes
0answers
12 views

maxscale read/write split with mysql

I am setting up mysql MMM with two slaves. I will use slaves for read only and master for writes only. I do not have read/write split in application. I came across maxscale program. I was wondering if ...
1
vote
1answer
26 views

BLObs – Should I Store In Database Or in Directory Structure?

BLObs – Should I Store In Database Or in Directory Structure I have been developing a database to replace an ageing data structure that contains 1000's of files within a directory structure. The ...
0
votes
1answer
29 views

Stored procedure to check if username exists

I'm trying to write a stored procedure So far I have this, but it always returns 1 CREATE DEFINER=`root`@`localhost` PROCEDURE `USER_EXISTS`(IN `USERNAME` VARCHAR(64) CHARSET utf8mb4) SELECT CASE ...
0
votes
1answer
20 views

How to pass the input parameters to dynamic Pivot stored procedure

This Is My Query: DELIMITER $$ DROP PROCEDURE IF EXISTS `leavemanagement`.`SP_ViewAttendance` $$ CREATE PROCEDURE `leavemanagement`.`SP_ViewAttendance` ( IN in_branch_id varchar(10) ) BEGIN ...
0
votes
1answer
26 views

Merge multiple columns into one column in different table?

I've done this before, but I don't remember how. I need to select all rows from several columns in one table and insert them into one column in a different table while keeping them all on separate ...
0
votes
0answers
6 views

When will store procedure/functions support result set as return type

I have noticed that MySql doesn't support result-set on a store procedure and functions, which means return a table. So I can't do things like CALL sp_my_store_procedure() ORDER BY id ASC; Or ...
0
votes
2answers
11 views

Compare values in SQL having dots

I'm comparing values from two different database. In one table the name is stored with dots(i.e A.B C) and in another table the same value is stored as AB C(i.e in second table none of the names ...
-1
votes
1answer
13 views

restore mysql 5.0.77 backup to mysql 5.5 [on hold]

I am having backup of mysql version 5.0.77. I want to restore backup of 5.0.77 to our new machin having mysql version 5.5 What is the procedure?
0
votes
0answers
9 views

i want to get Hierarchical structure of category and subcategory for nth level in one mysql query

i want to get Hierarchical structure of category and subcategory for nth level in one mysql query. i try some solution but it's not work properly. i try following query but it only get only ...
0
votes
0answers
25 views

MSSQL - Creating backup of 1 day worth of data and then merge them to make a full database [on hold]

I am new to this forum let me know if there is any update to be made. Use-case: I would like to create a snapshot daily which would have 1 day worth of data for 7 days and then combine it with ...
0
votes
3answers
30 views

Prepopulate database with empty / null values [mysql]

What would be the best way to pre-populate a database with 100 empty fields and then begin the Auto_Increment? What I mean to say, I want to reserve the first 100 userfields (ie UIDs which are ...
0
votes
2answers
24 views

MySQL replication - how to read from slaves? manually?

MySQL Manual - Replication: "Scale-out solutions - spreading the load among multiple slaves to improve performance. In this environment, all writes and updates must take place on the master ...
0
votes
0answers
9 views

What is the best way to implement user accounts and privileges? [migrated]

I am wanting to make a website with user accounts, but am not sure what the best way is. User accounts require security and i'm not sure how to approach it, I know I could use a database username and ...
1
vote
1answer
18 views

MySQL Replication Master Slave Architecture - Web app that is based on the SLAVE DB

We are developing a web application (Spring mvc based app) that uses a MySQL DB. (lets call it the "original app") The DB architecture uses a MASTER-SLAVE configuration with replication. The web app ...
0
votes
1answer
12 views

Adding a column to aggregated data where new value only applies to a subset of the aggregation

Having trouble explaining this. I have a table like this: Label | Value A | 3 B | 1 C | 4 And another like this: Label | Value | ID A | 1 | ID1 A | 1 | ID2 C ...
0
votes
1answer
11 views

MySQL Replication, Can i add a trigger to the SLAVE db?

Is it possible to do so? The trigger will insert some rows into a unique table that exists only on the slave.
0
votes
0answers
31 views

Very high CPU caused by mysql service [on hold]

A running mysql service uses CPU in a crazy way. (See attached screenshot from htop) I followed the instructions here with no luck. My server specs: CPU: 1900Mhz . Intel Hexa-Core Xeon E5-2420 ...
0
votes
0answers
12 views

How to maintain relationship integrity when normalizing?

I need to copy several columns of data into several other tables in the name of normalization. Moving the rows themselves will be easy, I can do that. My dilemma, is how to preserve the hierarchical ...
-3
votes
1answer
21 views

MySQL Insert Performance

i've been tasked to check whether MySQL can be used for Large DataWareHousing Requirement is as following the Table contains 83 column each row pay load size is 1272 bytes the requirement is the DB ...
0
votes
1answer
60 views

Select the last massage for each user [on hold]

Please help me with a query. I know, that my english is not even on basic level, but I try to explain. I want to write a query that selects every last massage from each user (I want to create a dialog ...
0
votes
1answer
28 views

Suitable schema to record email sent and response received and invoicing in DB

When a form submission is made on a website: An email with form's details is sent to a set of recipients email addresses stored in a DB. The email contains a link for the recipient to show interest. ...
-3
votes
1answer
61 views

one or multiple tables mysql [on hold]

I have a table with 3 columns and i want to split it according to 3 last character in string of one column , it will be more faster or more performant or it's same one and large table ..?? i talk ...
0
votes
0answers
23 views

Centos 5.11 mysql-server 5.0.95 upgrade to mysql55w-server

Here's my thought process on my upgrade: mysqldump --all-databases > backup.sql service mysqld stop yum remove mysql mysql-server yum install mysql55w mysql55w-server service mysqld start ...
0
votes
1answer
21 views

MySQL UTF-8 Encoding Problem

I have two MySQL databases that are for Wordpress websites. One db is for a live version of a site, the second is a copy of the original that is used in conjunction with a copy of the original site. ...
0
votes
0answers
7 views

mysql workbench connection type tcp/ip over ssh with libpam-google-authenticator enabled

I'm attempting to connect to my MySQL Database using the Connection Method "Standard TCP/IP over SSH". I filled out all the SSH and MySQL connection details correctly, however I get the message: ...
1
vote
1answer
16 views

mysql RANGE partitioning - how do I find partition boundaries?

I am implementing partitioning support for mysql in eludia engine I need to compare partitioning description in model with actual database contents and alter table, if necessary. To extract all ...
1
vote
1answer
29 views

'accidentally' set 'CHANGE MASTER TO' on wrong server

while setting up the replication I accidentally did the 'CHANGE MASTER TO' on the master server instead the slave. When I noticed the mistake I just did a 'STOP SLAVE' on the master and setup the ...
0
votes
1answer
36 views

SQL CLR in MySQL?

Can we call SQL CLR in MySQL Server using User Define Function? I want to create trigger in mysql. It will call user define function and this UDF will update the table in SQL Server.
0
votes
1answer
27 views

Mysql master master with high latency

We have a single master setup with many slaves in germany and some slaves in australia. To have faster writes in australia we want a master-master setup between germany and australia. Read slaves ...
1
vote
1answer
29 views

federated tables? synchronization? replication? [mysql]

I have a REMOTE suppliers table with, lets say, a code and a name, and several client databases will be creating new suppliers. Server database code | name ______________ 1 | Mark 2 | ...
0
votes
0answers
12 views

Suddenly high CPU usage

I've read a lot about MySQL optimisation and I already optimised MySQL about a year ago. Reason for that was a high system load average. I tuned many queries and edited the my.cnf file. Since then ...
0
votes
1answer
22 views

Only LIMIT rows with specific number

Sorry for the title, As I'm not that experienced I had a real hard time trying to come up with a proper title. So I have this query to fetch all the comments of a specific topic. Now for my paging I ...
1
vote
1answer
23 views

My HD crashed and I can't start MySQL

I am on Windows 8, my SSD got corrupted and I installed Windows on a new drive. I had before MySQL 5.6.12, now I installed 5.6.17 and tried to move the entire data dir. The location of the MySQL ...
0
votes
0answers
16 views

MYSQL — Inventory View with calculated fields

Trying To create an inventory view. I have created this query using MS Access query builder since I am no pro at SQL and this is pretty convoluted. When translating this into MYSQL syntax I get an ...
1
vote
1answer
30 views

Why is the subquery apparently correlated? How to avoid it?

I have a table orders and a table orderpositions. The orderpositions (basically the items bought with the order) are linked via orderid (indexed) to the orders primary key. For a given set of orders ...
0
votes
0answers
17 views

MySQL workbench: Cannot Connect to Database Server (ssh)

General pointers would be appreciated -- it's likely I'm misunderstanding the mechanisms involved in a remote connection through ssh. I can use ssh to connect remotely, and then, through the CLI, ...
0
votes
0answers
17 views

Unable to count/Insert into database [on hold]

I am a beginner trying to select data from a table with seemingly millions of records. I tried running the select count(*) from MyTable; It doesnt return any results and either takes forever or ...
1
vote
1answer
38 views

MySQL Deadlock - accessing different primary key values also creating deadlock

I went through MySQL logs and found the reason for deadlock 1st thread is trying to execute below query. Which is waiting for thread 2. UPDATE M_SAMP SET MM_Q_IND=0 WHERE M_ID IN (SELECT M_ID FROM ...
0
votes
0answers
24 views
0
votes
0answers
13 views

Different encoding in one file after importing to MySQL

Trying to import ONE SQL dump into the MySQL database by "source " command, and half of text (posts table on the forum) is going ok ("as is") but second half converted to another encoding. Anybody ...
1
vote
1answer
18 views

Import SQL dumps (tables) in folder from shell

Im trying to import SQL tables (actually this is files, one file for 1 table), and this is files are too big for importing in phpMyAdmin. It needs to be imported from shell. I know the command "source ...
1
vote
1answer
15 views

Alter all table's - discard tablespace

After having an awful experience with a dedicated server and spending 3 whole days repairing corrupted databases (Yes I know.... backup!).... I have narrowed the issues down to a few websites. The ...
0
votes
1answer
13 views

Mysql events table

I am trying to create a script to backup all mysql databases. This is the command that I am trying : sudo mysqldump -u user -ppassword --all-databases > /tmp/all-database.sql And this is the ...