mysql

How do I do a fuzzy match of company names in MYSQL with PHP for auto-complete?

My users will import through cut and paste a large string that will contain company names. I have an existing and growing MYSQL database of companies names, each with a unique company_id. I want to be able to parse through the string and assign to each of the user-inputed company names a fuzzy match. Right now, just doing a straight-...

How do you JOIN two MySQL tables where the data is NOT in the other table?

For example, I have a pet table and a lost pets table. I want to get all of the pets that are NOT lost with 1 join and no sub-selects. Is that possible? A typical join only returns results that are in both tables. ...

Is there a tool that can visually map table relationships in MySQL?

I'm looking for a tool that can map the relationships in my database in mysql. I would like something like the view that is generated in MS-SQL Server Management Studio in the 'Show Diagram Pane'. Does such a thing exist? I'm in charge of the design of the database and its using rails conventions. I would not be adverse to specifying...

Items from multiple categories best practices

Hi, I'm making list of items in categories, problem is that item can be in multiple categories. What is your best practice to store items in categories and how list all items within category and its child categories? I am using Zend Framework and MySQL to slove this issue. Thanks for your replies. Sorry for my English :) ...

Fail to read uncommitted data from same session in MySql/.net connector

I've been banging my head against the wall with this one, may be someone can shed some light as of to what may be causing this behavior. I have an asp.net (2.0) app that as some point does: using(TransactionScope scope = new TransactionScope(...)) { //... do a bunch of some queries InsertOrder(); InsertOrderDetails(); // do some m...

Why does MySQL add a comment to InnoDB tables?

When using phpMyAdmin or the MySQL GUI Tools, whenever I create an InnoDB table, it adds a comment to the table like this: InnoDB free: 9216 kB What does this mean? What's it used for? ...

mysql full text search is empty

I am using ruby on rails with a MySQL backend. I have a table called notes and here is the migration I use to create it: def self.up create_table(:notes, :options => 'ENGINE=MyISAM') do |t| t.string :title t.text :body t.timestamps end execute "alter table notes ADD FULLTEXT(title, body)" end I want to do full te...

Pattern for compile time discovery of unsafe/wrong queries

My team is developing a large java application which extensively queries a MySQL database (in different classes and modules). I'd like to known if there is a pattern that allows me to be notified at compile time if there are queries that refer to a wrong table structure (for instance if I remove or add a field on a table and the query s...

using nulls in a mysqli prepared statement

In a mysqli prepared statement, a NULL gets turned into '' (in the case of a string) or 0 (in the case of an integer). I would like to store it as a true NULL. Is there any way of doing this? ...

File / Image Replication

Hi, I have a simple question and wish to hear others' experiences regarding which is the best way to replicate images across multiple hosts. I have determined that storing images in the database and then using database replication over multiple hosts would result in maximum availability. The worry I have with the filesystem is the dif...

In a Rails Migration (MySQL), can you specify what position a new column should be?

If I'm adding a column via MySQL, I can specify where in the table that column will be using the AFTER modifier. But if I do the add_column via a Rails migration, the column will be created at the end of the table. Is there any functionality for rails migrations to specify the position of an added column? ...

MySQL SELECT LAST_INSERT_ID() for compound key. Is it possible?

Can I get the LAST INSERT ID() for a compound key in MySQL? ...

How to connect to a MySQL database from python?

How do i connect to a MySQL database using a python program. ...

MySQL: Use Aliased Fields in Aggregate Functions

I have a SQL statement similar to this: SELECT COUNT(*) AS foo, SUM(foo) AS foo_sum FROM bar But MySQL doesn't allow this because foo is an alias. Does anyone have an idea of how this could be accomplished in SQL? ...

Wildcard search on column(s) in a large table (>10.000.000 rows) in MySQL

Which techniqes would you use to implement a search for contents in a column on a very big table in MySql? Say for instance that you have 10.000.000 emails stored in a table in the database and would like to implement a subject search, that would enable me to search for one or more words that was present in the email subject. If the us...

Is there a way to search a SQL Query with Month Numbers, and not Month Name?

I am trying to use the actual numerical value for the month on a sql query to pull results. Is there any way to do this without having a function to change the numbers to actual month names, then back to month numbers? The following code works for Names, what works for numbers? datename(month,(convert(datetime,DTSTAMP)))= 'Octobe...

Grails MySQL MaxPoolSize

How do I increase the maxPoolSize in Grails when using mysql? It appears to be using a default connection pool only 8 connections. ...

What are the best practices to use to pass a web application from development staging to production?

Our Development environment has many layers and is complicated to replicate or even backup effectively. Basically the File system (ie. /usr/appdir/webapp...) has other applications serving our web application, those application we update doing svn updates from their repository. The use of the web application itself (as a user) will a...

MYSQL installation with a .NET winforms app

I have a C# application that's utilizes MYSQL. I'm at a beta release point and need an installation package that includes my application, along with MYSQL. So basically, I need to install MYSQL and perform a restore from within my .NET install package. Any help would be greatly appreciated. ...

Combo boxes with Hibernate

Im searching for the best way to mantain combo box values within a Mysql Database accessed by Hibernate objects. Currently we have the following table: CREATE TABLE COMBO_VALUES( KEY VARCHAR(5) NOT NULL, COMBO_TYPE VARCHAR(20) NOT NULL, VALUE VARCHAR(100) NOT NULL PRIMARY KEY(KEY,COMBO_TYPE) ); INSERT INTO COMBO_VALUES VALU...