mysql

Ordering a MySQL Query by Most Common Words in a field

I've always wondered about this, and now a client is wondering whether it's feasable: I have a list of sports, broken down like such: Boys Ice Hockey Boys Tennis Girls Ice Hockey Girls Tennis ...etc And they want it to sort like: Boys Ice Hockey Girls Ice Hockey Boys Tennis Girls Tennis ...etc I'm just wondering if this i...

MySQL/SQL: Update with correlated subquery from the updated table itself

I have a generic question that I will try to explain using an example. Say I have a table with the fields: "id", "name", "category", "appearances" and "ratio" The idea is that I have several items, each related to a single category and "appears" several times. The ratio field should include the percentage of each item's appearances out...

Max column limit in mysql using myisam

Is there a way to calculate the maximum number of columns? Thanks. ...

Cacti reports kilorows as a Mysql Sort

In my cacti installation, the graph that reports on mysql sorts has a value kiloRows. What does this value mean? I can't seem to find anything on it anywhere. ...

Delphi - TSQLQuery leaving a proccess on MySQL even after been freed

I am using DBExpress in Delphi 2007 to connect to a MySQL5 database server on the net. It all works OK, until I try and upload a large amount of data. I am trying to insert 8000+ records into the database, one at a time in a loop, in the loop I pass the TSQLConection object to a function along with the data to be inserted. The function...

How do I create a CMS for a news portal?

OK I'll try again, sorry if it's too simple for you; we all have to start somewhere. I need to use a webpage to specify the layout of the newspaper ie header, footer and news areas. This is produced by an HTML page which I have created [the one with check boxes and a create button]. A second web page is to add content to the various ...

ActiveRecord MySQL and JOINS

Hey, I have a problem very similar to the one exposed here in RubyOnRails Guide. This query : Client.all :joins => :orders, :conditions => { :orders => {:created_at => time_range}} should return all the clients with their orders if they made some orders within the time range. Am I right? What I want is slightly differen...

Why is MySQL Data Connector taking so much longer than MySQL Query Browser?

I have a very simple query (three where conditions; two equals, one between) from a single table and in MySQL Query Browser the query takes less than half a second to run, returning 8300 records. If I run the exact same query using the MySQL Data Connector (really just an OLEDB wrapper), it takes about 35 seconds. The engine being used ...

Can you attach Amazon EBS to multiple instances?

We currently use multiple webservers accessing one mysql server and fileserver. Looking at moving to the cloud, can I use this same setup and attach the EBS to multiple machine instances or what's another solution? ...

Fluent Nhibernate and MySql not playing well together

What references are necessary to have fluent nhibernate work with mysql. I have downloaded the latest version (6.0.3.0) of the mysql connector, but it is still throwing exceptions related to the mysql driver. Here is the exception: {"Could not create the driver from NHibernate.Driver.MySqlDataDriver, NHibernate, Version=2.0.1.4000, Cu...

How to create mirror of mysql database for switching purpose in case of emergency?

I have around 400 GB Live mysql Databases on one server and I like to create a mirror for this database. In the server I have database ranging from 1 GB to 100 GB. What are the best practices available that I can use? My purpose is that I should be able to switch in case of emergency. It should have all live data. Thanks. ...

What's a MySQL index table?

I need to speed up a query. Is an index table what I'm looking for? If so, how do I make one? Do I have to update it each insert? Here are the table schemas: --table1-- | --tableA-- | --table2-- id | id | id attrib1 | t1id | attrib1 attrib2 | t2id | attrib2 ...

MySQL limitations

When using MySQL 5.1 Enterprise after years of using other database products like Sybase, Infomix, DB2; I run into things that MySQL just doesn't do. For example, it can only generate an EXPLAIN query plan for SELECT queries. What other things I should watch out for? ...

NetBeans 6.7 Beta - Why does it think certain tables have no primary key?

I am using NetBeans 6.7 Beta to create entity classes from a MySQL (version '5.0.45-log') database. NetBeans accepts most tables, but rejects certain ones consistently (I can't see a pattern), saying they have "no primary key". All tables are using the InnoDB engine. All tables have primary keys of one or more columns. The MySQL query br...

Tying tables together in MySql

I have one table that includes company information (i.e. name, address, business description...) and another table that has user information (i.e. first name, last name, email and password). How do I tie the company table to the user table so that when the user logs in, the company is properly associated with the user? Would I have a use...

Banner Impressions Tracking - Database Design

Hi Folks Looking for some good advice on db design for tracking multiple banner impressions. IE I have 5 Banners over x Domains I would like to build data on each banner on how many impressions per day per banner etc. So also be able to do lookups for other date ranges. Would it be best to have a date per day per row or just track ea...

Using MySql stored procedures for .NET Data Access Layer

Hi. I'm using .NET 2.0 and/or 3.5. Weird thing is, everytime I add a query, whether via TableAdapter or a plain query in a Dataset, using a MySQL stored procedure (whether be a select, update, insert, delete), the wizard doesn't finish (the dialog suddenly disappears, I'm back to designer mode and the query isn't added to the tableadap...

I thought curtime(), now() and current_timestamp are valid default datetime values in MySql?

I'm using the latest version of MySql and I tried altering a table to use curtime() or now() or current_timestamp as the default value for a datetime column (created_at, updated_at). For all three, the alter failed, saying these are invalid default values. Any ideas what's an appropriate default value to generate the current time in a da...

MySQL: duplicating data vs. join

Assuming I have two tables: source, and article and I wish to read article with specific details its source, I can either (1) use join for the two tables; or (2) duplicate the details to the article-record (which will make the data-unit larger, but the query will be very simple). which would be more efficient? ...

MySQL MyISAM table performance... painfully, painfully slow

I've got a table structure that can be summarized as follows: pagegroup * pagegroupid * name has 3600 rows page * pageid * pagegroupid * data references pagegroup; has 10000 rows; can have anything between 1-700 rows per pagegroup; the data column is of type mediumtext and the column contains 100k - 200kbytes data per row userdata...