MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
1answer
32 views

Query to flatten schema

I have the following tables and columns: Users id | other-non-important-columns Containers id | Users_id | other-non-important-columns Content id | Container_id | other-non-important-columns ...
1
vote
2answers
28 views

Optimal engine for small lookup tables in MySQL

I have following question: I am designing web application with several dozens of small lookup tables: These tables usualy contain three columns (ID, Name, Description) and a couple of rows (mostly ...
0
votes
0answers
16 views

Need some help building a query to get info from several tables

I have this semi-complex table structure: And I need to return this data: { "id": "10111001", "rep_id": "30000001", "targets_id": "60011001", "brands_id": "10010001", "brand_name": ...
1
vote
1answer
20 views

How to get row count from all tables of a schema ( without using information schema )

The query should collect data from table name , schema name from information.schema and row count should be taken from actual table.
2
votes
1answer
15 views

How MySQL Queries and Questions status variables are calculated?

I have a mysql server running on 5.6.19 version and I got confused with the status variables Queries and Questions. show global status like 'Queries%'; | Queries | 28058738 | ...
0
votes
0answers
15 views

MySQL Pivot table

I have a MySQL table with following columns ZipCode PartNo Price DateCaptured Example data rows 50070 |P1234 |57.90 |2015-05-05 05:05:05 50070 |P1235 |58.90 |2015-05-05 05:05:05 ...
0
votes
0answers
22 views

Mysql trigger on insert on another table

I have three tables all three have [product_id] column, what all i want to do is when there is new entry of quantity of respective [product_id] in table A and table B i want show the sum of the ...
0
votes
0answers
7 views

Removing per column and table collation and charset

I recently completed a transition of a database from CHARSET=utf8 COLLATE=latin1 to CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci. During the process tables were migrated one at a time by altering their ...
0
votes
1answer
19 views

How to insert UNIQUE IDs values from several tables into events table

I have a table called events defined as follow: rep_id, hcp_id, brand_id, email_id and content_id is the IDs in other tables. event_type should be kind of array containing this values: [ ...
0
votes
2answers
29 views

insert into select with union needs derived table

Why do I need to do another select when I am trying to insert distinct values into a table? Also: is there a better way to do this? WORKS: INSERT INTO phppos_categories (name) SELECT category FROM ...
0
votes
1answer
15 views

Function for generate a huge and possible random relationship between tables

I have this two tables and N:M relationship between them: Let's said I am managed to create a lot of media and emails records but I need to create the relationship between them. I can do this ...
0
votes
0answers
40 views

Slow “CREATE TABLE” and “TRUNCATE” on MySQL / MariaDB

I am fighting with performance issues on a local MariaDB instance. Fun thing: I previously had problems with all my INSERT and UPDATE and DELETE queries. This got signigicantly faster (~40ms -> less ...
0
votes
1answer
23 views

how to store mp3 files in mysql database by using phpmyadmin?

first of all i am new to database, but i want a database for my site to store mp3 files in it so later i play them on my site by using jplayer. little though i know about database they said there are ...
-2
votes
0answers
8 views

PMA-SQL-ERROR while importing databse in xampp [on hold]

While importing database in xampp i am receiving following errors SQL query: <!-- PMA-SQL-ERROR --> <div class="error"><h1>Error</h1> <p><strong>SQL ...
1
vote
2answers
26 views

MySQL High Severity Error [on hold]

I am completely new to MySQL. I am not a programmer or anything. I was installing the program months ago, and forgot my root password, tried to fix things and it failed. I did a system restore and ...
0
votes
0answers
17 views

insert/update query running slow to specifi tables

I am monitoring MySQL client connections and queries run time. Found some insert/update queries to specific tables are slow than expected. I know the tables which are slow are big in size > 600K, i ...
0
votes
0answers
13 views

Searching & deleting content that starts & ends the same, but has random text in between

So my Wordpress sites been hacked & spuriously created a load of content in the posts which starts with & ends with . The only trouble is that the bit in between is random hyperlinks. Any ...
0
votes
1answer
26 views

What is wrong with the following Python code — trying to insert into a database?

This works in MySQL Workbench: insert into nametest (name,surname) values('John''Krailling'); I am trying a get similar result with Pycharm with the following code: import MySQLdb db = ...
1
vote
1answer
23 views

MySQL 5.6 Slaves Fail to Reconnect to older MySQL server when it goes down for backups

I have an existing replication setup with Masters and Slaves running MySQL 5.0. A long existing script runs at night which restarts MySQL on the master with skip-networking, runs a backup, and then ...
0
votes
0answers
14 views

Confused over table_open_cache

I've been reading about the table_open_cache and I'm slightly confused about how big it should be, I've seen conflicting advice. My DB is running on MyISAM and has 199 tables. I ran into an issue ...
0
votes
0answers
22 views

Mysql - too many Deletion - Insertion

I'm creating crons for my OLAP sysetm, I have a cron that deletes the records from the summery table first and then insert the records in it again, Say Deleting 1 month records, and ...
0
votes
0answers
29 views

Get the rank of a row based on a score I am generating from other field values

I am trying to figure out how I can get the rank of a row from a score I am generating from other field values. The score query looks something like this SELECT ((table2.field1*0.4) + ...
0
votes
0answers
28 views

Deadlocks due to foreign keys (MySQL)

We are in the process of creating a web application using mysql as a data source. We are using spring with hibernate as an ORM framework. We have hundreds of entities with relations (manyToMany \ ...
0
votes
1answer
23 views

querying a table to find minimum of average population across all cities [on hold]

Consider the table (City) structure given below I need to query on this table: Query : the minimum of average population across all cities | Field | Type | +-------------+------+ | ID ...
0
votes
0answers
31 views

how to increase speed of this mysql query?

How I can increase speed of this search query? This search bring news based on time and title and text. each item has own factor. SELECT * , MATCH (`title`) AGAINST ('tax in work') * 1.65 AS ...
0
votes
1answer
16 views

MySQL default user

I have mysql.user table with this content: select host, user, password from user; | localhost | root | *75267AEB7355CEEE80EAB92D19FF50095AD9BB3E | | linux | root | ...
1
vote
1answer
47 views

Keeping an updated balance (Accounting)

I have been struggling trying to find a way to properly and reliably maintain a balance for accounts in an order/payment system. Currently, the process consists of three tables. Below example is very ...
0
votes
0answers
12 views

How do you create a 'shadow' database in mysql

A while back, a friend told me of a tool that would allow us to "shadow" a production database using a local database. The term shadow may be incorrect (so please correct me if so) What I ...
1
vote
1answer
44 views

Ansible: How to change MySQL server root password by reprovisioning the server

I have provisioned my server with Ansible playbook. I've used the root/bedrock-Ansible playbook. One of the tasks was to set up mysql server together with mysql root user password. Now I urgently ...
0
votes
1answer
17 views

Nested set model: retrieve sub-tree containing nodes that match condition

I'm using the "nested set model" (the backend used by our web application is CakePHP and the Project model uses the TreeBehavior). This is my "project" table: +----+-------+-----------+-----+------+ ...
0
votes
0answers
21 views

Should I use nvarchar after I set all database utf8? [on hold]

I set my whole database UTF8 by this command: ALTER DATABASE databaseName CHARSET utf8 COLLATE utf8_unicode_ci; So, should I use still nvarchar or varchar? varchar seems working for me. Beside ...
0
votes
0answers
19 views

Export MySQL Database with version compatibility

I'm trying to move a MySQL database out of my Win 2012 server & onto a shared hosting web server (Linux). I'm having problems importing the database (which imports fine into other hosted packages ...
0
votes
1answer
14 views

Run MySQL replication by schedule or on demand

I have a master-slave replication currently configured. I know this setup runs real time. Is it possible to sync only the databases on schedule (daily or weekly) or by demand? Thanks!
0
votes
0answers
11 views

how to export mysql database in xammp [on hold]

I was getting error massage to export mysql database in xammp so please give me the address .i tried but can't access the export file in database on phpmyadmin
0
votes
0answers
9 views

Is it possible to import a CSV file into MySQL using VB.Net? [migrated]

I would like to know if it's possible to use LOAD DATA LOCAL INFILE via VB.net to import a CSV given a path to the CSV.
2
votes
1answer
63 views

How to write a query, with multiple foreign key in mysql

I am working on a simple PHP and MySQL college level clinic management system. There 4 main table which relation with foreign key. I'm little bit confusing multiple foreign key in table .. what would ...
1
vote
3answers
15 views

Optimizing MySQL query with left joins

Ok, so first off i am going to provide a bit of information on the database structure I have 3 indexed tables that are used in this query (though one of them should probably be a weak entity, but ...
0
votes
1answer
43 views

Select Multiple Values from Same Column; one sql statment and split into separate columns

This post derives from following - Select Multiple Values from Same Column; one sql statment Based on this query - SELECT user_id,GROUP_CONCAT(meta_value ORDER BY id) FROM t WHERE meta_key ...
1
vote
3answers
45 views

SQL self join with condition

I have table like: bu_id bu_name parent_id 1 DefaultBU NULL 601 bu1 1 602 bu2 601 603 bu3 NULL 604 bu4 603 I want to retrieve the ...
1
vote
1answer
18 views

“Remote” connection to a local MYSQL database on LAN

I have a mySQL (5.5.38) server running on my desktop (windows 7), I can connect just fine into any of the servers Users, and skip-networking is off when checked via show variables. I am trying to give ...
0
votes
1answer
31 views

Migrate Jira to MySql - Unknown system variable 'storage_engine'

I'm migrating JIRA in Windows from HSQL to MySQL and I got stuck with the message Unknown system variable 'storage_engine'. Though I created a backup, installed MySQL and copied J connector to libs ...
0
votes
1answer
51 views

MySQL database is going down once or twice a week, how do I diagnose?

I have a linode.com account running Ubuntu 12.04 LTS. On my server I have two instances of wordpress running with light traffic (100 to 400 users per day each) and an instance of Sendy (which is ...
0
votes
0answers
19 views

How to handle lock timeout error in MySQL?

I am getting below listed error many times in my application log. 2015-05-19 10:27:57,842 ERROR [Timer-3] [org.hibernate.util.JDBCExceptionReporter] Lock wait timeout exceeded; try restarting ...
0
votes
0answers
5 views

How to set the log-error level from [NOTE] to [DEBUG] in Mysql system?

I want to trace the SQL execution in mysql system. so I want to set the log level property of mysqld. like from [NOTE] into [DEBUG].
0
votes
0answers
17 views

have_ssl disabled in MySQL (windows)

I want to enable SSL connection in MySQL. I've tried all the possibilities over the internet. But still I'm unable to figure out what exactly went wrong. Here's what I did so far. I followed ...
0
votes
1answer
36 views

MySQL Pivot Table Dynamic Rows

I have a table like the one below: +-------+-----------+-----------+-----+--------+-------------+ | grade | firstname | lastname | age | gender | student_num | ...
0
votes
0answers
21 views

Business Entity Search by Latitude and Longitude

I want my users to be able to get Restaurants of the current location. The Android App of client passes the latitude and longitude of the current location by calling the Google Place API. I call the ...
-1
votes
0answers
44 views

Count the same value from 2 tables [on hold]

EDIT: http://sqlfiddle.com/#!9/d8893/11 LASTEST I want it to count between 2 tables how many pokemon i truly have but table 1 has the data of all pokemon and table 2 is inserting and confirming that i ...
1
vote
2answers
41 views

How do you minimize downtime for an ALTER?

I've recently inherited a MySQL database that is growing. It's just over a billion records and the performance of one of the tables is abysmal. I would like to change databases eventually, but I do ...
0
votes
0answers
27 views

Converting MySQL master-master replication to master-standby

I set up two mysql servers in a master-master configuration. This was working fine until recently when I encountered a duplicate-key problem. After doing some research and evaluating my needs, I ...