MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

0
votes
1answer
291 views

What is the error in this TRIGGER?

The MySQL version I'm using is 5.1.46. The query is CREATE DEFINER = CURRENT_USER TRIGGER `movimentacao_before_del_tr` BEFORE DELETE ON `movimentacao` FOR EACH ROW IF (OLD.stMov IN ("E", "C", ...
1
vote
2answers
405 views

Should master and slave have same mysql version?

I have a master database running mysql 5.5.11, and I am planning to setup a new slave. I am planning to use the 5.5.30 as it is the latest version. For setting up new slave, I am copying files from ...
3
votes
1answer
2k views

Update to session table slow

I have a number of websites with session tables on a web server, these are used by Joomla CMS and Symfony framework systems. With slow_query_log=0.6, the update queries for the session tables come up ...
2
votes
1answer
100 views

How does MySQL resolve schema information?

I’ve used MySQL on windows7. Recently my machine was infected by a virus. After that SHOW TABLES and SHOW DATABASES statements don’t show any tables and databases but I can see data from tables ...
2
votes
2answers
377 views

How does mysqldump take place when there are more than one database?

I'm writing a shell script wherein I'm doing a mysqldump of all databases. My questions are: Are the tables of all databases in the server locked during the mysqldump? If I have to do an ...
4
votes
2answers
735 views

How to sort category by path and sort order?

first of all I am sory for my english. My category structure is shown below. My purpose is to get category structure with single query. I sort my table by path and I get category tree. sort_order : ...
2
votes
2answers
7k views

Mysql : Maximum number of connections on a per user basis - Possible?

Is it possible to set a maximum number of open connections that a user (NOT all users combined, just one specific user) may have at a given time in mysql? Eg: If I have a user "user1234", and want ...
1
vote
2answers
3k views

Modify all tables in a database with a single command

Is there a single or a one line command to modify all tables within a database. I would like to issue this command in every table within a database: ALTER TABLE `table_name` CONVERT TO CHARACTER SET ...
4
votes
1answer
13k views

MySQL stored procedure: loop through table, delete rows. Logic problem: won't exit loop because of LIMIT option in query

I've created a procedure to loop through large InnoDB tables and delete a chunk of rows, then pause and repeat until max field value allowed is reached. Binary logging is enabled, but I'm leaving it ...
4
votes
4answers
408 views

Database design for voting module with long-run and high-load capability

I'm currently designing a project and I need professional advice from DBA. My project will feature voting system somewhat similar to the one used in stack exchage websites. I have users and content ...
0
votes
3answers
1k views

Mysql optimization help

I've tried optimizing mysql as good as I could, but apparently I'm not to good at it :-) So I come to you guys for help. Server specs are: AMD Opteron CPU 8 cores 16 GB RAM 2x2.000 GB HDD 7.200 RPM ...
2
votes
3answers
3k views

How to retrieve master log position and master log file in shell script

I'm writing a shell script for point in time recovery for MySQL database.For the below statement I need to specify the start position and end position of a log file. mysqlbinlog ...
3
votes
2answers
8k views

Finding and fixing InnoDB index corruption

I encountered a new issue yesterday with one of my MySQL 5.5 slave DBs that runs on EC2 in AWS. The DB was created from a snapshot of another slave. The data is correct, but for at least one table a ...
0
votes
2answers
2k views

Does MYSQL join before LIMIT?

Imagine that I want to populate the last 10 questions of stackoverflow. I have a table that keep the questions list, a table to keep the question info, a table to list question's asker. Now imagine ...
2
votes
1answer
184 views

How can I programmatically grant (and revoke) temporary database access in MySQL?

Suppose I have a datastore comprising many databases. For the purposes of this question, let's assume MySQL, but I suspect it might apply to many technologies. The stored records aren't particularly ...
1
vote
1answer
190 views

How can I select the OS User in MySQL?

I need to select the OS user during trigger execution to insert into a table. How can I select the OS User as it may be different from the MySQL user?
2
votes
1answer
2k views

How to choose a good value for MySQL relay-log-space-limit?

I just read this blog post about relay-log-space-limit on MySQL. I am convinced that the 'unlimited' default is indeed not very good. But how do I choose a good value for it? We are using ...
1
vote
1answer
81 views

Why is this query so slow?

I have a quiz site with approx 2000 questions. The function in question worked great when I wasn't tracking that many users, but now there are 300,000 question that users have seen. The function only ...
4
votes
1answer
624 views

Is it possible to use the same directory for 2 MySQL servers?

I have 2 OS-es on my machine: Windows XP and Linux Slackware. Both of them have mysql installed: Windows - 5.5.25 Linux - 5.5.27 Is it possible to use the data directory from Windows on Linux? So ...
1
vote
1answer
437 views

SQL Schema for XBRL Document storage [closed]

Does anybody know of a relational database schema that can be used to store XBRL data? I am looking to store financial report data (balance sheet, income statement and profit/loss statement data) ...
2
votes
1answer
44 views

Is it possible to issue an INSERT / UPDATE / DELETE and specify for it not to be relayed to attached slaves in mysql?

Just as the topic states. Is it possible to issue an INSERT / UPDATE / DELETE and specify for it not to be relayed to attached slaves in mysql?
0
votes
0answers
360 views

How to do point in time recovery of binary log files into .sql file

I have written a shell script to do an incremental backup of MySQL database. For point in time recovery I'm using the binary logs generated in /var/lib/mysql directory. For point-in-time recovery, Im ...
0
votes
1answer
2k views

How to apply patches in MySQL in any version

How to apply patches in MySQL 5.1.67 or any version. because we need to fix so many bugs in our version without any upgrading. please suggest me .
0
votes
1answer
2k views

mysql closing tables taking double the time of process

I have a delete query that is taking a long time. When I check in processlist that status is showing as closing table. It is taking a long time to close tables. ex: I run a query and the total time ...
0
votes
1answer
238 views

mysqldump including deleted rows [closed]

I'm trying to move a database from a Windows2003Server with mysql 5.0.27-community-nt to a new server with CenTOS. When using mysqldump on the database on the windows server, one table (i haven't ...
2
votes
1answer
608 views

Mysql: disable unused schemas

I have many schemas on mysql instance running on my development pc. I've noticed that mysql is taking a large amount of ram and cpu time. Is there a way to "disable" schemas of project I'm not ...
12
votes
3answers
3k views

Why don't my .my.cnf settings work?

I have a .my.cnf file in my home directory on my desktop that includes: [dbid] user = myusername password = mypassword database = dbname host = server.location.com If I recall correctly, before ...
3
votes
1answer
359 views

Is it possible to check all constraints in a MySQL database?

MySQL offers the ability to temporarily disable the foreign key checks, thus allowing inconsistent data to enter the database. Is it possible to check an entire MySQL database, table by table, row by ...
2
votes
2answers
782 views

Need help in restore some rows into mySQL database frm myd myi

I am using one mySQL database for several sections of the website and one of the section is not working, when I go to the link of that section it gives the error "1146 Error @ Line 39: Table ...
2
votes
1answer
2k views

Storing IPv4 and IPv6 hosts and networks

I have to store the IPv4/v6 address and networks(CIDR notation) in a MySQL database. Unfortunately, I am constrained to use Mysql. So, I'm looking for the equivalent of the inet type of PostgreSql. ...
1
vote
0answers
221 views

mysql update unique values from 2 different tables based on 2 index fields

i have 2 tables with the same unique id. i want to change table1 unique_id sequence from (1-100) to random 8 digit ids (43342359 - 83083224) and cascade that to table2. what i have: - table1 id1 ...
1
vote
1answer
175 views

MySQL Scheduled Event and server offline?

I have an event planned to run a 00:00. But the server won't be online at that point, seeing it's a local development server. Will it run the next time the server is online, or will it just be ...
2
votes
0answers
708 views

MySQL: Improve performance for one row insert into table with unique constraint

I have a table with ~ 40 mil records, with a unique index on the url collumn, of type varchar(255). Now the insert speed is about 30/s, is this expected? how could I improve it? I can't use bulk ...
1
vote
1answer
427 views

Does MySQL's MyISAM use cache before insert?

I want to test two different Disks, one of them is HDD and another is SSD I use exactly same information and app for both servers. They are exactly same, just one of them is SSD and another is HARD. ...
3
votes
1answer
74 views

How to efficiently hit an index in a query that uses IN (mysql)

I have a table like this where people can subscribe to certain feeds and the query fetches from the subscription. Here is a sample table: ...
0
votes
1answer
683 views

Optimising MySQL query with lots of self-joins

I have an entity_relationship table that describes relationships between entities. Each relationship will have 2+ entities involved. In some cases it can be said that one entity is a constituent of a ...
1
vote
1answer
1k views

MySQL INSERTs waiting for UPDATEs (MyISAM)?

In show processlist;, MySQL 5.5, we see that INSERTs tend to wait for UPDATEs to complete before they can proceed. This is on MyISAM tables. We tried INSERT HIGH_PRIORITY and UPDATE LOW_PRIORITY. ...
2
votes
2answers
821 views

MySQL Workbench Loses Saved Connections

I've been using MySQL Workbench as my go-to management application for quite some time. However, recently (namely, in my most recent install), it will every so often lose the saved connections I've ...
2
votes
1answer
1k views

Insert Value based on One Column based on Value on another Column

I just tried to set _timeStamp column to store value on the basis of HOUR of _date column and tried to create table as like below but encounter 1064 error. I'm new to mysql so help me in figuring out ...
2
votes
2answers
515 views

How to design future proof tables?

I am new to database design and have started developing my first schema. Some of my tables (e.g. user_profile) I am struggling to come up with an exhaustive list of fields for the table. A particular ...
0
votes
0answers
53 views

Phpmy admin not showing my table but mysqldump

I have a db running and suddenly when I go into my phpmyadmin under the db it shows no tables and when I tried to do dump it shows me some of my tables are crash. What is best survival in this case?
0
votes
1answer
314 views

Create a VIEW that spans 3 tables

Sorry if the title is not clear - feel free to improve. Here are 3 tables (not all data is relevant to the question): CREATE TABLE `content` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, ...
2
votes
1answer
204 views

Query results in a strange explain output

So I have a medium sized query that hits 15 tables. The query takes 36 sec on MySQL to complete. I ran EXPLAIN on the query and one of the tables returned this. '1', 'SIMPLE', 'mount_adapters', ...
3
votes
1answer
1k views

MySQL 5.5.8 InnoDB Foreign Key, JOIN performance

We are using aws/rds, MySQL 5.5.8. all InnoDB. For performance purposes, we have merged some data-elements into varchar fields; mini-sized int and date type fields; added covering indexes; ...
0
votes
1answer
66 views

Check for records that break a foreign constraint (created with foreign_key_checks = 0)?

Is there an easy way to check for any records in a table that breaks any constraint? The constraint was created on a populated table using "foreign_key_checks=0".
1
vote
1answer
511 views

Does replication with SSL encryption work on MySQL 5.5?

I am trying to set up replication with slave on Amazon EC2 and master in our local environment. The setup went fine without SSL encryption. But when I set up the replication to be SSL encrypted, it is ...
1
vote
1answer
2k views

while restoring mysql database, views changed into tables

I have a full database dump and i restored it. But in my new restored server all the views are appeared as MyISAM tables. In early times dumps were restored perfectly. can anyone help me to trigger ...
0
votes
1answer
307 views

Why number of matches in fulltext search get less when we put less strings?

SELECT * FROM tableauxiliary WHERE MATCH (FullTextSearch) AGAINST ('resta*' IN NATURAL LANGUAGE MODE) show 5 results SELECT * FROM tableauxiliary WHERE MATCH (FullTextSearch) AGAINST ('restaurant*' ...
0
votes
1answer
7k views

Adding a user to MySQL with 'name'@'%' fails with ERROR 1396

I just tried to add a new user to MySQL using CREATE USER 'name'@'%' IDENTIFIED BY '...' However, it fails with the following error: ERROR 1396 (HY000): Operation CREATE USER failed for ...
2
votes
1answer
133 views

index doesn't work properly

I have this query SELECT user_id, MAX( highscore ) AS highscore, stage, COUNT( * ) AS count FROM single GROUP BY user_id, stage table engine is innodb, plus I haven't use any indexes except one key ...