MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
13 views

Problems with foreign keys in a mysql database

I am trying to link both these tables with a foreign key. But I keep getting error message "ERROR 1452: Cannot add or update a child row: a foreign key constraint fails " the foreign key is pwalk_id ...
1
vote
1answer
9 views

Replication of a remote MySQL database to local MySQL database

I'm the developer of my employers corporate private website, a HTML5/PHP/CSS powered site for company reports etc. The site, hosted on a shared hosting package, connects to a remote read-only MySQL DB ...
1
vote
1answer
17 views

Using MySQL Workbench, what is a good way to do development on an alternate server and copy changes to the main server?

This is a noobie question. I'm taking over a database project from someone who recently left the company and I'm looking for advice on how to do some development on a test platform before making ...
0
votes
0answers
17 views

How to select complicated query in my sql

I use mysql under Linux. My table is about 8000000 rows. My database is SQL. The table has index(advertiser_id,activity_date),(activity_date,advertiser_id,activity_type). The table is looks as ...
0
votes
0answers
19 views

MySQL Optimisation

I am running mySQL 5.6.16 on a server running Centos with 20Gb RAM ad 1TB disc space. when running SELECT scripts wiht order and group by statements and a number of joins, the results can be very slow ...
0
votes
1answer
20 views

Intermittent connection errors

I am experiencing occasional connection errors from my webserver to one of my databases. The code attempts to connect. If it fails, it sleeps for 1 second, then retries, then (if it still fails) ...
0
votes
0answers
14 views

How to make changes to MySQL database settings

I'm a real DBA newbie and have learnt everything in the last day, so need basic guidance on how to implement the recommendations from MySQLTuner (which i eventually managed to do!) >> ...
1
vote
1answer
45 views

Different column for different conditions when joining

I am using MySQL database and in that two tables, relation is one to many. One table is product table, sample data: +----+----------+ | id | name | +----+----------+ | 1 | product1 | | 2 | ...
2
votes
1answer
47 views

Inconsistent MySQL query execution times

We run tests on two servers: one in production [Old Server] and the other one in tests [New Server]. Both tests used the same database. [New Server] Dedicated MySQL 5.6.17 server on Ubuntu 14.04 ...
1
vote
1answer
23 views

Determining Homogeneity by Common Foreign Keys

I manage a MySQL database of ten or so tables. In higher code, I have a list of primary keys belonging to entries of some table A. These A entries have foreign keys to entries in another table B. The ...
1
vote
0answers
19 views

Conceptual model vs Logical model vs Physical model

I'm doing a work about database, and now I need to show three different images, one image with the conceptual model, other with logical model and other with physical model of a database. I'm looking ...
1
vote
1answer
23 views

mysql server cannot launch in windows 7

I have been using MySQL as a windows service successfully on my windows 7 machine for perhaps a year. It has always worked fine. Here are the steps which I think caused it to no longer launch: ...
2
votes
1answer
28 views

WHERE attribute having two relation lines in the same SQL

I have a database designed with tree tables: checklist (id, name) tag (id, name) checklist_tag (checklist_id - FK, tag_id - FK) Running this SQL: SELECT cc.id as checklist_id, cc.name as ...
0
votes
1answer
14 views

Problem with MySQL Cluster in practice

I am researching MySQL cluster. For the purpose, I do a demo with 4 virtual machines. I have some problems in practice. Topology My topology contains four nodes Node 1: management node, ip address ...
1
vote
1answer
22 views

In MySQL how do I grant a user access to a read replica only?

I have some users that I want to grant read only access to my database so I setup a replica server, but I don't want to grant them access to the master. I'd assume that this is a common use case, but ...
0
votes
1answer
62 views

Need to get the first 15 rows from 200k rows of data fast [on hold]

I have 3 tables with a lot of data (each one has 100k rows). I used UNION to get data from that. It takes more than 5 seconds as wait time in server to load the first page. I need only 15 rows from ...
0
votes
0answers
17 views

wp db issue, need help selecting table values

Hey I am trying to figure out how to select only those items that have same ID but different values in another column. it's Wordpress database structure. My table sample would look something like ...
0
votes
1answer
20 views

Get the most present elements from many fields

Here is my table: id|item0|item1|item2 --+-----+-----+----- 1 | 10 | 12 | 12 2 | 12 | 68 | 13 3 | 15  | 13 | 10 I just want to get the most present number of all itemX columns. The query ...
0
votes
1answer
25 views

MySQL Syntax Error When Creating a Trigger

I am trying to create a trigger but I am getting a syntax error and I am not really sure why I am. CREATE TRIGGER Section_Insert AFTER INSERT ON Section -> FOR EACH ROW BEGIN -> INSERT ...
1
vote
1answer
34 views

Why does adding a column to a MySQL table take incredibly long?

I am using MySQL version 5.6 and I have a database that is in total around 110 GB in size. One of the tables, "outputs" is 49 GB in size. I tried to add a simple BOOL column to the outputs table with ...
0
votes
0answers
23 views

Should I separate my preferences table?

I have a hobby site where users can find other hobbyists of similar interest. Each user can set a series of preferences that get saved into user_prefs. Right now there are 4 types of preferences, an ...
15
votes
2answers
3k views

Why would SELECT * be magnitudes faster than SELECT foo?

Consider a table of values and hashes, like so: +------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | ...
0
votes
1answer
45 views

Enforcing minimum cardinality in One To many design?

If we have the following One to Many database design. Team +------+-----------+ | t_id | team_name | +------+-----------+ | 100 | germany | +------+-----------+ FootballPlayers ...
0
votes
1answer
15 views

Can I Create a Database and Tables in One SQL Command From PHP?

I tried separating the CREATE DATABASE and CREATE TABLES commands into different mysqli_query statements. The Database gets created but I get an error with: $create_tables = "CREATE TABLE ...
1
vote
1answer
40 views

MySQL CHAR(500)?

I have a table in which one of the fields is always going to be exactly 500 ASCII characters. I'd like it to be saved inline in the database and be as efficient as possible, as it will be a big ...
0
votes
1answer
24 views

How to query group for increase or decrease in value

In MySQl I have a table positions and I would like to find out if position of certain app for certain feed in a certain country type has been increasing/decreasing and by how much from the last ...
0
votes
1answer
30 views

How to safely add column to replicated mysql database

We have 2 databases, one is a replication used for read only, with around a million records, we want to add a new column to the master db, to one of the tables. Do I just go on MySql workbench and ...
0
votes
2answers
51 views

Database Design Help: MySql/PostgreSQL Single Database/Multiple Databases

We are planning to build a web based custom business analytics tool using PHP and MySQL/PostgreSQL. In our application, we are planning to upload customer’s data using a Excel sheet and these data ...
-2
votes
1answer
58 views

Errors writing MySQL Queries

I'm having trouble writing some MySQL queries. I have been having a lot of trouble getting these queries to work. a) For each class that has at least one qualified professor to teach, list the number ...
2
votes
2answers
20 views

credentials file for running mysql related jobs via script?

Is there a method to point mysql to a credentials file instead of entering account passwords directly in scripts? Example: mysqldump --opt --credfile /etc/mysql_creds mydatabase > output.sql ...
1
vote
1answer
36 views

Is my MySQL instance irretrievably dead?

I'm trying to install a JIRA instance on a MySQL 5.1.73 instance running on CentOS 6.5 for our developers. The install gets to the point where I need to create the database, and then FLUSH ...
2
votes
1answer
34 views

InnoDB: “Only one log file found” after binary import

My first one on DBA... After successful upgrading a master MySQL server 5.5 to 5.6.17 (CentOS 6 VPS serer), I done and moved my binary backups to a slave server (same version 5.6.17 but different ...
0
votes
1answer
36 views

how to create invalid utf-8 characters in MySQL

I'm trying to test some application level ruby methods and how they handle invalid utf-8. I'm trying something like to get invalid utf-8: mysql> update items set header=UNHEX('4D2AFF') where ...
1
vote
2answers
52 views

How to stop ROLLBACK in progress?

How do I stop a rollback in progress. I killed a very long running INSERT INTO table1 SELECT * FROM table2 statement. I want to commit what's already there but I can't since it's rolling back. This ...
-1
votes
1answer
28 views

mysql server is not starting

mysql server is not starting after modifying configurations key_buffer = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 query_cache_size = 16M after ...
0
votes
3answers
26 views

Last mysql reboot

Is there a way to check the last restart of mysql server, in global variables or something else ? System : redhat Logging : not activated
-1
votes
4answers
68 views

Index on 'GROUP BY' with functions

I have a log table. It logs visitor data (time of visit, browser, window size ...). I want to create reports. I use a query like this (MySQL): SELECT COUNT(*) as raw_views ... FROM logs WHERE ...
1
vote
1answer
6 views

pt-online-schema-change MySQL Error: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'

I've attempted to alter table using pt-online-schema-change in our master-master replication environment (Percona used as a cluster). It seems, that an operation completed successfully, but inspecting ...
0
votes
0answers
22 views

PHP MySQL: Taking Long time to Insert Record in Table when using Mozilla Browser

Scenario : I am trying to Execute Page which has code to Insert a Record in My SQL Table. Issue : When I am calling this Page from IE/Safari it works well but when I do the same from Mozilla/Chrome ...
0
votes
1answer
20 views

Loading the databases from previous installation mysql

My Windows OS crashed today. Now I have recovered all the files in Program files/MySQL folder.(I don't have the exported .sql file) With the new installation of MySQL 5.6(same as before), can I get ...
2
votes
1answer
17 views

Purge mysql and it's configuration completely from MAC.

I, by mistake messed up with mysql's only user and the situation is I can't create new user or give more privileges to existing one. Access denied is the error. Only visible db is info Schema So I ...
1
vote
0answers
35 views

What could cause waiting for table metadata lock?

I am using a MySQL 5.6 DB with MyISAM tables under FreeBSD 8.3. The main part of code is in PHP, but the problem arises, when I launch the self-written on C++ chat-server. I use the mysql.h for DB ...
0
votes
0answers
31 views

How can I decrease FULLTEXT initialization time?

I'm trying to decrease execution time of the a query. Using SHOW PROFILE, FULLTEXT initialization takes about 0.3, which is too high. Other values are at normal level. How can I decrease FULLTEXT ...
0
votes
1answer
22 views

MySQL read/write ratio from information_schema.GLOBAL_STATUS

Could you please help me to construct a query to sum specific rows from a table, basically desired output is: +-----------------+----------------+ | Total reads | Total writes | ...
0
votes
1answer
35 views

How to find n consecutive numbers in MySql

I have numbers starting from 1 to 50 and then 90 to 200 in my database and I want to fetch 100 consecutive numbers then the result should be 90 to 189. Records in my table are more than 10 million.
0
votes
1answer
18 views

Extracting the maximum of several subsets and join all maximums in a new table

I have a big table: What I need is to obtain the maximum value for each testname, with different entry and get a new table such as: And then I want to compute the maximum, the minimum and the ...
0
votes
1answer
31 views

Why is my Mysql Query verry slow when selecting a text field

i have a problem with a left join. Tables are myisam. Tables CREATE TABLE `article` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `force_startpage` tinyint(1) DEFAULT '0', `title` varchar(255) ...
0
votes
0answers
38 views

amazon small instance mysql query too slow

I have mysql database with 1.5 millions records with 2 million categories records. when i do query on categories and city where clause it takes 304989 milliseconds. on localhost it too fast. i tried ...
0
votes
1answer
16 views

pt-table-sync for 3 master servers

We had a mysql multi master with 3 nodes and unfortunately the replication broke. We have some set of tables which has to be in sync with other database servers, so i was looking into Percona-Toolkit ...
1
vote
1answer
21 views

MySQL crashes frequently on a Windows server

I have been facing an issue with MySQL crashes since last week. I don't know what exactly is happening. When I look at the Windows logs, I see the following error message: Faulting application name: ...