MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

2
votes
1answer
104 views

open mysql on os x backup disk image

I have several databases I set up using mamp. Recently, my mac died of old age and I got a new one. Fortunately I have a made of bootable backup of my hard drive every day. Unfortunately, I cannot ...
3
votes
1answer
955 views

mysql, changing tables from myisam to ndb

Gents, Converting a table from myisam to ndb via: ALTER TABLE piwik_log_profiling ENGINE NDBCLUSTER; This will fail with: BLOB column 'query' can't be used in key specification with the used ...
1
vote
2answers
2k views

Database table data transfer between different servers using bcp.exe and mysqldump

I have 2 servers, both are exact clones of another, one is PRODUCTION live use and the other is strictly for backend DATAENTRY. Using MSSQL on two different servers I am using the following command ...
1
vote
1answer
352 views

MySQL table locks solution -> InnoDb / Partitions

I'm experiencing many table locks in a MyISAM MySQL table that is pretty big (Constx10xGB and 15M rows). It's mainly caused due many heavy inserts. My current thoughts to optimize: Changing to ...
2
votes
2answers
706 views

Mysql database replication on different vlan/subnet/another site

Saw the posts for "MySQL high availability, failover and replication with Latency" Is it possible to work it in a DR site when its not in the same vlan?
1
vote
1answer
906 views

I am getting an error while trying to download binary for mysql 5.5.11

I am trying to upgrade MySQL 5.1 to 5.5.11 on Ubuntu 10.10. Everytime I try the wget command I get this error: wget ...
3
votes
2answers
1k views

Sub-query executes 1 time for a parent query or more?

If i apply a static data in where clause is it faster then applying a sub-query. Example: (The query returns 5 records as a result set) SELECT STARTDATE, ENDDATE FROM TEST WHERE STARTDATE = ...
0
votes
1answer
2k views

Unable to select the records from specific partition in mysql?

I've created a table using the following query, CREATE TABLE employees ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, fname VARCHAR(25) NOT NULL, lname VARCHAR(25) NOT NULL, store_id ...
6
votes
3answers
10k views

How to make multiple counts in one query?

I count records with queries like SELECT COUNT(col1) FROM table1 WHERE col1 LIKE '%something%' SELECT COUNT(col1) FROM table1 WHERE col1 LIKE '%another%' SELECT COUNT(col1) FROM table1 WHERE col1 ...
1
vote
1answer
821 views

Foreign key constraints failures

Given the following tables: CREATE TABLE `longdescs` ( `comment_id` int(11) NOT NULL AUTO_INCREMENT, `bug_id` mediumint(9) NOT NULL, `who` mediumint(9) NOT NULL, `bug_when` datetime NOT NULL, ...
2
votes
2answers
87 views

Calculate MSB on MySQL

Suppose I have Table A |-10| |-1 | |0 | |1 | |10 | |100| and take the most significant bit position of each value and import it into Table B, like so: |-4| |-1| |0 | |1 | |4 | |7 | How do we ...
1
vote
0answers
1k views

Tables don't exist after MySQL restart

I recently made changes to optimize performance for InnoDB engine-based DB and soon after when restarting I encounter into the following strange behavior: I have some tables with data in them I made ...
1
vote
1answer
130 views

Help Optimizing Query

For the following table structure in MySQL 5.1.49: CREATE TABLE `leads` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `institution_id` int(10) unsigned NOT NULL, `lender_id` int(10) unsigned ...
12
votes
1answer
17k views

INT(5) vs SMALLINT(5)

In MySQL table definitions is there a different between INT(5) and SMALLINT(5)? Or do they both represent the same size?
2
votes
2answers
548 views

MySQL - How much physical space will be reduced by changing the column type?

Lets say I have the following table: CREATE TABLE `my_table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `relationship_status` varchar(48) CHARACTER SET utf8 COLLATE ...
1
vote
1answer
175 views

Creating dump file with use command

I am taking backup of 2 tables from different schema. I need to create the "use dbname" statement at the beginning of each table. mysqldump --databases company --tables loadme --databases new_company ...
0
votes
1answer
376 views

How to set unique columns combination

see this table: CREATE TABLE IF NOT EXISTS `default_messages_users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `message_id` int(11) NOT NULL, `owner_user_id` int(11) NOT NULL, `to_user_id` ...
3
votes
2answers
5k views

MySQL: Loop over cursor results ends ahead of schedule

I'm executing a loop that iterates over a cursor's results. The code is inside a trigger function, and the part that matters looks like that: EDIT: Sorry, stupid mistake. The trigger is executed ...
5
votes
3answers
5k views

How database size affects performance: Theory vs reality

There is a lot out there that says database size should not affect performance to any great degree. As long as indexes on tables fit in memory the database should remain performant. However what is ...
0
votes
3answers
2k views

MySQL Triggers Different Database Different Server

I have two databases, each on a separate server. Each database has a number of similar but not identical tables. I need to combine the records from these similar tables into a new database, which is ...
6
votes
1answer
7k views

Deleting bin logs in replication environment

I have a question about deleting binary logs in the replication environment: We have an environment with 1 master and 2 slaves (running mysql 5.5). Sometimes, we run into a space issues during heavy ...
5
votes
3answers
6k views

Maximum table size for MySQL database server running on Windows (NTFS) Table type InnoDB

I need to design database to store information contained in millions of log files generated by devices on trial on network. I have designed 5 different tables to store log file information. But, as ...
1
vote
1answer
3k views

How to log logon logoff and user activity on mySQL server for audit?

My boss wants to have some kind of log on the server running mysql which would log user activity. Kind of like: User blah logged in User blah ran some query User blah logedd off User asdf ...
3
votes
1answer
984 views

How do I reindex a MYSQL table using a different disk?

I have my mysql data and index files on disk1 I need to reindex the table and do NOT have enough disk space on disk1 How do I reindex a table on disk1 and use disk2 for the reindex disk space? For ...
1
vote
2answers
368 views

MySQL standalone

I have installed MySQL 5.5.27 on my MAC using the binary installer. I am able to run the mysql server with /Library/StartupItems/MySQLCOM/MySQLCOM start. But I am not able to run the mysqld with ...
4
votes
1answer
344 views

Improve query performance with index

I am looking to create an index for a database to acheive better performance. I am using this query: SELECT DISTINCT t1.* FROM current_order AS t1 LEFT JOIN receipt AS t2 USING ...
5
votes
2answers
576 views

Large accounting table, best way to partitioning by two dates

I need to create a log table to stores the connections to out network (last 3 years, after that the log will go into backup). The hardware/software used is proprietary, and for accounting it just call ...
1
vote
1answer
213 views

Data storage in innodb

I am new to mysql administration and I came to know about the data storage in myisam is through .frm, .myd and .myi. I could not find the data storage mechanism in InnoDB rather than its storage in ...
3
votes
2answers
876 views

php/mysql database redesign and migration: changing databases to tables

I wrongly designed my application to have one database to each user. each user had 3 similar tables. I now want to have one database and 3 tables only; where i will use the database name in the old ...
2
votes
1answer
263 views

Are JOINs on non-indexed columns faster than sub-queries?

I know JOIN on indexed columns are faster than sub-queries in a query result. I am confused if : JOINs on non-indexed columns are also faster than sub-queries or not.
0
votes
1answer
426 views

Providing an ad-hoc report facility for business using in MySQL and PHP?

We are using MySQL 5.2 CE. We need to provide the business users a way to create their own ad-hoc report. Could you give a suggestion and an example, if this can de done using PHP?
4
votes
1answer
9k views

Show procedure code in MySQL

I've tried to show the SQL code of a stored procedure called add_pixel: mysql> SHOW PROCEDURE CODE add_pixel; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that ...
0
votes
1answer
650 views

mysql “Unsafe statement”

I get a lot of following messages Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table ...
5
votes
1answer
3k views

Best solution for cross-datacenter MySQL master-slave replication

We are working on a new system architecture for our company. We have a HPC, which runs in our own data-center and we are planning our front-end and a fallback system on Amazon Web Service. System ...
2
votes
2answers
1k views

Insert Into MySQL over linked server when a medium text is the last column breaks Int fields

I have a table with ID INT(16) StateName VARCHAR(50) Details MEDIUMTEXT When I do an insert over the linked server connection: Insert Into MySQL...tblState (ID, StateName, Details) Values ...
2
votes
2answers
578 views

MySQL Views Authorization

Questions: Is there a way, using SQL, to identify how many views are in the database per user? How can you authorize/deny users access to delete views created by another user?
2
votes
1answer
152 views

How to use MySQL Server 5.6 for GeoIP replication?

I have downloaded the new MySQL Community Server 5.6 and I dont quite understand how to use it properly for GeoIP based replication across 20 nodes. I want to have one central node, then three smaller ...
2
votes
1answer
531 views

MySQL proxy and SHOW PROCESSLIST query time

I have MySQL replication currently occurring between two masters bidirectionally, one in a data center locally, another over at Amazon EC2. Everything seems to function normally replication wise, no ...
2
votes
2answers
2k views

How do I replicate a MySql server's data without using mysqldump?

I've got a working server with a lot of data on it. I've built a new server that will be lots faster. Both are running x686 code on Debian Squeeze. A quick test using one of the tables shows that it ...
4
votes
1answer
77 views

Will these queries return the same results?

I have this simple query: SELECT friend_id FROM default_friend WHERE user_id = 1 And the results are below: +-----------+ | friend_id | +-----------+ | 2250 | | 4901 | | ...
0
votes
1answer
46 views

Does a numeric field always use the same disk space?

When you have a numeric field in MySQL(MYISAM) (E.g. Integer) will it always use the same disk space, no matter what number is actually stored?
4
votes
1answer
812 views

How are binlogs updated for MySQL temporary tables?

If I use CREATE TEMPORARY TABLE, can I write and update this MySQL table and know that none of it will be stored to the binlogs? If I use data from the temp table to write to a non-temp table, is the ...
3
votes
1answer
3k views

MySQL Bug required remedy : [Warning] Invalid (old?) table or database name '#sql-'

We have a master & multiple slave replication in our production environment. At first, I found this error in the mysql error log on the master and later on the slave. As for all the replication, ...
0
votes
1answer
573 views

It is possible to export a MySQL database without BLOB fields?

If I have a MySQL database with some tables where one have a BLOB column, It is possible to export the whole database excluding the BLOB fields? If not, could you suggest a solution to work-around it? ...
5
votes
2answers
6k views

Query runs a long time in some newer MySQL versions

I have created a database on MySQL 5.0.15. I have a query and when I run this query on this MySQL version, I get 0.9 s run time. When I import this database to another MySQL server with same hardware ...
2
votes
1answer
591 views

create trigger which inserts rows depending on enum values?

I'm quite new to triggers and I ran into general problems. I'd like to achieve this: CREATE TABLE `searcharticles` ( `articleID` int(11) unsigned NOT NULL, `ean` char(13) COLLATE utf8_unicode_ci ...
3
votes
1answer
2k views

Should I use DynamoDB or stick with MySQL via webservice for my mobile app syncs

I asked this earlier at Stack Overflow but a user advised me to ask it here since this website is more relevant to database related questions. I made an Android app, name of which I'll not mention at ...
2
votes
1answer
2k views

MySQL Exec_Master_Log_Pos value greater than Read_Master_Log_Pos

I am trying to repair one MySQL replication setup. One of the database's table at slave side is deleted and the updates from master side are received but because of missing table these updates are not ...
2
votes
1answer
866 views

query generate the information one column in two columns in one query

I have a question related with a query in sql. I have the next table: id name 1 name1 2 country1 3 name2 4 country2 I need to call the results so: ...
2
votes
1answer
160 views

Need some help with this query get all status and their associated comments of me and all my friends

I've several days dealing with this query but can't get it to works as I want. This post is related to this one Several values from different tables in which I tough found the solution but I was ...