MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
7 views

Pagination, check number of selected records

I am working on pagination for a complex join query and unfortunately I am not sure what's the best way to go... Right now I am thinking about the following solution. Imagine that SELECT id... is the ...
1
vote
1answer
16 views

Grant permissions on views, deny select on tables

I have a MySQL user and I want it to view ONLY the views I want and not any other table in the database. I've granted this user permissions only on certain views as following: GRANT SHOW VIEW ON ...
0
votes
1answer
14 views

Best way to create materialized view in mysql

I am using mysql 5.6, I am not being able to create materialized view here like oracle. I got one or two solution like flexview and all... Can anybody tell me best way to create materialized view in ...
0
votes
1answer
11 views

Converting Heap to MyISAM issue

At work we have a problem that has now occurred more then once. Problem is that query is in state of converting HEAP to MyISAM and it paralyzes our server( query in this state is not able to kill ...
-3
votes
0answers
40 views

SELECT returning NULL always

I have small MySQL database with table called user_information. The columns in that table are: uid, firstname, lastname,age,gender and mail. I want to get all information about user with ID.So the ...
0
votes
0answers
14 views

Mysql error code 1452

I'm trying to create a database that will keep information about users. Here is the strucure; I have 3 tables 1. is the users which keeps uid and login info(username and password) 2. is the ...
0
votes
1answer
6 views

Mysql Master-Master Replication Error

Configured Master-Master Replication But both servers slave shows the below error !! Last_IO_Errno: 1236 Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ...
0
votes
1answer
26 views

How to update a huge MySQL table from a text file

I have a huge MySQL table with 1.3 TB data with InnoDB engine format. Now I have a text file containing updated values of 2.2 GB of records in the 1.3 TB of data. How do I proceed ? I am a newbie ...
0
votes
0answers
10 views

JDBC4/SQL or Hibernate/ORM?

I have an upcoming thesis project that may be used by the school itself if the system proves to be good. It is a web application (Struts2) for an Online Teacher's Performance Evaluation System. The ...
0
votes
1answer
21 views

optimizing a select query of 1.5 million entry

I have the following query: SELECT s0_.id, s0_.lowresimageurl FROM app_instagram_shop_picture s0_ FORCE INDEX ( idx_deleted_shopId ) LEFT JOIN app_instagram_shop s1_ ON s0_.shop_id = s1_.id AND ( ...
0
votes
0answers
9 views

Inserting a lot of big numbers into a mysql database

The tutorials online about inserting images and other binary data into a database have you put it in a character buffer and use mysql_real_escape_string() on it. The thing is, characters are 1 byte. ...
0
votes
0answers
7 views

How can I update the amount on parentid

I'm using MySQL database,This is the first time that i handle this kind of project the Multi-Level Marketing.I am having problem in updating the amount of parentid if he gets paired means he has left ...
0
votes
0answers
8 views

Best mysql database structure for this data

I need to create a MySQL database that can store the following data for many users: General settings (for each user) 10 url's. 10 words of 20 letters for. ...and more fields like these. Sentences ...
2
votes
1answer
30 views

Sorting by two columns conditionally

Column a has category ids, column b has set orders: +-------------+-----------+ | category_id | set_order | +-------------+-----------+ | 80 | null | | 81 | null | | ...
-1
votes
1answer
19 views

Problem in adding foreign key

I'm having an error while adding a foreign key constrain to my database. In my database, I'm having a table named user, student, staff, complaint and review. The table user contains fields such as ...
1
vote
1answer
30 views

database design for simple comment

I have a following given scenario. A user can have zero or more item. A user can comment on the item. (Just simple comment listing with name of people who comment, no need hierarchical structure for ...
0
votes
2answers
11 views

SQL Query Help to get Quiz statistics

I'm coding a quiz web application and i need help. I've got three tables Nicknames : |USER_ID|NICKNAME| that stores USER_ID(auto increment) and NICKNAME registered to my system. Questions : ...
1
vote
0answers
22 views

MySQL column type to boost performance

I'll have a table where: userid (link to user's id in users table) foldername (a varchar, max. 260 char) entry (varchar, max. 1024) data (varchar, max. 20kb) Single user will have several ...
0
votes
0answers
13 views

Optimal Table Index for hourly data

I have a table that contains ~40,000,000 records and consisting of the following fields: idName - foreign key relationship to another table Date Hour Type (two possible types) Value Currently I ...
0
votes
1answer
39 views

MySQL dump - how to order tables?

It seems that mysqldump dumps tables in sequential order - using the same order tables are shown when running: show tables; I would like to reverse that order - is it possible to do without getting ...
0
votes
0answers
13 views

Insert data from a table and with parameters

I have 2 tables, one feeds data for 2 others but I must add external value too Is this query does the job ? MySqlCommand cmd1 = new MySqlCommand("INSERT INTO tableA (dt1, dt2) SELECT (dt1, dt2) FROM ...
0
votes
1answer
16 views

using foreign key as primary key

MySQL: If I have a user table and multiple other tables like seller, buyer etc, is it okay to use user_id foreign key as primary key inside tables like seller, buyer? That'll leave gaps in primary ...
0
votes
1answer
17 views

Why storing product fees in another table is preferred?

MySql: What is the benefit of storing several types of fees in another table like Product Table -> (productid...), ProductFee Table -> (productid, feetypeid, feeamount), ProductFeeType -> ...
2
votes
2answers
34 views

When is it safe to disable InnoDB doublewrite buffering?

MySQL InnoDB allows us to disable doublewrite buffering by setting innodb_doublewrite = 0. Other databases doesn't seem to allow this setting to be tweaked. How could InnoDB still be able to maintain ...
7
votes
2answers
573 views

Why do we use Group by 1 and Group by 1,2,3 in SQL query?

In SQL queries, we do use Group by clause to apply aggregate functions. But what is the purpose behind using numeric value instead of column name with Group by clause? For example: Group by 1.
0
votes
0answers
16 views

Advice on MYSQL DELETE on CASCADE, UPDATE on CASCADE features

I have 2 tables called copyrigihtinfo and sourceinfo and many to many to relationship table cp_src_junction with following data. copyrightinfo table cp_pk cp_info 1 copyright (c) 1991-2000, ...
0
votes
2answers
14 views

How can I make MySQL client read password from mylogin.cnf?

I'm trying to make the mysql client connect to a mysql server without requiring the password to be given interactively. Steps taken: 1) First create a mylogin.cnf file $ mysql_config_editor set ...
0
votes
0answers
20 views

Stored Procedure Issue in Simple Select Statement

Here is my Fiddle Here is My Table : CREATE TABLE IF NOT EXISTS `vehicle` ( `AutoID` int(11) NOT NULL AUTO_INCREMENT, `VehicleCode` varchar(20) NOT NULL, `NumberSeats` int(3) NOT NULL, ...
0
votes
1answer
23 views

Can we protect data form Database Administrator by encrypting the data?

How can we protect data on my database which is MySQL form database administrator stealing it? Will encrypting it prevent it from being stolen? If yes, how as he already has access to the database ...
0
votes
0answers
17 views

Large text column slows down whole table

I have a mysql database table table1 with a dozen columns in it. One column is a mediumtext column with lots of data in it and all the other columns are small (ints, timestamps, etc.). The presence ...
0
votes
0answers
13 views

In Forward Engineering I have an error called 'table does not exist'

This is my forward engineering code. -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, ...
0
votes
1answer
11 views

odbc connection from windows machine to mysql server running on ubuntu?

I was able to install mysql server on an ubuntu machine and set up a test data base, created a user and granted that user access to the database. I also changed the binding address to the IP of the ...
0
votes
1answer
13 views

storing query results in a variable in mysql and using it in another query

I have a following query which runs perfectly fine: SELECT count(*) as total,l.state as state FROM db1.table1 cd inner join db2.table2 l ON ...
-1
votes
0answers
13 views

Cannot open ssh tunne on MySQL [on hold]

I got this error on this configuration Any Clue? Please Help!
0
votes
0answers
5 views

Can MySQL Index Merge an Composite index with a single column index?

I am tuning a query and currently have an index as following : Index 1 : (col1, col2) An example query would be : SELECT * FROM t1 WHERE col1 = '1' AND col3 = '2'; I have created an index on ...
0
votes
1answer
12 views

Update Trigger in MYSQL

Here is my requirement :- I have a table called "users" and field called "Admin". Field "id" is primary key. Wants to update "Admin" field to "1" if id=1000; Tried this ,but not working.I tried ...
2
votes
0answers
24 views

How to store a 64-digit key of alpha numerical values into MySQL Database

I am student studying in Database Administration (first year), one of our task requires a to design a login form for corporate and regular users. Below are the requirements for the username and ...
0
votes
1answer
18 views

Processlist show most of the queries are sending data for select query

I have faced some problem like sending data state in processlist. In my application I used parallel processing which send 50 count at a time, and that will do some MySQL database operation (select and ...
0
votes
0answers
16 views

Slow Query Performance - Can't Debug

I have a MySQL query that I am trying to debug the performance issue but cannot. I know that the majority of the query is reading/processing rows (Sending Data state). However, in the explain output, ...
1
vote
1answer
21 views

Is it possible: MySQL semisync and async replication on same master-slave pair?

I want to use master-slave MySQL (or MariaDB) replication to remote server as data protection from hardware failures. I have two goals: to keep low response time and don't lose important data. Good ...
0
votes
1answer
21 views

Relationship issue

I'm working on a ERD with mysql workbench, and i have a little question. I have a Database with this tables: company_address country state city I want to store the address of the company with all ...
0
votes
0answers
10 views

SSMA mysql double to sqlserver decimal, decimals getting cut off

I have a field that is a (signed) double in mysql, and I want it to be a decimal(18,4) in sqlserver. I have changed the Type Mapping for Source Types double and double precision to decimal[18][4] in ...
0
votes
1answer
20 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. ...
0
votes
1answer
51 views

Optimizing intersect query in MySQL

I'm facing a performances problem in our MariaDB server. We have a table linking users to pages, a user belongs to 1+ pages. I have a page that have users and I want to get the 10 best pages based ...
0
votes
1answer
13 views

MySQL audit storing application user ID

I am trying to set up auditing for changes to data in MySQL tables, for my Perl web application on Linux. I've had a look at this: ...
1
vote
2answers
23 views

MySQL returns floats rounded

> CREATE TABLE test(foo FLOAT); > INSERT INTO test VALUES(1.2899999); > SELECT * FROM test; +------+ | foo | +------+ | 1.29 | +------+ While it's obvious that FLOAT is not a precise data ...
1
vote
2answers
31 views

Optimal indexing for SELECT (mysql)

What indexes would you recommend for the following select (and why)? Keep in mind there can be tens of millions of rows. SELECT * FROM mytable WHERE md5 = ? AND created_at >= ? AND created_at ...
1
vote
1answer
22 views

trying to understand table size

Can somebody help explain the "data_length" of the table? Why is it so big in my example below of a table with just one column and one row? mysql> create table `network_type` ( `id` int(11) NOT ...
0
votes
1answer
21 views

MySQL 5.6 Datetime Range

According to MySQL 5.6 doc, the supported range for datetime data type is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. But when I tried inserting values that are earlier than '1000-01-01 00:00:00', ...
-5
votes
0answers
32 views

How much space does database takes to store twitter data? [on hold]

Context I am going to collect twitter-data(user,s followers, timestamp, content, url and Hashtags) weekly and it continues for an year. I have a total of 160 hash-tags, and I will be creating an ...