MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
4 views

Determining result 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 foreigns keys to entries in another table B. The ...
0
votes
0answers
11 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 ...
0
votes
1answer
16 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
19 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
12 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
20 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
52 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
16 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
18 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
24 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
19 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
40 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
14 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
49 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
33 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
51 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
4 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
21 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
16 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
34 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
30 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
21 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
34 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
29 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: ...
0
votes
1answer
25 views

Query to join three tables

I have three tables which I have to join. I'm not a good SQL writer. Can please sombody help me to prepare this using joins: branches ----------------------------------------- branch_id | branch_name ...
0
votes
0answers
20 views

MySQL Dump failure in the middle [on hold]

I have a several GB's of MySQL datas,I want to dump those files,As when I tried to dump,it fails in between. It is impossible to start over the process again,Is there any way to start the dump from ...
1
vote
0answers
21 views

Randomizing the Auto Increment in Mysql

We have a database, where we insert data into table whenever we receive an order from our services. We use auto_increment to generate the ID and assign the order with the same. This is usually same ...
0
votes
1answer
26 views

Duplicate Entry Error with PHP When Trying UPDATE

I am checking if a record exists, creating a new record if it does not already exist, and updating otherwise. The SQL works fine in PHPMyAdmin but not through the PHP page. $check_for_id = ...
1
vote
0answers
36 views

MySQL fulltext selection performance

I have 1.5M rows in a table. Following is the table create code: CREATE TABLE `jobs` ( `id` INT(8) NOT NULL AUTO_INCREMENT, `job_id` VARCHAR(50) NOT NULL DEFAULT '', `title` VARCHAR(255) ...
0
votes
0answers
23 views

DBD::mysql complains “Character set 'latin1' is not a compiled character set”

I think this boils down to "Am I doomed to upgrading mysql hoping the problem goes away?". I've seen a few of the same issues around the internet but with no guidance on a fix other than "Did you turn ...
0
votes
1answer
25 views

MySQL: update field with “x hours xx minutes”using int from another field

We have two fields that hold time data totalTime (int): number of minutes (eg 243) totalTimeDesc (string): normal english representation (eg '4 Hours 3 Minutes') We have a lot of different formats ...
0
votes
1answer
37 views

Last row from a query without Order by

I have something like SELECT var1,var2 FROM table where var3=X AND var4=Y order by var5 desc limit 1; Running this query takes roughly 5 seconds on my database which is far to slow. I was ...
1
vote
1answer
16 views

Can triggers be used to implement automated polymorphic association?

(Apologies for any bad formatting or ignorance of common practices within this community; this is my first question here.) I'm attempting to (re)design a MySQL database for a personal social ...