MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
2answers
76 views

FLUSH TABLE : can't execute the given command because you have active locked tables mysql

If i execute these queries one by one , all get fail except first : Query1 : flush table tablename1 with read lock; Works Query2 : flush table tablename2 with read lock; Error : can't ...
0
votes
0answers
38 views

Does MySQL InnoDB compression combined with Windows compression save more space?

We have a very large MySQL InnoDB database, compressed using the following syntax at the end of the table declaration: ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 We also have windows ...
2
votes
2answers
50 views

optimize table in stored produce using phpMyAdmin causes out of sync error

I get the following error when running the code in phpMyAdmin. NOTE: I can run any other sql code (update, insert, replace) via phpMyAdmin in a stored procedure; but an optimize causes issues. NOTE: ...
1
vote
2answers
42 views

Execute code ONLY if we have the ability to do full text search on database (mysql >= 5.6.4)

I found this answer for how to have conditional logic for execution of mysql statements (http://stackoverflow.com/a/7537348/627473). Seems to work great. But I need to find a way to execute code for ...
3
votes
1answer
23 views

How to drop user@% on the MySQL CLI?

How to drop 'user'@'%' on the MySQL CLI using the mysql -e command? mysql -uroot -p -e "'myuser'@'%'"; This does not work.
2
votes
1answer
29 views

Remote MySQL host - is connecting to remote port 3306 vulnerable?

Hello experienced colleagues, I have a web application built on a MySQL database. I need to run another copy in a remote location, and refresh the data weekly. The size of the refresh is about 500k ...
6
votes
2answers
266 views

Trouble with a NOT IN query

SELECT DISTINCT d.customer_id, d.date_added FROM `order` d WHERE d.customer_id NOT IN ( SELECT DISTINCT i.customer_id FROM `order` i WHERE i.date_added > '2015-02-15 14:00:00' ) ORDER ...
4
votes
1answer
28 views

Does MySQL/InnoDB use table caches when dealing with foreign tables?

TL;DR: Does a table referred to via schema.table get held in table cache? I have a large number of client databases that our application connects to based on an http request. These are used for every ...
2
votes
1answer
64 views

How can filesystem storage (for blobs, images, etc.) be integrated with (traditional) database storage (e.g. MySQL/Postgres)?

If I use my database for relational data and opt to store large binary blobs in the filesystem, how can I integrate the two? How does this process work? I know that the database will need to store a ...
0
votes
1answer
71 views

MySQL Circular Replication

I have this scenario where I have 4 MySQL servers (A,B,C,D), as this: Server (A) is always online, and serves as the main website. Servers (B,C and D) are online on random periods of the day, and ...
1
vote
0answers
60 views

MySQL Master-Master Crash-Safe Replication: Slow UPDATE times

Environment 2 MySQL version 5.6.26 Dedicated MySQL Servers connected on a LAN. Servers Have 16 Cores with 32 GB RAM each and are really fast. Master-Master Crash Safe Replication is setup on both ...
2
votes
0answers
8 views

Update a column based on other values in the row [migrated]

Consider the following trials table: CREATE TABLE trials ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name_A VARCHAR(6), name_B VARCHAR(6), score_A INT, score_B INT); Abstractly, this represents a ...
2
votes
1answer
50 views

How to insert values in junction table for many to many relationships (MySQL)?

I'm new to relational database design and I've hit a stumbling block. I have three tables... PROJECTS project_id, name, ... PROJECTS_UNDERGROUND projects_FK, underground_FK (I have both FKs setup ...
2
votes
1answer
35 views

Database server down: file /dev/vda1 used up all diskspace

My database server went down last night because there was no diskspace available. I checked what used up diskspace and it was 28GB by /dev/vda1 I have no clue what this is. The database all together ...
3
votes
3answers
93 views

What architecture is best to store a large 3 dimensional array in MySQL?

I am looking to create a large 3 dimensional database in MySQL. The structure will basically be a standard MySQL table, with a time component / dimension added. See the following analogy: { x, y, ...
5
votes
1answer
49 views

Getting column information from the MySQL command line

I am trying to get all the columns from MySQL using bash scripting. I want them to be stored in an array. If I write it this way: mysql -uroot -pPassword1 "select column_name from ...
3
votes
0answers
77 views

query optimization of a left join

I have the following query written into the slow log (mysql-slow.log). I don't have much idea how to optimize this query. I already have indexes for: mode, f.user_id... etc but doesn't seem to ...
2
votes
2answers
65 views

MySQL: memory requirements for django app with 1 big table (460M rows)

I have created a django app that is running on virtual machine. All db tables are rather small (up to 1M rows) but recently I was asked to add a big table (460M rows). CREATE TABLE `genescorrelation` ...
3
votes
3answers
49 views

Problems updating with inner join with multiple on statements

I have an orders table on a database that contains geographical information about the city and state that the order is from. This includes latitude and longitude for doing haversine calculations. I ...
3
votes
1answer
39 views

Which databases are backed up by “mysqldump --all-databases”?

Which databases are included in the dump generated by mysqldump --all-databases? By my experience, that should be all the user-created databases, plus the mysql database. The database ...
1
vote
1answer
22 views

mysql - select random rows with max 3 rows per parent id

I currently have a query that returns a maximum of 3 rows per parent_id. I want to enhance the query to return a maximum of 3 random rows per parent_id. This does not work for me at the moment as it ...
6
votes
3answers
43 views

Can't get access to other database

I am working on a project for my university. They gave me a login username and password for MySQL database they've setup on the server. With that username and password, I'm able to login to the ...
1
vote
2answers
65 views

MySQL LOAD DATA INFILE Error Code 1366. Incorrect integer value: ' '

I've been trying to upload a CSV table into my remote server database but I find an error. I use MySQL in a RedHat Linux distrib. My mycsv.csv file looks like this: ...
3
votes
3answers
56 views

MySQL adds broken comment script after each line

Every time I try to create a table using MySQL Workbench 6.3 CE it adds "broken" comments at the end of the script. Example: I am trying to create a table called "user". This is what the table ...
0
votes
2answers
32 views

Consistent mysqldump of mixed InnoDB and MyISAM tables from RDS instance

I have MySQL db on dedicated server. I would like it to be an external master for an RDS instance. And I want to make backups of RDS. (Currently we have mix of both InnoDB and MyISAM but we are slowly ...
1
vote
0answers
26 views

MySQL Server Instance Configuration Wizard does not start for the first time

I tried to install MySQL on my machine (win 8 64 bit). I downloaded mysql-5.6.24-winx64.exe and after completing the MySQL 5.6 setup wizard, MySQL Server Instance Configuration Wizard does not start ...
1
vote
1answer
37 views

Unable to load mysql dump file

I recently had to deal with migrating some servers over (rather was forced to by the hosting company) and we took too long to migrate our data so they did it for us. Unfortunately they just copied ...
0
votes
0answers
8 views

schema file that works for INNODB full text support on or off

I have users that will have mysql versions that DO support full text and do NOT support full text search for INNODB. Is there a way to do the following: Have sql statements for adding full text ...
2
votes
0answers
16 views

selecting data from joomla back end mysql

I have developed a front-end that call a php server side service that adresses the mysql. On my local everything works perfectly, but on distant 1and1 machine, it only works for tables created by ...
2
votes
1answer
37 views

Mariadb galera cluster nodes won't stay joined

I have a fresh install on Mariadb 10.0.20 on three servers. I'm using the same my.cnf from another running cluster, just changed the cluster name and the IPs. I bootstrap the first node, and I get a ...
5
votes
2answers
76 views

How can I display a mysql bit(64) column as a string of ones and zeros?

We have a MySQL 5.5 database with a table that holds a number of 64-bit values which are used for calculating the hamming distance. The columns for these are defined as BIT(64) and are populated ...
1
vote
1answer
29 views

Things to keep in mind while editing Mysql “my.cnf” file

Today I tried to boost mysql's(installed in my system Ubuntu 14.04) performance as I have many sites(PHP/Magento) installed in my system which relies on mysql as database server, but when I edited the ...
5
votes
4answers
324 views

How to exclude NULL values inside CONCAT MySQL?

If I have this - tadd is the Address table: CONCAT(tadd.street_number, ' ', tadd.street_name,', ', tadd.apt_number,', ', tadd.city,', ', ...
0
votes
1answer
45 views

Locking because of triggers mysql

I have a memory table and I am updating it somewhere around 3000 updates per second. I setup a another table in Innodb and then created a Trigger so that all data can be send to the innodb table as a ...
1
vote
0answers
27 views

mysqld stops right after starting because of corrupted tables (disk full + hardware reboot) - how to fix it?

I'm dumb, I did the stupidest thing I could. On one of my servers, the SSD was full and I wasn't aware of it. The high-traffic website became working really slow, then started displaying errors, ...
1
vote
3answers
65 views

Convert MyISAM to InnoDB

What are the considerations needed when converting myisam to innodb. I have a table around 80 GB with engine myisam. I would like to convert into innodb. What are the considerations needed to ...
3
votes
3answers
144 views

Finding contiguous ranges in grouped data

I have a table with the following structure: CREATE TABLE `Rings` ( ID_RingType CHAR(2), Number MEDIUMINT UNSIGNED, ID_User INT(11) ); and with data: INSERT INTO `Rings` VALUES ...
1
vote
0answers
30 views

Update row value with a sub-select join

I am trying to update 1 column in all rows in a table to have an appropriate count value. Sadly, the SELECT query I am using won't let me join on a field in update table. The query looks like this ...
3
votes
1answer
36 views

How to monitor mysql percentage disk utilization?

I am new to mysql world and not sure if there is a way to calculate mysql TableSpace/DiskSpace utilization in percentage. I am aware mysql does not provide upper limit or free space like Oracle DB, ...
0
votes
0answers
25 views

MYSQL Memory table on updates

I have recently converted one of our tables to Memory table and have setup heap size to 30GB. This tables only gets updates and not inserts, so I was wondering if the table rows are updated frequently ...
2
votes
0answers
55 views

Finding the most recent event older than 60 days [closed]

I would like to filter rows in a table for the most recent event for particular individuals that did not occur within the last 60 days: Select pid, Max(date) as date FROM table WHERE date ...
3
votes
1answer
51 views

Oracle sequences to MySQL

Migrating from Oracle to MySQL we've found some many incompatibility issues. We've some workarounds for many of them, however we still have one: The Sequences We have this table CREATE TABLE ...
4
votes
2answers
99 views

Count rows with inner joined tables

I have 3 tables: Players: mysql> SELECT * FROM players; ...
1
vote
1answer
37 views

Read insert statements from text file

Good day All, I have a 1000 text files that each contain 1000 insert into statements. What is the most efficient way to read and execute each insert statement into a MySQL DB table? Thanks for any ...
2
votes
1answer
40 views

Split brain scenario - RAC and PXC

Even though split brain scenario occurs in both Oracle RAC and Percona's XtraDB Cluster, a two node cluster is allowed and split brain scenario is resolved in RAC but a two node is not recommended in ...
2
votes
1answer
26 views

SQLyog and MariaDB engine

I am quite new in MariaDB and I use SQLyog Community Edition as the frontend GUI. Whenever I create a new table, on the Engine dropdown, there is no XtraDB option. Is there any additional steps I am ...
3
votes
3answers
58 views

MySQL - Unable to Convert Primary Key to Auto Increment

I have a MySQL table where the Primary Key (int) was set by the software to be equal to the Primary Key (auto incremented) of the main table. Because of a change in design I now need the field to auto ...
2
votes
0answers
50 views

How can I organize complex queries?

I am analysing a relatively large (25GB compressed MySQL dump) static data set. Some of the queries I'm writing are several tens of lines long, which makes them difficult to understand, modify, and ...
2
votes
1answer
43 views

How to add DATETIME value for session user

I am maintaining two tables: Employee table consists of username and password(for logging in) log table consists of login and logout time for the session user With the click of a button, I should ...
2
votes
2answers
110 views

INSERT… ON DUPLICATE KEY UPDATE not working as I expect

I have a table called "Example" CREATE TABLE IF NOT EXISTS `example` ( `id` int(11) NOT NULL AUTO_INCREMENT, `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY ...