MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
0answers
24 views

Indexing Multiple Possibly Missing Columns

I'm working with a particularly large database, and am not particularly in tune with some of the intricacies of RDBMS's as I work primarily in PHP/WP and with smaller databases. Either way, I have ...
0
votes
0answers
26 views

Career Database Design

I am new in cakephp, I want to develop a simple career website, I have design the database, but I would like to show it to professionals and know if the structure is ok Jobs - id - job_title - ...
1
vote
1answer
40 views

MySQL select with join table

I have 3 tables, one of them is join table: user table: CREATE TABLE `user` ( `id`, `name`) media table: CREATE TABLE `media` ( `id`, `value`, `type` enum('M', 'T')) user_media table: CREATE ...
0
votes
1answer
47 views

How do I move a MySQL data directory to an external hard drive?

I tried moving MySQL data directory to an external Hard disk (which has been formatted using NTFS). I followed the steps given in the answer to the question How to change MySQL data directory? Stop ...
5
votes
2answers
83 views

Why do so many queries have aliases? [closed]

I've spent a lot of time searching for, researching and implementing various complex MySQL queries over the last several years. Many of them use lots of aliases for tables, even when none are ...
0
votes
0answers
30 views

How to interact with a foreign key in database [migrated]

I have been working on a database for sometime now and i got stocked a particular section. I am trying to write a code to control the foreign key column in a database. mysql is the back-end and Java ...
0
votes
0answers
37 views

Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

I am using MySQL with PHP for printing details from a database. I tried to make a new user, which was successful, although I get an error from MySQL when I tried to fetch data from it. It showed me ...
1
vote
1answer
21 views

Services don't have MySQL Server. How to run it?

I need to run MySQL Server on a new for me laptop. There's Windows 7. And MySQL have been installed on it. In order to verify this, I opened the Programs and Features window and saw it there: ...
0
votes
1answer
39 views

Mysql How to insert a variable as field value in a table

I have created a variable named hash as a password hash. How can this variable be inserted a a field value in a table? hash = pbkdf2_sha256.encrypt("password", rounds=200000, salt_size=16) ...
0
votes
1answer
24 views

Copy a Large INNODB table in MySQL

I have an INNODB table that's > 93 million rows. A lot of the data is considered "temp" data and is governed by an "is_active" flag of 1/0. When a user updates a form, new data is written with an ...
0
votes
2answers
21 views

Show sql statements from mysql binlog (GTID)

I have mysql binlogs for replication through GTID. I'm trying to show executed update/insert statements like this: mysqlbinlog --base64-output=DECODE-ROWS mysql-bin.000024 But all I see is ...
0
votes
1answer
13 views

MySQL Trigger: Can you turn a query updating multiple columns to multiple queries where each update one column?

Here's what I'm trying to archive: use a trigger to divide an update query which updates more than 1 columns into several update query and each of the query updates just 1 columns. For example, the ...
0
votes
0answers
16 views

How does mysqlslap calculate average number of seconds to execute all queries when number-of-queries specified?

Let's say I have 10000 queries (q1,q2,q3....,q10000) and want to test the queries performance using mysqlslap with number-of-queries option along with 100 concurrent sessions(c1,c2---c100) and one ...
2
votes
2answers
24 views

Identify slow query without slow query logs in mysql server

I am wondering is there any other way to to check our slow queries without logging slow query. Suppose, I have a highily busy server can't afford to log much to save memory and I/Os. Then, is there ...
0
votes
2answers
21 views

Unable to remotely access MySQL

I am experiencing problems with mysql 5.1 at the moment and possibly due to that I am unable to connect. The port that I am using for mysql is open (http://www.yougetsignal.com/tools/open-ports/) ...
0
votes
1answer
20 views

MySQL Cluster node utf8

I have configured MySQL Cluster (5.6) with two data nodes and managment node. Problem is that I cannot put special chars - looks like encoding is not set to utf8/utf16. I logged into each node and ...
0
votes
1answer
16 views

Working with variables in stored proc

I want to create a meta table on the fly using a stored pdocedure and passing a table prefix as "in" parameter and then build the final table name somehow. My code looks like this: SET @table_ = ...
0
votes
0answers
15 views

Searching a keyword from multiple tables using my querry , [migrated]

I want to search "law" from three tables tbl_books, tbl_books_author and tbl_books_subject. I am running following query. SELECT * FROM tbl_books p, tbl_books_author d, tbl_books_subject m WHERE ...
0
votes
2answers
44 views

How to get several specific records from a query result?

I know by using Like with "LIMIT 1, OFFSET x" I can get the Xth record from a returned query result. But what if I want to get X, Y, and Z all at once? Currently I do a for loop and it's like I'm ...
0
votes
0answers
30 views

Is doing an online alter on a MySQL table to add comments safe?

Is doing an online alter on a massive MySQL table to add or edit table or column 'comments' safe? Or do you need to take precautions like you would while adding, removing columns, etc on that table?
0
votes
1answer
24 views

How to mimic a full outer join using mysql views?

I have all kinds of views in mysql with employee data. I have tried to use methods like this -http://stackoverflow.com/questions/2384298/why-does-mysql-report-a-syntax-error-on-full-outer-join but ...
0
votes
1answer
32 views

What is the most efficient way to exclude records with a particular ID in a MySQL query for random records?

I have an api endpoint that returns X amount of random posts from a table called "posts". This endpoint is used by a mobile app. It retreives random posts by doing a SELECT COUNT(*) on the posts table ...
0
votes
1answer
14 views

What does MySQL “USE INDEX()” without any arguments do?

Does the USE INDEX() have any effect here? SELECT `posts`.`id` FROM posts USE INDEX() where `posts`.`size` > 1024; (I have it presently in some SQL because of the way the query is ...
0
votes
0answers
15 views

MySQL ignores ZWNJ character in string comparison

If you add a unique index to a char columns you can not add two string that differ only in having ZWNJ characters (e.g. 'فا' and 'ف‌ا'). However I need to store both of them. How can I overcome to ...
1
vote
1answer
21 views

Unable to update table after creating an After update trigger

I have a table like this /*Table: pageprivilege*/ ------------------------ /*Column Information*/ ---------------------- FIELD TYPE COLLATION NULL KEY DEFAULT Extra ...
0
votes
0answers
22 views

select with a multiple row in pivot table [migrated]

I really don't know how to retrieve a specific row from a pivot table. Here's my pivot table: +----+-------------+--------+ | id | peticion_id | tag_id | +----+-------------+--------+ | 1 | ...
0
votes
1answer
35 views

Unknown sticky Problem after MySQL upgrade

few weeks ago we upgraded mysql server from 5.5 to 5.6 on 1st server few days ago (5May) I reboot mysql server , after this customer reported that some database data table not load to their site . ...
1
vote
1answer
32 views

how would i merge a column where matches a different column? [closed]

It's very similar to the below post How to merge column in mysql depending on match table user Merge customer_id from table user to table cust where customers_firstname AND customers_name ...
0
votes
2answers
13 views

Import/Exporting certain columns of a table across two databases and excluding duplicate emails in mysql

I have run into a problem with mysql queries: Basically, I have two databases that both contain a table called tblclients however db1 has far more records than db2 and there are some duplicate ...
0
votes
1answer
24 views

MySQL Join is the same as Cross Join?

I'm learning mysql. Under all cases, is Join the same as Cross Join? For example, this query SELECT * FROM table t1 JOIN table t2 Will always be the same as SELECT * FROM table t1 CROSS JOIN ...
0
votes
0answers
22 views

weird auto inc generating id in mysql

I'm creating a tableB and generating auto-inc as 600000000 for the table. ) ENGINE=InnoDB AUTO_INCREMENT=600000000 DEFAULT CHARSET=utf8 A trigger inserts to this table whenever an update happens ...
0
votes
0answers
16 views

I want to sync local mysql database and live server mysql database

My plan is to store data in my local MySQL database and after a time interval or when system connected to internet it will update my live MySQL database remotely Is it possible? I'm have a inventory ...
0
votes
0answers
22 views

Promo Codes - should I create a separate table or add a code column to a join table for Students and Courses

I'm creating a promo code and invitation system and I want to understand the best way to structure the database to include the Promo Codes. This is what I have currently: User: has_many Courses ...
1
vote
1answer
32 views

Selecting the correct row given multiple input value combinations

I have a table that stores part numbers for various items like so: +------+-------------+-------------+-------------+ | Item | Color | Type | Part Number | ...
0
votes
0answers
11 views

How to capture a manager highest level from bottom in mysql?

So I have a giant table of 100K employees. Every employee has a supervisor except our top boss. I want to capture a manager's level from the bottom. Sounds simple but now I have a series of views ...
0
votes
1answer
18 views

How to enable MySQL remote access?

I have a MySQL server and I want to enable remote access for a certain IP and localhost only. For some reason I couldn't manage to do it as it doesn't work every time I try. I typed the following ...
0
votes
0answers
30 views

Cleaning up orphaned metadata in information_schema

OK - so the server (Percona 5.6 in this case) 'went away' in the middle of declaring a constraint like so: alter table mytable add constraint fk_mytable_myothertable foreign key (myothertable_id) ...
1
vote
3answers
36 views

Insert if NOT EXISTS not working

I am trying to copy data from table to another mysql table from two different databases First I get all data from first table and stored them into php variable then I loop on that var to insert data ...
1
vote
1answer
22 views

Can I parse a text value from a specific column in a query (MySQL)?

I was playing around with Sakila and I ran across the actor_info view and one of its columns is film_info which is a detail of all the movies one actor has worked in. For example a query would be: ...
0
votes
0answers
11 views

Need to have many row values assigned to one row in different column

I need to assign many values from one column to only one row in different column within same table. can i do that. Example: Name Subjects John Maths History Science Ria ...
0
votes
1answer
36 views

How to convert rows into columns and query on them in Mysql?

I have three tables Patients, which contains the name of my patients, Controls which represents the UI controls which could be drawn for each illness , and ControlsValues table which contains the ...
-1
votes
1answer
37 views

Can we restore mysql db without .ibd & .frm files?

I have a data folder and the database folder with .frm & .ibd files is missing, any way to restore the database? Currently the data folder has: ibdata1 ib_logfile0 ib_logfile1
0
votes
1answer
17 views

How can I append new data from a particular mySQL table to an excel spreadsheet?

We have a database trigger that automatically adds new clients to a table when they first contact the server, it takes a number of unique identifiers that the client provides on first contact and ...
0
votes
0answers
19 views

Start MySQL Server in mac

I do not install mysql in /usr/local/mysql/ i move mysql to other folder when i start mysql server from terminal by this command: sudo MySQLDir/support-files/mysql.server start return me ERROR! ...
0
votes
1answer
23 views

Mysql slave status is completely perfect but data is not reflecting

I have setup replication using mysql utilities. Slave can able to read and execute master's position and binlog files perfectly. seconds_behind_master is also 0. But data is not reflecting into slave. ...
0
votes
0answers
12 views

Is there Merge and Snapshot replication methods for MySQL?

In distributed database systems, is Merge and Snapshot replication supported in MySQL? I am thinking of something similar to MS SQL's types of replication: ...
0
votes
2answers
36 views

Query to determine if items have tax [duplicate]

I have the following tables Item ID Name Item taxes ID percent item_id An item can have more than one tax I want to write a query that will give me all items with no tax. This query needs to ...
1
vote
1answer
27 views

(MySQL) user table and profile separate, or same table?

I'm creating a blogging site that anyone can sign up and be an author for. I want each author to have their own public profile. My main question is; would it be better practice to have a separate ...
0
votes
1answer
34 views

Index Strategy for MySQL Query that matches on one column and between two others

I have a table that contains a set of measurements for a continuous stream of processes. Although each process is individual, they are categorised into groups. The events have a start and end ...
0
votes
0answers
15 views

Formula/algorithm to merge and sort arrays into one [migrated]

I have four arrays that I need to merge/sort pragmatically. https://docs.google.com/spreadsheets/d/1e041YuQCUVu4_hgu1uCGaKILrL5a3WqReEeKtCeGLOs/edit?usp=sharing The link above shows the contents of ...