mysql

How do you tune your MySQL database as the size of your data set grows?

I've been using a variety of web applications that use MySQL as a data store. Recently, as one of those has become more popular in my work, the amount of data that its storing in the database has grown exponentially, but I'm still using the default installation of the database. Are there any particular areas where one could suggest imp...

how to store the images in the mysql table and retrieval of stored image using php code?

Hi i need help that how to store the images in the mysql table and retrieval of stored image using php code... sample code that helps me a lot.. regards ~Deepu~ ...

Problem with insert using asp.net, mysql and transactions

I'm using asp.net and MySql to insert data into a table using transaction. I loop through a list of items and inserts them to the table. This code runs quite often and the problem I am having is that sometimes when I insert data one of my parameters is null when inserted into the database but it shouldn't be null. I have started logging...

copy one field from table to another field in the same table

I used this query to copy one full column from the same table: UPDATE 'content_type_chapter' SET 'field_chapternumbersort2_value' = 'field_chapternumbersort_value' But I have received this error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea...

mysql performance: nested insert/duplicate key vs multiple updates

Hello. Does anyone know what would be more efficient and use less resources: Method 1-- Using a single SELECT statement to get data from one table and then iterating through it to execute multiple UPDATEs on another table. E.G. (pseudo-code, execute() runs query): Query1_resultset = execute("SELECT item_id, sum(views) as view_count F...

Is there any way to insert a large value in a mysql DB without changing max_allowed_packet ?

Hello, I know that in order to insert values larger than max_allowed_packet bytes into a MySQL database, the default solution would be to assure that both client and server side max_allowed_packet variables are bigger than the chunk of data that a query inserts into the DB. However, is there any way to do so without changing the server...

How to get MySql to use "[" as a quote character?

I am forced to use a dumb-as-nails Windows program (called IDCentre, made by Datacard, if you have the deep misfortune to use it) that says it can deal with ODBC databases. So, I hooked it up to my MySQL database. All is well so far. Then I noticed that it barfs when it attempts to do an update. The SQL that MySQL deems bad contains ...

Errors Installing mysql2 gem via the Bundler

I am trying to install the mysql2 gem via the Bundler, but it keeps dying with the following error: ** executing command /home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in 'rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /home/cc...

Problem with query

I've four tables: characters guid name gender class race online character_arena_stats guid personal_rating matchmaker_rating arena_team_member arenateamid played_season played_week wons_season wons_week arena_team arenateamid captain_guid and I need to get character details(race,class,name,gender,online) and team information(...

iOS php json service - format?

I have an iOS app that runs this code: userDict = [[NSDictionary alloc] initWithDictionary:[SantiappsHelper fetchInfoForUDID:@"1"]]; which goes to call this class: (NSDictionary*)fetchInfoForUDID:(NSString *)udid{ NSString *urlString = [NSString stringWithFormat:@"http://www.server.com/app/getusers.php"]; NSLog(@"This is the urlStri...

Document Control

What is the best open source document control app for PHP/MySQL? Focus is to be on a system that is robust, easy to use and fast to implement. Needs to have security layers so that files can be public or private. Group assets would be nice. Project management features would be a bonus if they were scalable, robust but not overcomplicate...

Inserting null into char(1)

I am creating a INSERT script and I am coming across a problem. There is a middle initial field that is a char(1) Sometimes the records don't have anything in that field so I put a NULL. This causes a Data too long for column error. I don't want to just put ' ' as that leaves just a blanks space. Is there another way around this? ...

Associate 2 table values in perl

Hi, I have 2 tables in mysql database: CUSTOMER and GROUP The CUSTOMER table: NAME |PHONE A |222 B |333 C |777 D |888 E |111 F |555 and so on. The GROUP table has only 3 value: GN | NUM NEW |807 OLD |455 INT |504 I would like to get the following result: A, NEW, 807 B, OLD, 455...

SQL: How to select the record with the most recent past date for every record on other table.

How can I reformulate this two queries in one single query on MySQL? SELECT * FROM tvnetwork //this query gives me a list of TV networks But networks usually change names and logos, so for each of the retrieved TV networks: SELECT name, logo FROM tvnetworkinfo WHERE id = $tvnetwork.id AND date_since < NOW() ORDER BY date_...

mysql: Copy table structure including foreign keys

I know how to copy a table using create new_table like old_table, but that does not copy over the foreign key constraints as well. I can also do string manipulation on the result from show create table old_table (using regular expressions to replace the table name and the foreign key constraint names), but that seems error prone. Is th...

Outfile local path specification.

Hi, How do i exact to my local machine? select * into outfile 'C:\Info\table1.txt' fields terminated by ',' from table1; This query creates under info folder as table1.txt on the server, how do i specify my local machine path here? Thanks. ...

set status on record automatically after certain datetime

I have a form that users fill in to post their job advertisements and one of the fields they enter is the number of days to keep job 'open'. I want to be able to automatically change the status of the job to 'closed' after the days that they have entered have elapsed. The job table is already set up with status and expiry, I just need ...

MySql PRIMARY KEY other than an int

Im bulding a site that pulls links from twitter and counts the results from it. Ive been thinking about using the actual URL as the PRIMARY KEY instead of using an auto_increment integer. The url's being pulled will be unique and related to trend tracking. Is this a bad idea and should i stick with an integer? ...

Acceptable length of url to be stored as unique MySql/PHP

I want to store url's as unique in a mysql database table but with string type varchar and text the length of a 1000 is too long. Lengths of Search engine friendly url's can be typically long,whats an acceptable length? ...

Does a FULLTEXT index speed up LIKE conditions?

We have a system that is migrating from an older VARCHAR using LIKE setup to one that uses FULLTEXT indexes. So far everyone is enjoying the switch, but we still have some code that isn't catered to the FULLTEXT queries. Currently we have a column that is a VARCHAR(255) and we want to remove the 255 character limit. What will happen to ...