MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
0answers
22 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
28 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
27 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
26 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
38 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
17 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 ...
0
votes
1answer
17 views

Where mysql writes its log seqeunce numbers and last checkpoint at?

I'm working on developing mysql log collecting system. To do that, I have to collect log sequence numbers from mysql LSN and last checkpoint location. But I have no idea where should Which log file ...
1
vote
1answer
62 views

MHA configuration problem with MariaDB10

I am using MHA (MySQL Master High Availability) over a MySQL/MariaDB master-slaves pool. Here is my setup : master1(10.0.0.1:3306) (current master) MySQL 5.1 (log-bin:enabled) ...
0
votes
0answers
18 views

Why does Amazon RDS memory utilization drop and disk space utilization rises?

I encountered a problem with my Amazon RDS(db.m2.2xlarge) where DB connections spiked up and my website started responding slowly. On looking up the metrics I was not sure why my freeable memory shot ...
0
votes
2answers
36 views

How do I allow remote mysql access to all users?

I have setup a mysql server on unbuntu. The server hosts websites for my various clients. Hence, I want all of them(and any new clients) to have remote access to the mysql server. How do I configure ...
-1
votes
0answers
34 views

“Bad SubDomain SQL query” [closed]

My website shows "Bad Sub Domain SOL query" when i open the site.It's an E-commerce site, platform is PrestaShop(Version: 1.5.5.0) and it worked well in the last 2 years. Now it shows "Bad Sub Domain ...
0
votes
1answer
18 views

MySQL/PHP Returning Blank Error Message [on hold]

I am using the following code to delete a record. It works fine, but MySQL always returns a blank error message. PHP returns "Error: " instead of "1 Record Dropped". $eventid = ...
0
votes
0answers
14 views

What are the advantages and disadvantages of Sequel Pro over writing on my terminal? [closed]

I am starting to use MySQL (I am actually learning). What are the advantages and disadvantages of Sequel Pro over writing on my terminal? Where can I find a good quick tutorial to use those advantages ...
0
votes
0answers
16 views

Grouping together values in different columns in MySQL

I have hierarchical data and I'm using the adjacency model. For example my table looks like CREATE TABLE books( book_id INT AUTO_INCREMENT PRIMARY KEY, book_category VARCHAR(100), parent INT ); ...
0
votes
2answers
44 views

MySQL Code Works in PHPMyAdmin but not in PHP Page

When I run this query in PHPMyAdmin it works fine, but when I run it from the PHP page using the $sql command, I get the error: "You have an error in your SQL syntax.....near ')' at line 2" $sql = ...
2
votes
1answer
38 views

Auto-increment ids with multiple inserts in mysql/mariadb

Suppose I have a table with an auto_increment column, and then insert multiple values in a single statement: insert into foo (bar) values ('a'), ('b'), ('c'); From the documentation, ...
1
vote
1answer
25 views

mysqldump drop create use case sensitivity

Dumped sql from MySQL is showing inconsistencies in the name of the database. Using the following bog standard method to dump a database: mysqldump --add-drop-database -u someuser --databases ...
0
votes
3answers
48 views

Master-master Replication with 3 Nodes

I need to configure mysql master/master replication with 3 nodes. Currently I have master/slave setup and I need to move it to master/master with 3 nodes. I have gone through some posts about ...
0
votes
1answer
25 views

Is it possible to uninsall MySQL-5.6 and install MySQL-5.1 on RHEL 5

I have installed MySQL-5.6.x community edition on RHEL5. It was running fine. Since, it is my testing server. To find the differences in execution timing, I have to install the MySQL-5.1 community ...
0
votes
1answer
33 views

MySQL crashing randomly

We have a sever running a website Joomla 2.5. We are facing frequent mysql crashes that occur when website has medium visitor load like a few thousands. It appears that mysql consumes more memory and ...
1
vote
1answer
16 views

add column without metadata lock in mysql 5.6

I am using MySQL Server version: 5.6.15 Homebrew. I need to add new null column. alter table requires no metadata lock. In order to avoid this MySQL 5.6 introduced algorithm=inplace. Here is the ...
2
votes
2answers
45 views

Copy from one MySQL table to another MySQL table of same database

I have around 40 million rows in a MySQL table and I want to copy this table to another table in same database. What is the most efficient way of doing this? How much time will it take (approx.)?
0
votes
1answer
37 views

Pulling from Two Tables with Different Number of Records

I have three tables, one for members with 8 records, one for tasks with 1 record, and one for events with 3 records. The tasks table associates the events with members using one-to-many primary to ...
0
votes
1answer
20 views

Adding a constant IF not in an other table

So I have this query. SELECT * FROM `Comment` WHERE `Target` = '".$_GET['pp']."' AND `Id` NOT IN (SELECT `Target` FROM `Delete` WHERE `Type` = 'comment') ORDER ...
0
votes
2answers
35 views

query execution time in mysql

I have run the query in mysql which consists of approximately 33million records when i have executed the query select population1 < 200000 from city; it shows like this after execution ...
0
votes
1answer
15 views

Mysql Select using Alias

I Need to filter the query that have some conditional column as below: SELECT `c`.`fullname` AS `fullname`, IFNULL(`c`.`new_ic`,`c`.`old_ic`) AS `Ic`, `bla`.`loan_no` AS `Loan_No`, ...
1
vote
1answer
28 views

Merge a table into an existing one

I know how to JOIN two tables as create a new table out of the results, using CREATE TABLE result_table AS ( SELECT * FROM tableA JOIN tableB ). I forgot to include some columns from the JOIN in the ...
0
votes
0answers
16 views

Get tp.address_from and tp.address_to from travel_point table

I'm building a view for get tp.address_from and tp.address_to but I can't get this works. This is the query I'm working on: SELECT `tp`.`address_from` AS `address_from`, `tp`.`address_to` AS ...
0
votes
1answer
16 views

change character set in mysql permanently

I want to change following parameters to utf8mb4 so that mysql can store emoji characters and special language characters. but when i try running following statements one by one SET ...
0
votes
1answer
39 views

Find youtube url

Good afternoon, I need a help, through a select have to locate within a column all the urls from youtube 'https://www.youtube.com/watch?v=cod'* N codes, as necessary to generate a txt with these ...
1
vote
1answer
17 views

Bypassed, Empty Relay Log

We have a simple 1:1 Master-Slave replication configuration. The Master crashed, but we recovered and replication seems fine (confirmed by pt-heartbeat and SHOW SLAVE STATUS) but we've picked up one ...
2
votes
2answers
65 views

mysqldump --single-transaction, yet update queries are waiting for the backup

If I use mysqldump --single-transaction, according to the docs it should do flush tables with read lock to get a consistent state and then start a transaction and no writers should be waiting. ...
1
vote
0answers
16 views

MySQL getting killed by AppArmor

I have copied this link from StackOverflow as it is marked as out of topic there and is waiting to be transfered here. So, here it goes: Occasionally, without any identifiable pattern, MySQL ...
0
votes
0answers
21 views

Creating a registration page with PHP and PDO [migrated]

I need to create a registration page using PHP and PDO, and encrypt the password before storing it on the database table using md5 (adding 2 salts to the password). How can I write the script for ...
1
vote
0answers
29 views

call id of a table to a new table and insert values to this new table [migrated]

I have recently started to write server scripts. Although the question may seem to be very basic but i am not able to get a solution. I have two tables one is PRODUCTS and the other is DEALS. ...
0
votes
1answer
35 views

Building a query programatically

I have three variables $color, $size and $category. Each oh them can be a specific value or may refer to all entries.I want to fetch all products that are $color = "red", $size = "Medium" and any ...
1
vote
1answer
41 views

A table that consists of multiple FK or creating separate tables for each FK

I have tables called 'books', 'category', 'subcategory', and 'booksCategory'. Each book can have its own category and subcategories. For example, a Sci-Fi book can belong in the 'category' table under ...
0
votes
1answer
31 views

Can I use mysql/mariadb databases on different OS?

If I will use mysql/mariadb on Windows and soon I'll decide to switch to Linux or vice versa, can I use databases created in one operating system in another one without any data-loss? Thanks in ...
0
votes
1answer
54 views

Inserting data into multiple tables

For my system, students are required to create a user account by completing a registration form (personal, contact and course details; also username and password). I need to collect registration data ...
0
votes
2answers
34 views

Sql statement to compare two table

I have two table with the same structure, i want an sql statement to compare them and see any modified line, deleted or added Table Product1 : ________________ |Product | Price| |Product1 | 10 | ...
0
votes
1answer
15 views

How to disable HTML output in mysql console?

I've used several mysql instances on many servers, but this one had a suprise for me tonight when I tried to use its console for the first time : me@MYSERVER:~$ mysql -H my_base (....) (...) Server ...
1
vote
2answers
26 views

Perform group by with random group expression (randomly partitioning rows) MYSQL

Let's say I have a table (with millions of rows) cat1|cat2|value A | B| 10 ... and I want to group the data by cat1 and also split the grouping into 10 (at least roughly) equal partitions of ...
1
vote
2answers
47 views

What subquery do I need to calculate this report?

I have two tables: tickets and comments. I need to run a report that shows me which ticket is "neglected" meaning that there has not been a comment in X amount of time. If I was to do this in PHP, I ...
0
votes
2answers
34 views

Building a dedicated physical MySQL server [closed]

I have a database that I use to mine a "primary" 20-column table with 18 million rows and growing by about 2 million a week, and that may accelerate. I am working to pre-process data by running PHP ...
0
votes
1answer
25 views

Perl - MySQL/MariaDB - slow with no identifiable bottleneck

I am running a Perl script (using DBI) which reads from raw files from a hard disk, and updates MySQL database (which is on a separate SSD). My performance is rather slow (1000 files processed in ...
0
votes
0answers
17 views

LDAP authentication with Percona Server

Reading over this post it seemed to indicate this plugin allowed user authentication via LDAP Percona Server is bundled with the PAM plugin which opens a plethora of ways to authenticate to ...
0
votes
2answers
32 views

Using a join to return multiple values of the same column?

I have two tables user Rank In the Rank table, I saved rank_id and supervisor_id. In the Rank table, I stored the rank name. The rank_id and supervisor_id are foreign keys from the Rank table. ...
0
votes
1answer
51 views

SQL SELECT - adding field to SELECT with JOIN is changing the results

I have a SQL sentence with JOIN, running on mysql 5.5.16: SELECT DISTINCT (ot.orders_id), ot.value FROM orders_status_history osh INNER JOIN orders_total ot ON ( osh.orders_id = ot.orders_id ) WHERE ...
1
vote
2answers
36 views

How to insert values into a table from two different tables?

I have three tables students table ------------------------------------ id(PK, A_I) | student_name | nationality teachers table ------------------------------------ id(PK, A_I) | teacher_name ...