All versions of MySQL (not Microsoft SQL Server). Please also add a version-specific tag like mysql-5.7 if that is relevant to the question.

learn more… | top users | synonyms

0
votes
0answers
12 views

Grand read privilege to the user but is not allowed to grant the same privilege to another user?

i am a noob and this is how far i got so far, thanks and also how would you do it if you want to allow user to grant the same privilege to another user. GRANT SELECT ON DATABASE_NAME.* TO USER;
0
votes
0answers
37 views

Calculating Hoursworked [closed]

CHECKINOUT Table: USERID-----------CHECKTIME ---CHECKTYPE 7 -------------2016-01-08 13:29:41 -----------0 7 -------------2016-01-11 15:16:06 -----------I 7 ...
0
votes
1answer
45 views

Unable to install MySQL 5.7.12 in RedHat in a separate directory

I am trying to install the MySQL version 5.7.12 into RedHat in a non default data path. The installation syntax used /app/mysql/5.7/bin/mysqld --initialize --user=mysql --basedir=/app/mysql/5.7 ...
0
votes
0answers
17 views

AWS DMS creates tables with no auto_increment

I am migrating my databases to Amazon's RDS using their DMS tool. Pretty much everything looks great except that columns that were marked as auto_increment on the source database did not get marked ...
3
votes
2answers
36 views

SELECT other rows based on one matching row

I am trying to get related rows in a tag table based on one tag, where "related" means "having the same area_id". Example: tag area_id -------- ------- turkey 1 stuffing 1 carrots 1 ...
1
vote
2answers
17 views

MySQL Front - Workbench

We have MySQL Front installed in our server, I can connect to it with no problems, there is a db with tables, everything fine. Now I installed MySQL workbench (client) in the same server, but can ...
-2
votes
0answers
36 views

#1292 - Incorrect date value: '0000-00-00' [closed]

I refereed many question which having the title same as mine but has different approach and different issue so this question is not duplicate. I have a table in which column fm_sctrdate is date type ...
1
vote
1answer
15 views

database setup for posts table with multiple types

Struggling with how to set this up for speed and scalability. So basically i have a bunch of posts that depending on what type of post it is, it could have different input values that i would need ...
1
vote
1answer
53 views

Composite Primary keys and auto increment?

i'm developing SaaS app with multi-tenancy, and i've decide to use single DB (MySQL Innodb for now) for client's data. I chose to use composite primary keys like PK(client_id, id). I have 2 ways ...
0
votes
1answer
22 views

mysql Relay log file not found error while changing mysql data directory

I want to change data directory of my mysql server running 5.6.28 on centos 5.11. Its a slave to some master server. i have edited the config file ,moved the data contents from old directory to new ...
0
votes
0answers
12 views

Using MySQL session variables in a SSRS Report DataSet Query

I am creating a a SSRS report that connects to a MySQL database. In the DataSet I need to run a number of queries that load pieces of data in @SessionVar's that I can then piece together in the final ...
1
vote
1answer
57 views

Hoursworked/day computation via Bio Logs

This is my checkinout table: USERID CHECKTIME CHECKTYPE ------ ------------------- --------- 404 2016-02-12 07:24:03 I 404 2016-02-12 17:01:34 O 404 2016-02-15 07:24:21 I ...
0
votes
2answers
63 views

What is the performance impact of indexing a frequently updated column?

I just want to know if I'm doing this right. I've searched google for hours already and I can't find a straight answer. I have a table with potentially a very large amount of inserts and updates. Any ...
3
votes
0answers
49 views

Why would MySQL request a shared-lock after setting transaction level to READ UNCOMMITTED

Running a processing job in multiple parallel batches which basically reads big chunks of rows to update a few - it's OK here to use a lower transaction level since I know the relevant values won't be ...
0
votes
1answer
25 views

How to force MySQL master to overwrite the slave

We have a LAMP architecture website. Currently we have a production server running on the cloud and each developer has a complete copy of both the code and the database. Code is synced through Git ...
3
votes
2answers
55 views

How to format a phone number in a SELECT statement?

I have a database with table name student. I would like to display the register_number and phone_number of the student. The phone_number should be in the following format: +91-123-456-7890 and if ...
0
votes
0answers
33 views

Should I break up this MySQL table?

Existing table (more or less). It has about 1 million rows: id article title stage 1 zipfile name stage 1 delivery date stage 1 checked date stage 2 zipfile name stage 2 delivery date stage 2 checked ...
0
votes
1answer
28 views

Table of variable amount of skills for users

I am converting a Microsoft Access application into a website that uses MySQL, and I need to add a table into the database that holds a list of skills for each employee. There are a total of 35 ...
1
vote
0answers
50 views

MySQL is using swap memory while I have plenty of free RAM

I have a 6 GB buffer pool size for my database; however, mysqld process is moving to swap while there is plenty of RAM available. I think pool size and pages along with pool of reads and pool of read ...
1
vote
1answer
52 views

Cache query that is not stored in QueryCache

One of our Customers has an online-shop running xt-commerce 4.2. This version on the e-commerce-software has a very expensive Query for the category-tree. The query adds about 3 seconds delay and is ...
1
vote
2answers
16 views

Partial mysqlbinlog on latest binlog file

I'm trying to do a partial mysqlbinlog on the latest binary log file at a certain position therein (trying to extract just one query). mysqlbinlog --start-position=1234 --stop-position=1234 ...
0
votes
0answers
64 views

Delete query does not end

I have a following table with 1 million records : CREATE TABLE `activity` ( `id` int(9) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `subscription_id` int(10) unsigned NOT NULL, ...
1
vote
1answer
48 views

About count and or null

I am practising my MySQL in Leetcode and I've encountered this question: The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the ...
1
vote
0answers
41 views

MYSQL:[Note] InnoDB: page_cleaner: 1000ms intended loop took 4303ms. The settings might not be optimal. (flushed=396 and evicted=0, during the time.)

In MySQL5.7.11,the error log display the "[Note] InnoDB: page_cleaner: 1000ms intended loop took 4303ms. The settings might not be optimal. (flushed=396 and evicted=0, during the time.)" ...
1
vote
1answer
30 views

can't connect to mysql via command line but workbench works, ssh tunneling required

I am trying to connect to a mysql server running at B.edu. I want to connect via SSH tunnel. I first set this up in MySQL Workbench: Connection Method: Standard TCP/IP via SSH SSH hostname: B.edu ...
-1
votes
0answers
29 views

MYSQL - Select MIN integer in range A - B and is not C?

I have a simple table: CREATE TABLE IF NOT EXISTS `mytable` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data` VARCHAR(11) NOT NULL, `integer` int(11) NOT NULL, PRIMARY KEY (`id`) ); I need to ...
1
vote
1answer
40 views

What is the fastest way to insert data into MySQL memory table?

I need to insert 10M+ records into a MySQL memory table. A naive approach was to pipe records using shell, e.g. $ tail -10 ~/Desktop/test.sql INSERT INTO `test` (`a`, `b`) VALUES (4, 5); INSERT INTO ...
3
votes
1answer
53 views

When do MySQL DBA need root access

For a MySQL DBA, what operations require root access. I know that we need to be root for installation, starting and stopping services. With DBA’s not having root access, is there a way to perform ...
0
votes
1answer
50 views

Problems with queries [closed]

I have problems with queries in MySQL. Problem 1: Query: SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA="mysql" and TABLE_NAME="servers" MySQL says: #1054 - Unknown column 'mysql' ...
0
votes
0answers
29 views

Updating rows in multiple different tables using JOIN

Following is my MySQL SELECT query and it works. SELECT candidates.CandidateName, candidates.CandidateVotes, candidates.Party, candidates.win, candidates.NameOrder, ...
0
votes
0answers
48 views

improving performance of concurrent inserts on innodb with randomized primary

I was looking at my design for primary keys which is based on my own incrementing BIGINT key generator. It is designed to generate batches of 50 numbers for use on that process, but mostly it ends up ...
1
vote
0answers
19 views

MySQL 5.1 - Display the error-message returned inside a stored precedure

I'm trying to find an alternative to display the error-message returned from MySQL-5.1/5.5 inside a stored procedure. The example below is what I'm looking for, however it's seems to be only allowed ...
1
vote
0answers
21 views

Can MyISAM tables affect the backup recovery of innodb tables on Amazon RDS?

I have an Amazon RDS instance containing several databases. All the tables are innnodb except from one, that is MyISAM and currently cannot be converted to innodb. I know that the recovery of MyISAM ...
0
votes
1answer
27 views

MySQL5.7 (Windows) how to install from zip file without the Data Directory?

This has probably been asked before, but I am struggling to find the answer. Historically I have always installed MySQL (on Windows) from a template based on the mysql-xxx-win64.zip file. I would ...
0
votes
0answers
26 views

how to create tree view in mysql using stored procedure [closed]

I am confused. I don't know how to create a tree view in MySQL. I tried searching in Google and I don't understand how to query. Please help me. I have deptid | dept_code | dept_name | ...
0
votes
1answer
6 views

Mysql master slave communication

I was just working on mysql master-slave setup for incremental data backup from master to slave. For that I have to enable "bin log" in the master machine. So my doubt is how does master and slave ...
1
vote
1answer
16 views

How to disable annoying MySql update console

I have installed mysql 5.7, and from time to time (once per several days) it looks for updates (as I understand). Console window opens for several seconds, and then dissappear. It doesn't care, that ...
0
votes
1answer
26 views

Understanding geospatial queries in mysql [closed]

I asked this over on stackoverflow but haven't got a response, but I think this community might be better placed to answer I'm attempting to get my head around geospatial indexes in mysql and I'm ...
0
votes
0answers
18 views

Two -way replication on the same server

I have an ubuntu server, and I have a mysql with two database. I want to sync these two database (Two way replication) either via php or command line. I have searched a lot, but I cant find something. ...
1
vote
1answer
38 views

Slow MySQL query with Group by

I have a query that is taking a long time to execute minutes and more. The two tables orders and tickets have around 150k records. This is the query: SELECT orders.id, count(distinct tickets.id) ...
1
vote
1answer
34 views

mysql query parent child relation get childs

I have a user table in mysql. per user has got a parentuserID in the same table. i want to crate a function that give me the all child users when i give the UserID. my table structure is below. DROP ...
1
vote
1answer
27 views

MySQL -> Loop through a table, running a stored procedure on each entry

I have a database with 'books' (short stories for children) and it would be extremely informative to have word counts of each word in the books. I figured out how to get the word count for each word ...
1
vote
1answer
21 views

How to handle id's referring to multiple tables in an SQL database

I'm working on an MySQL Database for my website but I'm not sure on how to proceed now. I get to the point where actions have requirements in multiple other tables, but also have influences in ...
1
vote
1answer
43 views

(MYSQL) Select union of rows depending on row before?

I have a table in MySQL that looks like this: CREATE TABLE IF NOT EXISTS `mytable` ( `id` int(11) NOT NULL, `data` VARCHAR(255), `otherid` int(11), ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT ...
0
votes
1answer
69 views

Receiving “General error: 1030 Got error 168 from storage engine”

I am not sure if this is the right Stack Exchange to post to or not (StackOverflow figured it belonged elsewhere, so maybe it will do better here?) but I keep receiving this MySQL error when I try to ...
0
votes
2answers
34 views

Encrypting a Database row-by-row

I have a large database (millions of rows in hundreds of tables) that contains sensitive data (Think SSNs, account numbers, etc). I am tasked with safeguarding the data and have chosen to encrypt only ...
1
vote
2answers
52 views

How to improve performance of a query with an IN subquery

Get the count of other users having the x tag with order_id in order_id of users having the y tag table: MyCustomTable (200K rows) order_id user_id type ('x' and 'y') my custom tags and the ...
0
votes
1answer
32 views

Display the error message returned form Mysql

I need to get the whole error message returned from MySQL and assign it to @error_string : DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN SET @error_string = ...
2
votes
1answer
40 views

Prevent duplicate entries

I have log in form with Username and Password. $con=mysqli_connect(LOGINDETAILS); /*if (!$con) { die("Can not connect: " . mysql_error()); } */ $Username = $_POST['Username']; $pswd = ...
2
votes
1answer
47 views

REGEXP does not show the right result?

I have in the name column: 3 boxes of frogs 7 boxes of frogs 48 boxes of frogs When I execute: SELECT name FROM items WHERE name REGEXP "[^1-5] boxes" ...the result is: 7 boxes of frogs 48 ...