MySQL : Open-Source, Relational Database Management System

learn more… | top users | synonyms

3
votes
1answer
985 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
371 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
346 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
582 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
215 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
886 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
273 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
427 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
658 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
4k 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
590 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
538 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
836 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
580 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
603 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
871 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 ...
1
vote
0answers
290 views

MySQL GROUP BY and ORDER BY giving inconsistent results

I'm currently working with WordPress, and I've added a new meta value which is a number between 0 and 30. Zero is ignored and up to 30 need to be organised in order and only the latest (based on the ...
2
votes
2answers
737 views

Why restoring a large sql file via SSH seems to quit partially through the process

I have a large (~5GB) .sql file I am attempting to restore via SSH, it seems to quit in the middle of the restore process. When I come back hours later after issuing the command (the file has 7 ...
2
votes
8answers
3k views

What database front end do you use? [closed]

What database front end do you use? It should let you manage databases, tables, indexes and ideally even data records. And it should ideally be free so we can all use it too. Databases that it could ...
2
votes
1answer
2k views

Optimizing MySQL for Read-Only?

We have 14 GB worth of CSV's which total 138 million rows. I imported this into a MySQL table first with InnoDB, and then tried again with MyISAM. In both cases, a simple SELECT on primary key ...
1
vote
1answer
176 views

What is the most effective way to cluster MySQL for my requirements?

Basically I have 3 edge servers and 3 application servers. The edge servers are running nginx and load balance between the application servers. The application servers are running Virtualmin GPL with ...
3
votes
1answer
6k views

how to fetch different data on compare rows of two tables

I have two tables in my database, one is user_app table in which user info are stored, table are as: +--------------+--------------+------+-----+-------------------+-----------------------------+ | ...
2
votes
0answers
155 views

How to TRIM and CONCAT at the same time [closed]

I have a query am working on where I want to Trim a leading character and the concat other three characters my query is as follows SELECT CONCAT ('255', TRIM(LEADING '0' FROM `mobile`) FROM ...
2
votes
3answers
2k views

Does the MySQL primary key affect the efficiency of a SELECT query?

Does the primary key serve any purposes apart from uniquely identifying a specific row? For example, a table with an autoincremented primary INT key could greatly aid in search due to the option of ...
2
votes
2answers
2k views

mysql transaction vs lock

I have a question regarding MySQL locking and transaction management. My Question is ..does mysql takes lock on the the tuple/table on which I am doing select/update in a transaction ?
3
votes
2answers
5k views

MySQL “server has gone away” using SQLyog

I'm trying to copy a database from a server to my local machine, I've installed Wamp 2.2, mysql 5.5.16, but during copying db I m getting "mysql server has gone" 2006, I've tried to fix it by changing ...
2
votes
2answers
630 views

MyISAM table keeps crashing. What are my options?

My MYSQL table is very large (250GB, around 200M rows). Recently I've been putting it through a lot -- parallel processes that do a large number of reads. It has started locking and crashing with ...
2
votes
1answer
101 views

Want to select distinct from 3 fields

I have a mySQL table with a town_id and 3 categories - cat1, cat2, cat3. I need to be able to come up with a distinct list of all the categories in the table selected by town_id, not duplicated and ...
1
vote
1answer
121 views

Several values from different tables

I'm totally lost here and not know how to get this to work and hope any can help me here. I have several tables: default_users, default_profiles, default_status, default_comment and latest ...
1
vote
1answer
831 views

“Mysql has gone away” heavy multiple insert

I am stuck because Mysql server will go away after executing this part of code this function will update the database with the new RSS feeds which are stored in ToUpdate but Mysql stops working. Every ...
5
votes
1answer
1k views

Can I have an InnoDB master and MyISAM slaves with Full-Text for searching?

I'd like to use InnoDB on the master, for its transactional ability, but MyISAM on the slaves for the full-text search ability. Is this possible?
2
votes
2answers
2k views

MySQL Cluster: Problem Connecting the SQL node

In a MySQL cluster I have three hosts, one with a manager node, and the other two are each both a data node and sql node. Connecting to the manager is possible, however only as [ndbd] and not ...
0
votes
1answer
198 views

Is possible to optimize this query or it's already optimized?

I've three tables: default_users, default_profiles, default_friend. This are the SQL for each one: -- -- Table structure for table `default_users` -- CREATE TABLE IF NOT EXISTS `default_users` ( ...
1
vote
0answers
180 views

Get all comment.message, status.message, users.* and profiles.* where users.user_id exists in friend.friend_id or friend.user_id

I need some help building this query because it's a bit complicated at least for me. I need to get all comment.message, status.message, users.* and profiles.* where users.user_id exists in ...
4
votes
1answer
3k views

How do you read MySQL InnoDB Monitor output?

I am new to DB Administration. I am trying to figure out the cause of deadlock exceptions, but I am unable to make sense of the logs. The log says that "transaction 1 is rolled back". Why is this the ...
2
votes
3answers
316 views

designing multiple tables while eliminating duplication?

As I'm working on an educational website, I'm facing a problem with my database design scheme - I can't find the correct design that eliminates duplication in the tables I'm creating. What I'm trying ...
1
vote
1answer
193 views

MySQL row length is almost the triple of what I expect

I shamelessly took title and content from this question and adapted it to my similar yet different problem: This is the table I have: CREATE TABLE `test` ( `field1` MEDIUMINT(8) UNSIGNED NOT ...
14
votes
3answers
3k views

Why doesn't InnoDB store the row count?

Everyone knows that, in tables that use InnoDB as engine, queries like SELECT COUNT(*) FROM mytable are very inexact and very slow, especially when the table gets bigger and there are constant row ...
6
votes
2answers
2k views

Is one-to-one relationship normalized?

Consider we have a large set of statistical data for a record; e.g. 20-30 INT columns. Is it better to keep the entire set in one table as they all belong to a record OR creating a another table ...