MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
52 views

MySQL Workbench — How to efficiently review large database tables?

I have a database table with 900,000+ rows, 20 columns, mostly string data. Using MySQL Workbench, I want to page through the entire contents of the table to see what exactly has been inserted into ...
2
votes
1answer
29 views

Is it possible to gain the precise position of a live mysql database when performing full backup

I have a production database that I usually run fullbackups on once every week. I have bin logs turned on for incremental backups. The production server is on the west coast while business hours are ...
-1
votes
1answer
42 views

is camel case for column names safe?

I have a database where column names are all camel cased. No problems encountered. Will that be a problem under some scenarios, as per recent versions of MySQL, Postgres?
0
votes
0answers
28 views

How to combine 3 queries into 1 including set?

I have 3 mysql queries and each does specific job, the problem is I can't figure out how to combine 3 queries into 1. I'll write down all 3 queries and explain what each does, thus you can figure out ...
0
votes
2answers
23 views

Creating database level user in MYSQL

Our MySql production server has two different databases in it. For reports I want the user to only be able to see reports database and not main database. I created A user 'username@%' for the reports ...
0
votes
0answers
42 views

MYSQL: InnoDB inserts wont rollback transaction inside a stored procedure

I have this stored procedure: START TRANSACTION; code_gen_loop: WHILE @Codes > 0 DO IF MOD( @Codes, 10000 ) = 0 THEN EXECUTE qry_status_stmt2; EXECUTE qry_status_stmt3; ...
1
vote
1answer
43 views

Moved MySQL datadir Now Server Will Not Run!

My problem yesterday (MySQL - Alter Table Fails As Workbench Tries To Create Existing Table) was caused by /dev/sda2 (/root) running out of space. The cause of this was that, by default, MySQL had ...
0
votes
2answers
35 views

Where deadlock happen in mysql

I am unable to read below logs of mysql after executing SHOW ENGINE INNODB STATUS command. Can anyone please help me out where the deadlock has happen? ------------------------ LATEST DETECTED ...
0
votes
1answer
27 views

No syntax for Nonclustered index in MySQL?

So, I have seen people discussing about differences between clustered V Non Clustered index, however, I didn't see any syntax for Non Clustered Index in MysQL. How does MySQL creates Nonclustered ...
0
votes
2answers
29 views

mySQL query with field replacemnt?

I'm need to run a query from mySQL 5.6 which involves looking up date from different tables. I'm new to mySQL and I'm not sure what this operation is called, or else I would have just googled the ...
0
votes
1answer
35 views

mysqlslow - excluding queries from mysqldump

I would like to ignore the queries in my mysql-slow log that originate from mysqldump using SQL_NO_CACHE as the trigger word. My experiences using regex are limited at best and I'm unable to find any ...
0
votes
1answer
28 views

Change Storage Engine on Referenced Tables

i need to change storage engine from 'InnoDB' to 'MyISAM' on some tables of different databases. So i made a script file to do so: #!/bin/bash DATABASES=$(mysql -u XXXXX -pXXXXX --skip-column-names ...
1
vote
0answers
26 views

MySQL ssl setup failed

I am following word by word of http://dev.mysql.com/doc/refman/5.0/en/creating-ssl-certs.html for creating SSL certificates to setup SSL enable replication but it is not working for me. Steps which I ...
0
votes
1answer
20 views

Records in a table unique period

I have the following table: +--+---------+-------+--------------+--------------+ |ID|HEADER_ID|VERSION|FROM_DATE_TIME| TO_DATE_TIME| +--+---------+-------+--------------+--------------+ | 1| ...
1
vote
0answers
46 views

Help with ER design

So i am trying to create a db for a restaurant as a homework assignment.. However there is a spot that confuses me and involves the dish entity. "Every dish must belong to a category ...
1
vote
1answer
28 views

MYSQL-BEFORE UPDATE Set value of Column A to value in Column B if Column A is to be updated

I have a nightly scheduled event which updates all rows in 'products' table with the newest 'unit_price' from a price list table where 'price_list.active-date' is >= the CURDATE(). What I need to do ...
1
vote
1answer
28 views

Mysql Partitions with Partition limit

I have a partition table on basis of Primary key having 1.5 Billion rows in it. But when i check ibd files only 80 ibd show in GB's whereas 120ibd shows 1MB file. I would like to know how does the ...
0
votes
1answer
23 views

Why group_concat and SQL_CALC_FOUND_ROWS do not work with each other?

I have following query which contain group_concat and SQL_CALC_FOUND_ROWS together as I want result + total no. of records present in it. SELECT SQL_CALC_FOUND_ROWS GROUP_CONCAT(ca.id) FROM ...
0
votes
3answers
40 views

MySQL - Alter Table Fails As Workbench Tries To Create Existing Table

I have been trying to add another column to a table in my database using MySQL Workbench. This generates an 'ALTER TABLE' command which then fails as it fails attempting a 'CREATE TABLE, which it ...
1
vote
2answers
35 views

How to Permanently solve MySQL error 2002 (HY000)

I have a problem on my cloud server with 2GB of RAM and 40GB Hard Disk that's hosting a Wordpress website that receives around 1000-2000 hits a day. My problem is that MySQL is always crashing and my ...
1
vote
2answers
51 views

2013. Lost connection to MySQL server during query error

I have a table with close to 20 million rows. In phpMyAdmin, I attempt to add a new column: ALTER TABLE `myTable` ADD `newColumn` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'; After about 60 secs ...
1
vote
2answers
54 views

Invision Power Board 3.4.6 - mysql locks during query with pending updates

about 2 weeks ago, we started experiencing random lockups and slowdowns on our forums. We've been running this site for around 6 years minimum with no issues. the site and db are on dedicated vms. The ...
0
votes
1answer
22 views

Zerofill Auto Increment - mySql

Ok, So I'm working on an app and I can't remember, for the life of me, why I set a zerofill on an Auto_Increment column when I created the database. And I couldn't exactly find any compelling info ...
0
votes
0answers
18 views

MySQL MEMORY Engine vs NoSQL in-memory

I have a WebService that runs a hybrid functionality of Secure WebSockets and HTTPS REST API. Both functionalities translate the calls to the same under-the-hood generic calls, wherein the WebService ...
0
votes
1answer
31 views

Recovering Mysql - how to get a dumpfile from wampserver and none running db

I had the following: - Wampserver/mysql/drupal + batch file with auto backup by use of mysqldump. - Backup was distributed off and online. then : my laptop was stolen :-( and I need to recover ...
0
votes
1answer
21 views

How to recover a dropped mysql database with its procedures?

I had some databases on a server and MySqlserver on this server has been uninstalled accidentally by someone. I had some backups on this server and could recover all tables and their data successfully ...
20
votes
6answers
4k views

DELETE command not completing on 30,000,000 row table

I have inherited a database and am looking to clean and speed it up. I have a table that contains 30,000,000 rows, many of which are junk data made by an error by our programmer. Before I add any new, ...
1
vote
1answer
48 views

utf8 and utf8mb4

I am converting a few of my tables to utf8mb4 as well as the connection from PHP to MySQL to utf8mb4. This is so that I can support characters used for Emoji in my website. I have two questions ...
0
votes
1answer
19 views

How to only display a variable in PHP inside a MySQL query when it has a content or when a condition is true?

How do I only display $mon or any variable when it has content? whenever i use this syntax and for example, monday must contain the number 1 and tuesday would contain number 2 and the other ones have ...
0
votes
0answers
22 views

How to sync 3 databases of 3 websites?

The process of sync are; the first website will input a proposed project with its information and details then if it is approved it will update the the second website which will mark the project ...
0
votes
1answer
43 views

MySQL Subquery Returns Null In Stored Procedure, Works Fine In Query

I have a subquery in a MySQL Stored Procedure where the value returns null even though the data is clearly there. Pulling the subquery out and running it works fine. I've checked the parameter values ...
0
votes
1answer
25 views

Name of Mysql database folder

I try to access to mysql data via filezilla and download to my pc, What is name of folder where is my mysql data ? I use ubuntu. Thanks.
0
votes
2answers
54 views

Is there a best practice for recurring calendar events

I'm not a dba but a php programmer, so that I'm not an SQL pro. Now, I have searched in both programmers and dba stackexchange sites but the answers are too specific or not conclusive. My question is ...
0
votes
1answer
21 views

Setting a column's default value by adding a constraint

I wrote this query: ALTER TABLE test2 add constraint setting_value33 default male FOR namee; But I get this error when running it: You have an error in your SQL syntax; check the manual that ...
0
votes
1answer
45 views

Slow ranking values in MySQL

I have a table of around 30 million retail products, with various INT columns that describe sales counters and pricing at different retailers. I'm supposed to display well over 70 different rankings ...
0
votes
2answers
22 views

Can't access MySQL after sourcing a database and reboot

I'm trying to set a local dev environment on a Debian VirtualBox and am now stuck for days with the following situation. After setting up apache, php, mysql, pma and got eveything running, I open the ...
0
votes
1answer
60 views

Large MySQL operations slowing down SELECT queries on unrelated tables

On a fairly busy SQL server, we sometimes need to do large index-building operations (after importing ~6GB tables). The indexes are built using the more efficient "Repair by sorting" method, rather ...
-3
votes
0answers
28 views

SQL pick 3 max values from 2 tables during the specific time period

I'm new here... Could you please help with this, probably simple, sql query. I need to: list 3 max values from two linked tables; Table A: (NAME, ID) Tom Clancy 123456 Homer Simpson 987654 Lisa ...
1
vote
2answers
63 views

1 hour query, is there another way to do this?

I saw a couple questions similar to this but none could answer my question, really. I have two tables, and I am trying to find those rows where a match is found. user has about 350,000 entries and ...
1
vote
1answer
21 views

Sql Insert into with duplicate key

Ok so, I'm still a beginner in databases. I have this code: $sql=" INSERT INTO complaints_members (password, complaint) VALUES ('$mypassword','$submit') ON DUPLICATE KEY UPDATE ...
1
vote
0answers
35 views

Database schema design for individual configurations

I'm trying to design a database schema that allows me to store customer custom built products. As a simplified example: A user can buy a cupboard, draws, boxes, and dividers. A cupboard has 2 tiers. ...
0
votes
2answers
47 views

Is possible to backup database online using rsync?

Some people tell me that the backup database on-the-fly using rsync is possible. I think it is possible but not safe because some log, buffer... is not flushed. Database is being recovered from the ...
0
votes
1answer
35 views

Nice query to get my friends

my table has this structure: User_ID | Followed_ID Example row: 33 | 36 Means that user 33 follows user 36. If exists a record like 36 | 33 then the two users are considered friends. ...
1
vote
1answer
34 views

Order by where conditions

SELECT * FROM table WHERE key REGEXP 'some long regular expression' OR key REGEXP 'some other long regular expression' ORDER BY key REGEXP 'some long regular expression' DESC, key REGEXP 'some other ...
1
vote
2answers
37 views

Need to convert date to word using trigger

I have created a datetoword function in Mysql. Checked the function working fine. Now using this function need to convert the date from field1 (date-datetype) to field2 (Varchar-datatype) within the ...
0
votes
0answers
45 views

How to automatically start MySQL server on Mac OS X 10.10.2

I installed MySQL 5.6 using dmg on Mac OS X 10.10.2. I also installed the Preference Pane. I checked the checkbox "Automatically Start MySQL Server on Startup". But every time I start the computer ...
0
votes
0answers
22 views

i always get o for my result.why is it so?

CREATE DEFINER=`root`@`localhost` PROCEDURE `roomAvailbility`( IN checkindate date, IN checkoutdate date, out roomtype char(20)) BEGIN select count(*) INTO roomtype from room_1401557b ...
0
votes
0answers
35 views

How can I make a foreign key from a fragment of the primary key?

I have this table: CREATE TABLE Phones ( Brand VARCHAR(20), Model VARCHAR(20), PRIMARY KEY (Brand, Model) ); A mobile phone can't be uniquely identified just by its model (for example: HTC (One) or ...
0
votes
0answers
10 views

MySQL by default autostarts on Ubuntu Linux?

I installed MySQL server on Ubuntu Linux 14.04 LTS following instructions at https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu. The console ...
0
votes
0answers
13 views

mysql Migrating large amount of data times out

I'm a beginner with manipulating db's. I'm trying to migrate (about 70,000) posts from a Drupal setup to Wordpress on my localhost machine and it appears to be timing out, either constantly staying ...