MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
33 views

Unknown column in a table [closed]

Create schema Nevy; create table sailor ( sid INT(5) NOT NULL, sname Varchar(20) NOT NULL, rating INT(5) NOT NULL, age INT(5) Not NULL, primary key (sid)); Create table reserve ( sid ...
0
votes
1answer
37 views

MySQL: How to write a recursive function to show menu tree?

I try to build a menu tree inside the SQL with this function: DROP FUNCTION IF EXISTS hello_world; DELIMITER $$ CREATE FUNCTION hello_world(_typeId INT, _typeText TEXT) RETURNS TEXT BEGIN ...
-7
votes
2answers
40 views

Want to create a table in these manner when i decribe it [closed]

I'd like to get the following query result: I think this is a Pivot table. The DDL for the table in question: create table yourtable ( user_id integer, user_meta_id integer, meta_name ...
0
votes
0answers
27 views

The Mysql database vanished and there is no more user

I have an ubuntu production server running Mysql, i changed the datadir to this : user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock ...
0
votes
0answers
14 views

Get values from comboboxes and put in on the <select> forms [migrated]

Here's my interface. That is when I choose from the Attributes Comboboxes, the values will be listed on the forms From Database 1 and From Database 2.
1
vote
1answer
56 views

Cant get rid of filesort in simple query

I have two tables. One for texts and one to assign those texts to categories. I want to select texts of one specific category and order them by last change date. So, I am using this query: SELECT ...
0
votes
1answer
15 views

How do i specify a type for a new column through a select statement

I'm trying to create a new view from an existing table which as 2 columns: CREATE TABLE writers ( movie_id integer NOT NULL REFERENCES movies, person_id integer NOT NULL REFERENCES people, ...
0
votes
2answers
41 views

Grouping rows by looking at two columns without considering the order and summing each separately

I have a table looks like this one below: +---------+---------+-------+ | SOURCE | DEST | VALUE | +---------+---------+-------+ | A | B | 1 | | B | A | 2 | | A ...
0
votes
1answer
38 views

MySQL distinct string

I have the following sample table. drop table if exists fruit; create table fruit ( id int not null auto_increment primary key, tag varchar(100) not null ); insert into fruit (tag) ...
0
votes
0answers
28 views

MySQL count similar words in strings

I have the following sample table. drop table if exists fruit; create table fruit ( id int not null auto_increment primary key, tag varchar(20) not null ); insert into fruit (tag) ...
0
votes
0answers
22 views

How to convert a MySQL database from utf8mb4 to utf8?

I would like to convert a MySQL database, which has utf8mb4 character set and utf8mb4_unicode_ci collation, to utf8 and utf8_unicode_ci. How to do that please? Thank you in advance for your ...
0
votes
2answers
34 views

wildcard expansion using sql

I've a table named permissions. CREATE TABLE `permissions` ( `id` int(11) NOT NULL AUTO_INCREMENT, `role_code` varchar(45) NOT NULL, `permission` varchar(100) NOT NULL, PRIMARY KEY (`id`) ) ...
0
votes
1answer
19 views

Multiple Selects With One Column Encrypted [duplicate]

I am trying to do two select statements on the same table. However I get errors. The reason for this query is one of the columns is 256 bit CRC encrypted. Here is my query: SELECT (select COLUMNA ...
1
vote
1answer
72 views

How much memory are used by perticular session during run time in MySQL 5.1 community version? [closed]

Is it possible to find out how much memory is used by particular session?A user was asked me how much memory is utilized by particular session running in MySQLl 5.1 community version server. Kindly ...
1
vote
2answers
159 views

Concatenate date and varchar

I am need to select the date stored in a column transactionDate datatype date and time stored in column transactionTime datatype varchar from a table transactionTable in mysql. My query is like ...
1
vote
0answers
17 views

PHPMyadmin transactions not commited [closed]

If I create a test table as the one below CREATE TABLE IF NOT EXISTS `TEST` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `NOTE` varchar(50) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB; and ...
2
votes
4answers
159 views

Getting Database Request Statistics on MySQL

Is there a possible way to query (or in anyway) get the number of requests (select, insert, update, delete, etc) that a specific schema is doing on a MySQL Database. The reason behind this is that ...
2
votes
1answer
38 views

Why can't I view the plan for view creation…?

mysql> EXPLAIN EXTENDED create algorithm =temptable view fisgen_temptable(inter,phone) as select intercom1,phone from fisgen where fid='f105'; I am getting an error like this: ERROR ...
0
votes
1answer
27 views

Does Percona Xtrabackup support RedHat release 4

I downloaded Percona's Xtrabackup rpm file for RedHAT. I attempted to install but hit into an error. The error seems to point to missing dependencies and libraries. I have no issue with RedHat 6 OS. I ...
0
votes
2answers
30 views

How can delete an orphaned temporary table on Mysql Innodb?

I was issuing an Alter table statement and suddenly the server crashed, Now i can not run any alter table to that table because it shows me the error 1050 and it says that a table named #sql1504d ...
0
votes
0answers
38 views

workbench failed to connect — ssh

What are the connection parameters? How do I confirm each value? Workbench error: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 I can easily ...
1
vote
2answers
25 views

Select row from one query where opposites are not present in second query

Hopefully this explanation will clear up what the question is asking for ... I have 2 tables (I'll populate them a little too): inbox ---------------|----------------- | to_USER_id | MESSAGE_id ...
1
vote
1answer
49 views

How to optimize a table/db with 200 insert/sec

I'm facing a very hard problem. I have a mysql DB (MyISAM) with a main table (user) where I write a row for every new user (around 10 fields). Every INSERT triggers around 10 new INSERT in 10 ...
0
votes
0answers
14 views

Creating mysql config setting per database

I am trying to setup MySQL so one database auto increments by 2. I am using the auto_increment_increment variable in my.cnf configuration file, but this is being applied to every database. I would ...
1
vote
1answer
43 views

Concurrency when simulating autoincrement with triggers on MySQL

I am updating an old application to implement virtual tenancy, which involves adding a tenant_id column to the primary key of every single table. The application uses auto-incrementing columns ...
0
votes
1answer
27 views

What is less time costly?

I'm migrating a database from DB2 to MySQL. There are big tables, so it takes a huge amount of time. The question here is: If there's a table with about 9 millions of records with InnoDB storage ...
1
vote
1answer
20 views

Acceptable to use Antelope and Barracuda simultaneously?

I've been doing some reading about the Antelope and Barracuda file formats for InnoDB. I recall at least one source mentioning that the two should not be used simultaneously. I can't think of a good ...
0
votes
1answer
28 views

mySQL running on 100% CPU both on RDS and EC2

How do we troubleshoot an issue with Amazon wherein my database queries (PHP/MySQL) are eating 100% CPU most of the day? Traffic=200 connections average mySQL version = 5.5.40 The ...
1
vote
2answers
27 views

Master/Slave desyncronisation

Some manual operations (writes) have been made on SLAVE instead of MASTER resulting in the replication being stopped. Could not execute Delete_rows_v1 event on table xxx.newsletter; Can't find ...
0
votes
0answers
27 views

mysql eating RAM without queries?

Somehow MySQL eats up 50% of my RAM on the server being used. I checked and there are no queries, show full processlist is empty. I restarted the mysqld and within a couple of minutes the RAM usage ...
0
votes
0answers
7 views

What does “Latest Restore Time” says in AWS RDS(Mysql) instances page

I have two RDS mysql instances and when I look at the instances page, I have seen a field named "Latest Restore Time" and the value for it is some time stamp in IST time zone. I would like to know ...
2
votes
1answer
41 views

Is it possible to create a foreign key with a condition?

I have a table site that has a field categoryid_root and a table category which has the fields id and parentid I want to create a relationship between: site.categoryid_root and category.id but with ...
1
vote
1answer
32 views

mysqldump doesn't restore database. why not?

Why doesn't my restore operation work? I created a dumpfile for a database using: mysqldump -u root -p databasename > /home/databasename_bkup.sql I then opened the dumfile and confirmed ...
1
vote
0answers
19 views

Calculate row value based on previous and actual row values [duplicate]

Hi everyone and thanks for your help. I have the following situation: a table called statements that contains fields id(int), stmnt_date(date), debit(double), credit(double) and balance(double) I ...
1
vote
3answers
53 views

Calculate row value based on previous and actual row values

Hi everyone and thanks for your help. I have the following situation: a table called statements that contains fields id(int), stmnt_date(date), debit(double), credit(double) and balance(double) I ...
0
votes
0answers
17 views

Problem moving database to new server

I am currently running into two problems. First, when viewing tables using MySQL Query Browser, it keeps displaying "Could not fetch columns". Second, when attempting to go in an edit any of the ...
1
vote
1answer
23 views

MySQL Replication/Backup

I'm a new DBA working with a MySQL(5.6.19) instance I have running on a Mac Pro, I'd like to back it up with the Percona tools, but there isn't a distro for Mac, so my plan is to create a copy of the ...
0
votes
2answers
45 views

What is more efficient: text(765) or varchar(765) to store a freeform searchable description?

EDIT : To paraphrase quesiton - at what point do I switch from varchar to text and back? A little background on the question. Let's say we have sales_orders table and we want to be able to keep a ...
1
vote
2answers
53 views

join table or cte

First off, I've tried to find a suitable solution on the internet, but I really didn't find one that worked for me. What seems to be my problem? Well... At my new job we use MySQL. I'm used to ...
0
votes
1answer
18 views

Will a static MySQL database become bigger in file size over time, even without anyone writing to it?

I backed up a database a few weeks ago, then for comparison downloaded it again. It was about 10,000 kB larger. There should not be anyone writing to it, but there are lots of reads. Will a static ...
0
votes
1answer
74 views

Table Design for Student Attendance hourly for each day

I have created a table(attendance_details) for storing every day attendance of Students in MySQL. Need to capture attendance for hourly(1-8hrs) for every day. I have the student details in separate ...
1
vote
1answer
51 views

What is InnoDB Buffer Usage and how to clear it?

In Mysql Workbench when I go in Server > Server Status there is a field called "InnoDB Buffer Usage" It is "95%" even if there is no query running. Why? It affects my performance in my new queries? ...
3
votes
0answers
40 views

How to get the best write throughput during a MySQL import with Amazon RDS?

tl;dr - How can we get the maximum EBS throughput for a db.r3.2xlarge instance? We're only seeing about half of what it can supposedly do. Apologies for the long length of this question. We've had ...
1
vote
1answer
30 views

Delete Duplicates Leaving One of Two Identical Records [closed]

Delete Duplicates Leaving One of Two Identical Records One of my MySQL database tables contains four BLObs in each row. When it was first set up the table had no keys. However when I now try to add a ...
2
votes
1answer
30 views

How should a numeric value that is an external key be stored?

This is something I was pondering recently. trying to determine how to store certain values. The best wide spread example I can think of is Federal Employee Identification Number - more commonly knows ...
0
votes
1answer
27 views

How to select only the first distinct value in a column, but have blanks in that column in the other rows otherwise

Is there any way that I can turn a table like this with a query like SELECT name,child from People |----------------------| | name | child | | John | Jack | | John | Jerry ...
0
votes
0answers
15 views

Replication broken after copying .frm .myd .myi files

I copied .frm .myd .myi files for MyISAM tables from old_prod server to new_prod. Then I did a mysqlcheck on DB and repair tables whenever necessary. All is good for MyISAM tables in the new_prod. ...
0
votes
1answer
35 views

Help converting a MySQL query to postgres

Is it possible to do this query in postgresql? SET @p:= 0; UPDATE t SET x=CEIL((@p:= @p + 1) / $n) ORDER BY id DESC; I'm struggling with the variable syntax. I tried: \set p 0 update t set ...
3
votes
0answers
49 views

Is it a waste to set innodb_buffer_pool_instances greater than the # of CPUs?

I set the innodb_buffer_pool_size to 20GB on a server with 12 CPU cores. My full database is 11gb, however most of it is archived tables that are almost never used. The total queried data is around 3 ...
4
votes
3answers
176 views

How to detect inactive tables?

I started working on a project whose former developer ragequited, and it left a complete mess both in the code and database. The server is using MySQL 5.5 There are a lot of tables created for backup ...