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

3
votes
1answer
54 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
51 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
31 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
1answer
52 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
26 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
23 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
31 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
1answer
9 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
19 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
41 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
29 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
23 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
79 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
36 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
53 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
42 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 ...
0
votes
4answers
42 views

MySQL: Delete all rows older than 30 days, but only if count more than one

I need to cleanup my table of over 14.000.000 rows inside. I want to delete all entries, that are older than 30 days, but only if number of grouped items is larger than one. So, at least one item will ...
1
vote
1answer
32 views

weekly moving average from current_date to the last 52 weeks

I'm a new head to the mysql programming. I have to write a procedure for calculating a weekly moving average grouped by week from 'monday-friday'. Criteria is : current_date is the end date. start ...
0
votes
1answer
34 views

(mysql) Database replication between 2 DB while 3rd DB as backup

I am not an advanced DB admin or designer. I am sure there are articles on this kind of scenario, probably too many. So I got confused and not sure which solution is appropriate/best for me. I am ...
1
vote
1answer
44 views

Setup MySQL Master to Master replication/automatic failover when each Master also has a Slave

Thanks in advance. I have always worked with SQL Server and never really had any exposure to MySQL. I now have to determine the preferred setup for MySQL when there are four servers involved. ...
0
votes
2answers
23 views

MySQL create index with LOCK=NONE still locks a table

I have the following MySQL RoR Migrations: class ReindexRpushNotification < ActiveRecord::Migration def up execute("DROP INDEX `index_rpush_notifications_multi` ON rpush_notifications;") ...
1
vote
1answer
25 views

Get previous and next row from result set help

I have to get "relevant" results from a table by joining it on another table and filtering the results on parent id and current id, this all goes fine until your current id is either the first or the ...
1
vote
2answers
46 views

Should MySQL database be in dedicated server?

The application has about 10 databases. Both application and databases are in the same server since is client does not want any time delay that could possibly occur if the database is in a dedicated ...
0
votes
1answer
12 views

MySQL Proxy on Current User

I'm trying to grant permissions to the current user logged in depending on their role, but it doesn't seem possible to have a select statement at the end of the GRANT PROXY # TO # command The code I ...
-1
votes
1answer
23 views

systems hangs after specific time

I am having 2 applications (Java and PHP). Both are sharing same DB Server. After specific time, both systems stops working due to "Too many connections". I tried so many settings (increased ...
0
votes
1answer
46 views

mysql crashed, innodb fails to recover

On Mysql 5.0 on CentOS 5.11, mysqld service has crashed and fails to start. Adding innodb_force_recovery=3 in /etc/my.cnf, creates the following error, which repeats with all table names of database ...
2
votes
2answers
51 views

Migrate SQL Server backup to MySQL for a Wordpress site

I have a client with an old .Net site that used SQL Server. For lots of reasons they decided to switch to Wordpress. They had a bunch of news articles on that old site that they want turned into posts ...
0
votes
0answers
33 views

MySQL: Calculations and Triggers across multiple tables

I'm new to sql and I'm having trouble with a calculation involving two of my tables. I have a table, payroll, which looks something like this: CREATE TABLE payroll ( id INT(6) UNSIGNED AUTO_INCREMENT ...
0
votes
0answers
29 views

Mysql checksum for data only

I have some groups of two tables, each group table having the same structure. (dev & prod server) Their data will never change from user action, only from admin when a change occurs. I want to ...
0
votes
1answer
31 views

Writing a query to COUNT all the services involving a particular

Learning PHP and SQL on an online MOOC, this is a homework that I've got to do. I need to write a query in SQL to count all the services which involve a particular person in my database. The ...
3
votes
2answers
507 views

Which one is an ER diagram?

I have started to study ER diagrams. When I browse through the ER diagram tutorials, I found something like figure 1: Figure 1 I tried to create a sample ER Diagram in MySQL Workbench like: ...
0
votes
1answer
29 views

Storing revisions and relations between revised items in 1:N and N:N scenarios for audits

I have the several of the following situations in a MySQL schema that I design for a custom CRM/ERP solution. 1:N related tables SO and SO_ITEMS (SO is just one example I have several) that both ...
0
votes
0answers
51 views

Mysql failed to start, InnoDB Error: page log sequence number is in the future

I had issue in starting mysql after machine crash. Looking in mysqld.log, I found below errors: 160511 09:50:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 160511 9:50:40 ...
1
vote
1answer
41 views

varchar datatype accepting integer values

below is the test table created. As data type is set to varchar it shouldn’t accept int values. desc c\G *************************** 1. row *************************** Field: t Type: int(6) ...
1
vote
2answers
39 views

Insert and select the row autoincremented id

What I want to do is insert a row and than select its auto incremented id number, In a multhi-threaded enviroment. I know how to do it with a Stored Procedure. Will this line of code work: BEGIN ...
0
votes
1answer
28 views

How to use FULLTEXT in mysql innoDB?

Sorry, if my question is naive, but it has puzzled me, and cannot benchmark the performance. I want to use the newly introduced feature of innoDB for FULLTEXT index. I wonder what is the difference ...
0
votes
0answers
20 views

Loading Data from url

I am trying to create a plan for data load and wanted to bounce off best practice ideas and learn about amazon RDS. I have multiple url sources of data and a RDS MYSQL instance to store them. I want ...
0
votes
1answer
52 views

InnoDB files created even innodb_file_per_table is OFF in mysql-5.7

We have installed mysql 5.7 in ubuntu 16.04 and we got big surprise because databases are being stored individually in each folder even parameter innodb_file_per_table is 0. We decided to change ...
1
vote
2answers
23 views

MySQL stored procedure returns null

I wrote a simple procedure to modify the whole column to a set of meaningless values. However, when I tried call NewProc('tableName','colName') it returned 1064 - You have an error in your SQL ...
0
votes
1answer
35 views

table is — is full mysql

MySQL 5.7 on windows'12 server, table which I am getting error crossed 2 GB in size, server memory is 4 Gb, MySQL used about 90% of memory.. Now any insertion into this table causing table full Once ...
0
votes
0answers
35 views

Unable to change innodb_log_file_size in MariaDB Galera Cluster 10.0

I have a MariaDB Galera cluster (v. 10.0.19) with 3 nodes. I want to increase the innodb_log_file_size (i.e. the size of the InnoDB redo log files) on one of the nodes to match what it is on the other ...
0
votes
2answers
22 views

check when last password changed in my user db/table

i have radius billing system with mysql as DB. I want to know which user 'password' was changed in last 5 minutes So that I can fetch such user mobile number from the DB and send SMS Alert about the ...
0
votes
0answers
23 views

mysql duplicate key error during restoration through mysqldump data

I have a mysql database which is having one table for geo location and saves latitude and longitude values of users. The fields are as followed CREATE TABLE `USER_LOCATION` ( `LATITUDE` float NOT ...
1
vote
1answer
28 views

MySql LIMIT + JOIN is stopping data from being returned?

I originally posted this question on stackoverflow, but then remembered there's a stackexchange specifically for databases! I've got two tables and am trying to return all profiles that are assigned ...