MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

1
vote
2answers
20 views

How to use a MySQL error handler in a stored procedure with prepare/execute

I have a procedure defined like this: drop procedure if exists drop_tables_like; delimiter $$ create procedure drop_tables_like(myint int, pattern varchar(255), db varchar(255) ) begin DECLARE ...
2
votes
1answer
776 views

Mysql Getting Access denied for user 'root'@'localhost' (using password: YES) constantly in log

I have MonYog running and it is monitoring my DB Server. It gives me constant alerts that the number of refused connections has exceeded the threshold etc. Looking in the LySQL.Log I can see constant ...
1
vote
1answer
28 views

Hostgator php code error while creating a new database table

Error is Error creating database: Access denied for user ''@'localhost' to database 'my_db' Code is { <?php $link=mysql_connect ("localhost", "cpuser_dbuser", "password") or die ('I cannot ...
-3
votes
0answers
5 views

a phpMyAdmon database question

I have two tables in database of phpMyadmin. One table is symptoms table, and 2nd is diseases table. The symptoms table has two columns: smpid and symptom The diseases table have three columns: ...
0
votes
1answer
157 views

mysqldump 5.5.25 use swap instead of memory

mysql version 5.5.25, while use mysqldump to dump big tables, it eat lots of swap while there is lots of free memory. # free -m total used free shared buffers ...
3
votes
0answers
16 views

Missing DB entries

I have run into a problematic situation. I oversee the administration of 5 php web pages on one server, each having their own database. All pages work like interactive forms drawing and storing data ...
0
votes
1answer
573 views

MySQL profile on query “Creating Sort Index” using 75% of the total time

We are trying to figure how to optimize a query (taking around 100ms), and running profile we see Creating Sort Index using 75% of the total time. First, what exactly effects creating the sort index? ...
1
vote
1answer
407 views

MySQL update one table from another joined many-to-many

I have two tables, events and plays joined many-to-many by a third table plays_in_events. Where the events.Name field is blank, I want to set it equal to the name of the play that was performed in ...
1
vote
2answers
912 views

Why is my RDS mysql slow query log full of server restarts?

One of my RDS mysql databases is giving me warnings about the slow query logs taking up significant space. The logs are rotated once an hour, and contain a dozen repetitions of: ...
2
votes
4answers
2k views

How to subtract fields and insert the value in other field automatically?

id val1 val2 total 1 10 4 10-4(automatically get the value) . . . . I am using php and mysql. I have a total column I need to make calculation automatically in a field, how it ...
0
votes
2answers
110 views

Mysql connect without username/password

I build a new website for a client (WordPress is underlying) and have access trough FTP to his webspace. He does not provide or even know more informations than this because he had taken it from an ...
0
votes
1answer
181 views

List all mysql reocrds in a master table and last record in a related child table

I want to list all records in a mysql master table and last record in the child table that is related to the master. Here is my code $strsql="SELECT contact.id, contact.title, contact.init, ...
1
vote
4answers
24 views

Help with PHP code, SELECT from database

<?php session_start(); include ('connection.php');?> <?php $username='pablorex192'; $consulta=mysql_query("SELECT question FROM users WHERE user = $username") or die ('This is the error: ...
2
votes
1answer
217 views

Can a slave with a dynamic ip update the master

How can I setup mySQL replication in such a way that a slave on localhost with dynamic IP can update the master as well as get updates from the master which has a static IP. The slave will not be ...
2
votes
1answer
327 views

mysql restore from data directory

I recently asked a question regarding the restoration of a pretty huge (around 300 to 400 GB) mysql database and got some nice suggestions as seen here. Now, I have backed up the data directory of ...
1
vote
1answer
497 views

Can I change max_allowed_packet for a MySQL database, but not others in the same instance?

We have a MySQL server with multiple databases in the same instance. Can I change the max_allowed_packet value for just one of the database? From looking at this, it seems SET GLOBAL ...
1
vote
1answer
190 views

How to get names form 3 different tables

I have 4 tables to proceed. In table A I have the parameters of columns in tables B,C,D and the names are there. TB_A ...
2
votes
1answer
21 views

I created a DB schema for a project relating to collecting comments for web pages, is relational the way to go and how are my relationships?

I'm curious if relational DB is the way to go, if the current relationships in the diagram make sense, and whether it will bode well for coding.
1
vote
2answers
194 views

How to optimize indexes on MySQL query with various sorts

I have an INNODB table levels: +--------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | ...
3
votes
1answer
30 views

Modeling discounts - Product specific and Customer specific discounts

I have a reasonably simple database but have the following problem: I'm modeling a store + a lot of non-relevant stuff database. I have the following problem. I want to allow for specific products to ...
0
votes
0answers
18 views

MySQL: Using DATE_SUB to subtract business days instead of all calendar days

I am looking for a robust solution to subtract the number of business days from a date. I am using DATE_SUB however it subtracts all calendar days. For example, if today is Monday and I subtract 2 ...
2
votes
2answers
960 views

What is default MySQL binlog retention in AWS RDS?

I tried to retrieve my MySQL RDS binlogs in order to run manual "rollback" for some SQLs. Unfortunately, I noticed that only 2 binlogs for the last 30 minutes are available. "call ...
2
votes
1answer
31 views

Migrating Oracle 9i database to MySql database on a different Windows Server

I need to migrate my Oracle 9i database with all its tables from windows server 2003 to MySql on another Windows Server 2012. The oracle database is connected to Visual Studio web project. I have ...
0
votes
3answers
280 views

How to solve multidimensional data relationship

I'm having a problem, that I could solve programmatically, but for my personal (test) project I'm trying to see if I can fix it in the relational model. Imagine a complex fashion product Pants with ...
3
votes
1answer
674 views

Why would the size of MySQL MyISAM table indexes (aka MYI file) not match after mysqldump import?

I've been archiving some MySQL (version 5.0.96) MyISAM tables locally and deleting from my server after checking the data. Every time the process has been pretty similar and comes off mostly without a ...
0
votes
1answer
140 views

Lowering MySQL Memory Usage without Restart

We are using Percona Server 5.5.35-rel33.0-611.precise with InnoDB in our production server. Recently Mysql memory went high and it did't drop from there. We are afraid whether it would result in OOM ...
2
votes
2answers
40 views

Modeling invoices and orders

I have a problem in modeling a database that contains orders and invoices. Actually it's more of a problem from a business point of view, but it's related to modeling the database nonetheless. Model ...
2
votes
1answer
1k views

How to do While Loops?

How can we use while loops in MySQL? My test script: BEGIN SELECT 0 INTO @n; WHILE @n < 10 DO SELECT @n; SET @n := @n +1; END WHILE; END; But it has syntax errors. I've also ...
0
votes
1answer
108 views

Slow query log of wp_options WHERE autoload = 'yes'

Slow query log: # User@Host: # Query_time: 181.648376 Lock_time: 2.114138 Rows_sent: 1425838 Rows_examined: 1663532 SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'; Table ...
1
vote
2answers
11 views

Mysql user accesable with out password from the host machine but not from the remote machine

I have setup mysql and created a user 'test' and have given a password for it. Strange thing I observed is, for test user I am able to access with out password from the machine I have installed mysql ...
2
votes
2answers
14 views

Any ideas on how to parallelize mysql_upgrade?

I am migrating from 5.5 to 5.6 and would like to speed up the mysql_upgrade process. I have thousands of databases per machine and 200 tables (innodb) per db. Any suggestion how to speed up the ...
2
votes
1answer
15 views

Database design, many rows or many columns?

I am aware that this has been discussed before, but I've read conflicting information about this particular topic, so I'm hoping for a bit more decisive opinions from you. I have multiple tables, ...
1
vote
1answer
114 views

drop table from outside?

A poorly designed script ran on my MySQL 5.6 instance for 24 hours before I stopped it by killing the MySQL command line client and rebooting the machine while the script was still running. The ...
0
votes
1answer
208 views

NDB Cluster seems to ignore foreign_key_checks=OFF

According to MySQL documentation on the local foreign_key_checks variable Beginning with MySQL Cluster NDB 7.3.2, setting this variable has the same effect on NDB tables as it does for InnoDB ...
0
votes
1answer
573 views

xenforo vulnerability, limit max open connections by ip address

Trying to get some emergency help because my website is being attacked. It isn't as much as an actual attack, as it is a small bot to exploit xenforo vulnerability. ...
2
votes
1answer
350 views

MySQL query returns unexpected results inside a stored procedure

This is my stored procedure: CREATE DEFINER=`root`@`localhost` PROCEDURE `isUserValid`(IN `facebookId` VARCHAR(20), IN `userAccessToken` TEXT) NO SQL COMMENT 'check if user is valid. return ...
0
votes
1answer
188 views

Does “Connect” statement for every query indicate broken connection pooling?

there's only one client application running queries against a MySQL instance. After enabling MySQL's general query log (configured to log every query) I noticed that every query starts with a ...
1
vote
2answers
129 views

mysql multiple column index Cardinality order

How does Multiple-Column Indexes work in MySQL? How is it stored internally? consider a table with Multiple-Column Indexes on two columns (X,Y). If X has High-cardinality than Y i.e., X is less ...
2
votes
2answers
306 views

Is this amount of disk IO expected with MySQL?

I am running MySQL 5.5.34 on an Amazon EC2 micro instance with EBS (elastic block storage). The instance has been running for around 10 days and according to Amazon I've accumulated around 8.5 ...
3
votes
1answer
18 views

automatically change value on the table mysql

i have table invoice in my database that contain atributes 'due date', 'date' and 'status'. What i want is data on 'status' change automatically. Example, status (unpaid change to expired) when date ...
2
votes
0answers
15 views

Mysql high cpu usage - cpanel

After an update from whm, I see a high CPU usage from MySQL (5.6). my.cfg: [mysqld] slow_query_log=1 slow_query_log_file="/var/lib/mysql/slow-query.log" long_query_time=1 skip_name_resolve ...
0
votes
1answer
214 views

How to split a row based on a delimiter into multiple rows and retain the ID and ordering by using a single SQL statement for MySQL

Scenario: A MySQL table A Delimiter (e.g. comma) is used to separate entities inside a string store in a column of the MySQL table MySQL table contain 2 columns - ID and Countries_Involved ...
1
vote
1answer
35 views

Update records from one table to another in different databases where condition is accomplish

I have two tables stored in two differents DBs and I need to perform some sync between both tables based on lastmodifieddate and lastSyncAt. Let's call them as db1 and db2. This is the DDL schema for ...
0
votes
3answers
200 views

mysql need help optimizing query

I have a table containing servers logs, and another table containing rules to match certain and drop them. The logs tables contains around 1 million rows, and there are about 20-30 rules. The ...
2
votes
1answer
25 views

Is there any difference between 'LIMIT 0, 1' and 'LIMIT 1'?

I recently stumbled upon example codes, which differed by these notations. SELECT * FROM table LIMIT 0, 1 SELECT * FROM table LIMIT 1 The first argument should be considered as the offset if I'm ...
1
vote
1answer
86 views

Does PostgreSQL support online schema modification (DDL)?

Recent versions of MySQL (using InnoDB) support many alter table queries without exclusive locking the table. Does PostgreSQL support this to any level? That is, can I add/drop columns from a table ...
0
votes
0answers
13 views

nbsp character might not be passing as nbsp to the MySQL backend

I am following a tutorial where a web application written in PHP, blacklists spaces from the input(The 'id' parameter). The task is to add other characters, which essentially bypasses this blacklist, ...
-2
votes
0answers
16 views

performance of dml statements in mysql [on hold]

how can we increase the performance of insert and update statements in mysql procedure. and also if a procedure has only updates statements Blockquote ...
0
votes
1answer
772 views

Can't change root password: “The system cannot find the file specified.”

I'm trying to change the root password in MySQL on my development machine (I've just installed MySQL, so it currently doesn't have a password), but it keeps failing with the following error message: ...
0
votes
1answer
140 views

Index to fix this query MySQL

We have an extremely large forum running lots of third party software (Most of which doesn't run all that well) and we're starting to optimize things as time allows. This query keeps popping up in the ...