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
3 views

What is the difference between XtraDB and TokuDB? And why are there no comparisons?

I'm just getting into DB and doing some search on different MySQL tables. My current company's tables are all old and in MyIsam form. At first, I was going to simply convert to InnoDB, then noticed ...
0
votes
0answers
11 views

MySQL - Database Design : Encrypting user id and creating a mask for further internal references

For a food order delivery system that I am working on, I want to make sure my user's private information is well protected; from system admins too. So I thought of coming up with this concept of ...
0
votes
0answers
12 views

Speed up SUM() on a result with JOINS in MySQL

I have a query with a combination of 6 left joins and inner joins. The query gives a result of 25000 records in 112ms. When I do a SUM() the query takes 4s. A SUM() another table with 35000 records ...
0
votes
0answers
7 views

Mysql How do I insert multiple table with duplicate key checking?

I hope to this work. When UserAccount table duplicated, Out Parameter put -1. When UserInfo table duplicated, Out Parameter put -2. When all work is succeed, Out Parameter put LAST_INSERT_ID. ...
1
vote
0answers
5 views

Add index to mysql table with ndbcluster engine

I'm having trouble while adding index on mysql table with ndbcluster storage engine below is the error . [mysqlcluster ver. 7.4 GA] mysql> alter table `sks_staff_office` add index `pid_index` ...
1
vote
1answer
10 views

Optimize MySQL Query with multiple subqueries

I have the following Query: SELECT p.id AS post_id, p.status, p.user_id AS post_user_id, (SELECT pl.id FROM postlocks AS pl WHERE pl.post_id = p.id) AS postlock_id, (SELECT COUNT(rn.id) FROM ...
-1
votes
1answer
17 views

How to perform multiple checks on same column of same table in Mysql?

Table Structure : +-------+--------+-------------+------------------+---------------+----------------+ | recid | cartid | attributeid | attributevalueid | attributename | attributevalue | ...
0
votes
0answers
18 views

Query that runs lighting fast in Postgres send MySQL to 100% CPU and takes forever [on hold]

I have a query that runs against a database that an industry association puts out every month. The query is complex in that it joins together 26 tables and brings back only 15 rows from among tens of ...
-1
votes
0answers
14 views

Backup whole database including procedures

I'm using MariaDB 10.1. I backup my database using mysqldump. My stored procedure, view, function and event definitions are not backed up. How to backup full database including tables, functions, ...
0
votes
0answers
10 views

Connect to MySQL Webserver (not localhost)

I have a problem. And I hope someone can help me or point me in the right direction. I am working on a project and need to sync a MySQL database (running on PHPmyAdmin) with a MS SQL Server. I ...
0
votes
0answers
12 views

Copy data from one table into other on some condition

I have two table as follows. Table : city city_id city_name state_id 1 Cachar 1 2 Darrang 1 3 Nicobar 1 Table 2 : locality pincode Address ...
0
votes
0answers
7 views

Recursive Conditional trigger for insert in table MYSQL

user[ user_id, parent_user_id] user_id parent_user_id 1 null 2 1 3 1 4 1 5 1 user_assigned_role [user_assigned_role_id, role_id, ...
-5
votes
1answer
36 views

Could someone explain how PHP, MySQL, SQL work together?

I feel so confused on what they are and how they work. From what I've read PHP is a server-side language. Therefore, it's a language basically designed to talk with the web server to get it to do ...
-1
votes
0answers
15 views

Update column with different value for multiple rows [on hold]

I often find myself using excel to create update queries. When I need to update multiple rows with different values for a column, I simply use excel to create the update queries (multiple). Here's ...
0
votes
1answer
15 views

PostgreSQL vs MariaDb On Read/Write when table has about 200M Rows [on hold]

I want to build a new web application with my collected data, but I don't know witch DBMS is best choose for my Project, MariaDB or PostgreSQL there is 2 table : categories and data more than 200 ...
0
votes
0answers
10 views

Transaction on delete is committed, but for a brief time the entries can still be read?

I have a Java application that uses Spring JDBC and HikariCP for pooling MySQL connections. There is a high level of concurrency where a thread creates a unique entry for a given task in a single ...
1
vote
1answer
16 views

MySQL trigger to update a key if record exists

I'm trying to build a trigger in MariaDB to follow this logic: 1. If the primary key val exists, increment the counter column 2. Else, insert the primary key into the table Here is my prosed ...
0
votes
0answers
10 views

MySQL: database setup to properly deliver non-ascii characters

I'm facing the following problem: I have a MySQL database which contains non-ascii characters in some records. Characters like "ñ", for example. What kind of setup do I need to perform at the ...
1
vote
0answers
29 views

Converting a composite primary key to composite unique, and adding an auto-incremented PK column

Background I have taken over responsibility for a table that, in the long run, will grow monolithic. The table is a very simple link table with 2 columns, call them col1 and col2, both being foreign ...
0
votes
0answers
7 views

Linked Server Mysql Workbench

Is it possible to use 2 MySql Workbench at a time by connecting it using Linked Server? Or is there any other alternative? By the way, I'm working on a web application with jsp and java.
1
vote
1answer
15 views

MySQL 5.6 Online DDL lead to to much table-metadata-locks when I just add index

It's normal that table-metadata-lock shows up for a short time when ALTER TABLE t add index ... starts and ends. But I have encountered all DML operations blocked in Waiting for table metadata lock, ...
1
vote
1answer
15 views

How did you setup MySQL Replication with autofailover that is app transparent?

Recently told MySQL is shelving MySQL Fabric. Interested how others have implemented a MySQL replicated environment that is app transparent. I am considering using HA Proxy to host virtual IP ...
1
vote
1answer
23 views

MySQL data types for common columns

I have been a frontend programmer for a while and moving to making some applications on my own and becoming a full stack engineer. I have worked with plenty of databases for applications and sites but ...
0
votes
1answer
20 views

Mysql scaling up vs scaling out

I have an application where each client gets their own database. This is for security, backup ease, and portability. It provides great flexibility and performance has been fine. I am up to 300+ ...
-1
votes
1answer
21 views

Select MySQL with 2 tables conditions, Is this right?

Tables: agencia (nome_agencia, cidade_agencia, fundos) cliente (nome_cliente, rua_cliente, cidade_cliente) conta (nome_agencia, numero_conta, saldo) emprestimo (nome_agencia, numero_emprestimo, ...
0
votes
0answers
19 views

MySQL 5.5 to 5.7 doesn't work, apparently this is a feature?

Has anyone found a way yet of circumventing MySQL 5.7s insistence that it's Master must have a server_UUID. I currently have multiple instances of MySQL 5.5 over various sites, and want to look at ...
0
votes
1answer
38 views

MySql timeouts waiting for table lock, no apparent deadlocks

I started having the following error on two different applications that write to the same database and table: Lock wait timeout exceeded; try restarting transaction At the beginning I thought it ...
0
votes
0answers
26 views

Managing large database tables, large tables VS seperate databases

In my project I have a system where users sign up and perform daily tasks. Note that I am not a database expert, none the less I am trying to solve a potential issue that may arise. A problem has a ...
1
vote
1answer
13 views

mysql replication and GRANT that doesn't quite grant

I am trying to set up mysql replication. All's well, but I see an error 1045 for the slave: mysql> show slave status\G *************************** 1. row *************************** ...
1
vote
1answer
13 views

Is there a way to set bind_address from command line in mysql 5.5 without restarting?

I made a modification to bind_address in my.cnf that knocked down a monitor. It has been repaired since, firewall allowing the monitor IP in. However, mysql is still running in its previous state ...
0
votes
2answers
48 views

Improving query performance on mysql star catalog

I have a mysql database that contains a table with roughly 645 million records. I am trying to improve the query performance. Below is the SQL for the table as well as the indexes I use. CREATE TABLE ...
1
vote
1answer
13 views

MySQL: with CREATE_USER_PRIV, GETTING “Access denied” when attempting to change another user's password

In MySQL 5.6.27, user 'bmcrae' has create user privileges and is able to create a new user. However, when trying to change another user's password: SQL: SET PASSWORD FOR 'newuser' = ...
0
votes
0answers
29 views

How can I detect if a function is built in to MySQL/MariaDB?

Is there a way I can detect if a function is built in, in MySQL/MariaDB? I'd rather use feature detection than version string matching in my application. I know about the responses here for user ...
1
vote
1answer
101 views

Select the maximum aggregate value for a limited set of chunked/grouped rows in a large database?

I work on WordPress plugin which implements sitemap functionality. One of the steps is to build an index of sitemap pages for post entries. The logic required is roughly: determine last modified time ...
0
votes
1answer
24 views

MySQL binary log - write operation

Consider a scenario, where you have a MySQL master and slave server in replication. As we know, binary log enabled on the master and the slave reads from the binary log of the master. From MySQL ...
0
votes
1answer
15 views

Chained MySQL replication from Master->Master replicated pair

This is a pictorial view of what I have: Master 1<----->Master 2 | | | | V V Slave 1 Slave 2 The masters are never written ...
0
votes
0answers
11 views

What is the best practice of storing mysql connection details to use in ruby/python scripts

I have ruby and python scripts that connect to mysql DBs. They are controlled in github and can populate to different servers. They run in a schedule way (not adhoc). What is the best practice of ...
0
votes
0answers
25 views

Should I use mysql stored procedure or regular inline statement?

So here is the problem: I have been currently working on a project that would be handling millions of data and thousands of records would be inserted as well as retrieved at the same time. Before ...
1
vote
0answers
27 views

phpMyAdmin export SQL not working with Linux VPS import [on hold]

I am a newb, just gonna put that out there. I am currently on a shared hosting plan with Godaddy. I have started a free trial with DigitalOcean to see how I would fare with a Linux VPS using putty. I ...
0
votes
3answers
76 views

MIN / MAX values with Date

I am trying to get the MAX and MIN values for the current month and the dates for these values. I am getting the MAX and MIN values but I am not getting the dates for these values. Instead I get the ...
-1
votes
0answers
37 views

What are the general practices considered to constitute a good user id? [on hold]

I could not settle on a good pattern to generate my user ids for an upcoming project that could scale up in a few months. The project is about ordering food online and I need to store user ids and ...
0
votes
2answers
46 views

Combine WHERE NOT EXISTS with ON DUPLICATE KEY UPDATE

I have 2 tables params and params_exceptions where params is supposed to be updated frequently by an external script. INSERT INTO params (extension, type, subtype, paramvalue) VALUES ('12345', ...
1
vote
1answer
28 views

What happens to mysql information_schema after switching to innodb_file_per_table?

We're switching our mysql dev deb instance to innodb_file_per_table and moving the data dir onto another mounted drive so we can free up space on our dev box. We've backed all our dbs up and about to ...
1
vote
1answer
24 views

MySQL error 1593 on replication between 5.5 on WIndows and 5.6 on CentOS 7

I'm setting up replication between the live server (running Windows 2008 R2 and MySQL 5.5.19) and a dedicated replication server (running CentOS 7 and MySQL 5.6.30). The CentOS box does have MySQL not ...
0
votes
0answers
15 views

MySQL Innobackupex and Triggers, Events, Routines, Partitions

I am using Innobackupex (from Percona Xtrabackup) to take a physical backup of my InnoDB and MyISAM tables. I'm also backing up the system MySQL table, but skipping Information_Schema. Information ...
1
vote
0answers
21 views

UTF8 Trouble while migrating from MSSQL to MySQL with MySQL Workbench

I am tasked with migrating part of our database from an on-site MSSQL server to an Amazon RDS MySQL. This will be my first attempt with a database migration, so I am doing a dry run from our MSSQL ...
0
votes
0answers
18 views

MySQL failed connection attempts hitting max_connections

I run a couple of websites but I believe one of them is causing too many Connections Failed Attempts that causes max_connections variable to hit. Currently, max_connections=2500 (already large) but ...
1
vote
1answer
43 views
+200

Replicating into a Percona XtraDB Cluster

We have a 2 node (plus an arbiter) Percona XtraDB cluster. It is used for data indexing/archiving. It has it's own database called archive but it is also the replication slave for a database called ...
0
votes
0answers
21 views

Searching a text with space in mySql match against Query

I want to search a text in mysql DB with [space] (Ascii 32) as a part of it. But I am not getting the correct result. My MySql Query is: SELECT count(id) as total , MIN(product_price) as ...
0
votes
0answers
38 views

How can I import a database from MySQL version 5.0.92 to Maria DB 5.5.47 [on hold]

I am using phpMyAdmin to export my database. Everything works on one server but on my other server it will not allow me to correctly import this data. It throws over 15,000 errors, which is pretty ...