All versions of MySQL (not Microsoft SQL Server). Please also add a version-specific tag like mysql-5.7 if that is relevant to the question.

learn more… | top users | synonyms

2
votes
0answers
897 views

The nature of the relationship between two tables in MySQL

Good day. I'm designing a database for a research project where we're predicting whether or not young female athletes will rupture their ACL(s) based on the nature of a test jump recorded with a ...
2
votes
2answers
2k views

Changing the mysql.proc table directly after upgrade

Our host upgraded our mysql install without us knowing from roughly 5.1 to 5.5. This caused a problem because the table definition of mysql.proc is different as discussed here: ...
-1
votes
1answer
585 views

How to create a mysqldump file automatically from SQL server database on a daily basis

I want to create a mysqldump file from a SQL Server database, I know its possible using MYSQL workBench, what i want is to make it completely automate. So the script runs on a daily or weekly basis ...
1
vote
1answer
111 views

Unable to generate a MySQL query

I have a table in a MySQL database as below: ID Timestamp State 1 2013-07-10 09:00:00 Good 1 2013-07-10 09:10:00 Good 1 2013-07-10 09:20:00 Good 1 2013-07-10 09:30:00 Bad 1 ...
13
votes
4answers
18k views

How to estimate/predict data size and index size of a table in MySQL

I am finding what is the best way to estimate size of a table for that i have studied lot of blogs and forums but unable to find any accurate answer For an example we have a table City with InnoDB ...
9
votes
2answers
10k views

MySQL equivalent of WITH in oracle

Is there a MySQL equivalent of the WITH clause in Oracle?
6
votes
1answer
229 views

Database restructure - beneficial?

I have a table for email messages. Then, I have a table that has the message parts. The Parts table contains a field_id, message_id, and data At the time I used Parts to name the table and ...
1
vote
1answer
637 views

Can I force mysql server to resolve the external ip to localhost?

I'm finally succeeded with ssh tunneling. My point is to open the mysql server to local users only (user@localhost etc.) while providing a remote control to my customers through ssh tunneling. The ...
0
votes
0answers
656 views

Trouble converting MySql Database to SQL Server

I have an mysql database that contains 38 tables. I used "SQL Server Migration Assistant for Mysql" tool to convert this database to SQL server Database. I successfully converted 37 tables. Only one ...
1
vote
1answer
515 views

Mysqlbinlog statement reading

I am trying to perform a point in time on a specific database using a snapshot and mysql's transaction logs. I am using the following to pull statements from the time of the snapshot to the time of ...
2
votes
1answer
1k views

Would adding indexes to my foreign keys improve performance on this MySQL query?

Consider the following query: SELECT `locations`.`id` AS `location_id`, `locations`.`address`, `locations`.`lat`, `locations`.`lng`, `tickets`.`status_id`, `customers`.`name`, ...
8
votes
3answers
6k views

How to determine master in mysql master-slave

I am setting up MySQL Master-slave replication and I am trying to figure out how to handle the failover situation where I promote the slave to master (in the event that the master goes down). My ...
-1
votes
1answer
371 views

MySQL 5.6 Delayed Replication - cancel delay questions

I'm using the MySQL 5.6 Master/Slave replication, with Delay set for 2 hours. My questions are : Q1. What is the proper way to cancel the Delay at the slave - i.e. "roll forward" all the changes ...
4
votes
1answer
16k views

Display Monthly Attendance Report in MySql

I am doing a School Management System in php using Mysql DB. I am stuck in my Project. Please anybody suggest what I am doing wrong. I have two tables in my database; one is to store Students records ...
3
votes
1answer
6k views

mysql ibdata1 corrupt

I do not know whether this is a mysql(version 5.6.11) bug, the case is as following. today when i update mysql conf and kill -9 and restart mysqld, i find that it can't restart anymore. after having a ...
0
votes
2answers
4k views

Difference between two recordsets

I'm looking to calculate the difference between two record sets in MySQL. Say I have the following table: colname type attrbutes id uInt PK date date PK count uInt With this data: id ...
0
votes
0answers
318 views

Efficient, up-to-date way to import an Oracle database into MySql

Here's the situation: I need to automatically merge data from an Oracle and a MySql server into a single, new MySql server. The merging will happen daily, and the resulting server will be hosted on a ...
2
votes
1answer
304 views

mysql binlog file size stop growing

I made a master(A)-slave(B)-slave(C) mode MySQL instances for backup. But today when I see whether the mode works fine, I find A and B are OK. That is B can get binlog from A, but B does not write ...
0
votes
1answer
142 views

Database design in MySQL

I am designing a database for an web application, in this system there are multiple users. Consider, Public (Buyer). Merchant. Tele Marketing Executive(TME). Marketing Executive(ME). Lead ...
4
votes
3answers
3k views

MySQL datatype for username of maximum 15 characters

I currently have a database with the "user" table having username as one of the columns. I allow a maximum of 15 characters for the username in my system. Is it fine to have the username column as a ...
0
votes
1answer
81 views

Indexes and Optimizations for Logging System

I'm designing tables for a new log system and am having trouble figuring out what indexes I'll need (I'm a developer, not a DBA), and am also open to any suggestions/criticisms/etc. for making the ...
1
vote
0answers
904 views

Mysql raising intermittent “system error: 32” errors on connect

I'm running mysql 5.6.12 on OSX 10.8 and getting an error like this one constantly: ERROR 2013 (HY000): Lost connection to MySQL server at 'sending authentication information', system error: 32 ...
0
votes
2answers
163 views

Storing complex userdata

Assume a tool where one can create an useraccount, then store 'fields' for that account. Each field can contain zero or more 'sub-fields' and each of those can contain zero or more strings. I wonder ...
1
vote
2answers
428 views

Security: writing to a file from MySQL CLI

I was testing writes to a file from MySQL CLI (locally & remotely) and I wonder what settings are preventing writes for remote users, basically I would like to make sure that it's set on all ...
2
votes
2answers
187 views

MySQL #1064 error on line 2 [closed]

I'm quite new on learning SQL and I seem to be running into an issue with the following code: CREATE TABLE `read` (`order` NOT NULL UNIQUE AUTO_INCREMENT, `title` VARCHAR(50) NOT NULL, `url` ...
0
votes
0answers
287 views

setup mysql row-based-replication without downtime?

Is it possible to use setup rbr on a mysql server (current version happens to be 5.5.31) to a slave without incurring downtime? (and if "yes", how?) My thought is first to configure the master and ...
-1
votes
1answer
290 views

Query mysql database through memcache

I have been trying to use memcache with MySQL 5.6 but I can not figure out how to do this. I have add an entry into innodb_memcache.containers so I can query the database through memcache. What I ...
-1
votes
1answer
169 views

MySQL Migration from Slave to Master

I recently had a problem with our server. It required us to install a new hard drive, cpanel, and setup the old hard drive as a slave. How can I migrate the mysql database from the slave drive to the ...
2
votes
1answer
203 views

Changed root password from '<blank>' to '<password>'. Now cannot connect to databases in Cloud SQL prompt

I changed the root password using Google APIs SQL Prompt from blank to using: UPDATE mysql.user SET password = PASSWORD('<password>') WHERE user = 'root'; It has been documented here that ...
2
votes
3answers
1k views

index mysql concatenated columns

I have a table for author names with two fields, first_name & last_name, both varchar(55), both nullable (for crazy business logic reasons) although in reality last_name is unlikely to ever be ...
4
votes
1answer
11k views

MySQL: Row size too large (> 8126)

I have a table which has 300 columns in it. Each column is up to 255 bytes (there IS a business justification for this). When I try it create it using VARCHAR(255), I go past the limit for the ...
2
votes
2answers
2k views

Two primary keys to one foreign key

racing_couple ID (PRIMARY) breeding_couple ID (PRIMARY) egg IDpar(FOREIGN KEY) I have 2 IDs from 2 different tables (racing_couple and breeding_couple) and they are primary keys. In 3. table (egg) ...
3
votes
1answer
183 views

What if I want to keep using MyISAM

In my current use of MyISAM the databases are extremely small and kept for a few weeks after which time they are deleted and completely rebuilt with a clean slate. The script uses MYISAM tables and ...
-1
votes
1answer
2k views

mysql tried to restart itself 3 or more times, but it failed finally

it happended the second time, could be the same reason cause it. mysql tried to restart itself 3 or more times, but it failed finally. here is mysql log 130706 09:43:27 mysqld_safe Number of ...
1
vote
1answer
833 views

Cannot change root access in MySQL to %

This is a new MySQL Server install. I created my root password as part of the setup (on Centos 6.4). When I connect to the server through a terminal, I can connect to MySQL and issue commands, using ...
0
votes
2answers
487 views

MySQL database datafiles in windows SystemData directory

When I create a database and some tables in MySQL Server, it makes some data files in Windows SystemData directory in C:\ProgramData\MySQL\MySQL Server 5.5\data\mydb\. Each table has three files with ...
2
votes
1answer
726 views

List of variable defaults for InnoDB engine

I would like to list the defaults for the global variables that are innodb specific. The problem is that the following commands doesn't list any innodb variables: /usr/sbin/mysqld --no-defaults ...
2
votes
1answer
2k views

pt-table-checksum - Diffs cannot be detected because no slaves were found (1)

I'm new to Percona tools. I am trying to use pt-table-checksum as follows: pt-table-checksum h=localhost -u root -p xyz--replicate=percona.checksums --create-replicate-table --databases=mysql But ...
1
vote
1answer
499 views

MySQL: COLLATE performance

I have a table called users with a column firstname and with collation utf8_bin I want to know what happens under the hood when I execute an query like: SELECT * FROM `users` `a` WHERE ...
-2
votes
1answer
625 views

MySQL Incremental Backup (cron job): “sh: mysqlbackup: command not found” [closed]

I want to run cron job Mysql Incremental backup, Can any one pls help me. I tried: $command = "mysqldump-h $dbhost -u $dbuser -p$dbpass ". $dbname." > $backup_file 2>&1"; ...
2
votes
1answer
477 views

InnoDB forum DB design and Composite Primary Key (Cluster Primary Key)

I am designing forum database using InnoDB and got few questions , Could any one please help me to clarify them? Posts and Comments table design below CREATE TABLE `my_posts` ( `forum_id` ...
-5
votes
0answers
66 views

Website is working very slowly [closed]

We have replication from Oracle to MySQL via Oracle Golden Gate. Yesterday because of some issues we have rebuilt the replication from Oracle to MySQL (this is called opal replication). Now our ...
1
vote
1answer
120 views

InnoDB query duration inconsistent

I am running a series of UPDATE commands on a nearly empty InnoDB table, and around 1 out of every 20-30 queries will inexplicably take 10 times as long as the others. For example, the first 20 ...
-8
votes
1answer
9k views

Using inner join to get data from multiple tables [closed]

I have 5 tables: A (a_id, a1, a2) B (b_id, b1, b2, a_id) C (c_id, c1, c2, b_id) D (d_id, d1, b_id) E (e_id, e1, e2, d_id) Here is some information table b have a_id match with table a (a_id). ...
2
votes
2answers
1k views

any documentation on tpcc-mysql benchmark tool

Where can I find tpcc-mysql documentation? I google it but I can't find any documentation about it.
4
votes
1answer
503 views

Splitting a table based on enum value

I am re-designing our company database, and am wondering whether or not to split this table up into two (or even three) different tables based on the type field. Prospects can become clients, and in ...
2
votes
1answer
293 views

MySQL Performance Gains By Splitting Tables?

I am designing a database schema to be used with MySQL. The database needs to keep track of a users basket items and purchased items. I've thought about two ways I could do this but not sure which ...
1
vote
1answer
1k views

Unknown storage engine 'XtraDB'

I installed Percona Server 5.6.12-rc60.4, when I want create table such as : CREATE TABLE IF NOT EXISTS `mydb`.`table` ( `id` INT NOT NULL AUTO_INCREMENT , `title` VARCHAR( 64 ) NOT NULL , PRIMARY ...
3
votes
1answer
2k views

What is log sequence number ? How it is used in MySQL?

Can anybody give an example or scenario of log sequence number(LSN) used in MySQL
3
votes
2answers
4k views

Allow SELECT on specific column only

I have a User table with 3 column; name, email, password, etc. I would like to create another user that can only SELECT the name column. SELECT name FROM User; -- Ok! SELECT email FROM ...