mysql

MySQL UPDATE statement batching to avoid massive TRX sizes

I am often writing datascrubs that update millions of rows of data. The data resides in a 24x7x365 OLTP MySQL database using InnoDB. The updates may scrub every row of the table (in which the DB ends up acquiring a table-level lock) or may just be scrubbing 10% of the rows in a table (which could still be in the millions). To avoid ...

PHP/passthru/mysqldump seems to timeout

I've got a PHP script that I call to run MySQL database backups to .sql files, TAR/GZip them and e-mail them to me. One of the database is hosted by a different provider than the one providing the web server. Everything is hosted on Linux/Unix. When I run this command: $results = exec("mysqldump -h $dbhost -u $dbuser -p$dbpass $dbname...

How to encrypt mysql passwrod in php (or how to defeat automated code scanner red flag)

Management strikes again. How should I satisfy the code scanner that is going to read my php source and red flag my MySQL connection string? Linux Server (soon to be Sun) php 4.2 (soon to be latest version) MySQL database Servers in a DMZ outside of the firewall Read only MySQL account Not a single byte of non public information in t...

mysql: which queries can untilize which indexes?

I'm using Mysql 5.0 and am a bit new to indexes. Which of the following queries can be helped by indexing and which index should I create? (Don't assume either table to have unique values. This isn't homework, its just some examples I made up to try and get my head around indexing.) Query1: Select a.*, b.* From a Left Join b on b.type...

Do MySQL indexes still work after inserting new rows?

I have a MySQL table with an index covering two fields. If I insert new rows into the table, will my index still work? ...

Best way to get recent date rows? (this week/month)

I wanna get rows in recent date, this week or month, etc. suppose the table has a field named: product_date. ...

Uploading a Content Management System Website to the internet

Hi everyone, Before I start I want to say this is my first site I am uploading that has a database - so I will appreshate any help whatsoever! What site is the best for webhosting - the cheapest and most reliable? I'm not sure how big my database will get - but I need to have a lot of space! (just in case). I, of cource, don't want my...

importance of link identifier in mysql_real_escape_string()

Why is it necessary to have a link identifier as an input when using mysql_real_escape_string(). I know that the function should be used with MySQL queries, but the function is really just a string manipulation. ...

Friend of a friend in PHP/MySQL?

Ok I have searched before asking, all I found was several questions asking what I am but 0 answers so maybe someone who knows will see this or I will make it a more clear question. I have a social network similar to myspace/facebook. In my code you are either a person's friend or not a friend, so I show all actions from people you are f...

Web Hosting Companies, Coldfusion

Does anyone know a place where I can either get cheap deals or exchange advert space for free hosting for a coldfusion 8 website, + MYSQL 5? I want unlimited space, broadband etc. ...

Save PHP array to MySQL?

What is a good way to save an array of data to a single mysql field? Also once I query for that array in the mysql table, what is a good way to get it back into array form? Is serialize and unserialize the answer? ...

combine two mysql fields and update a third one with result using php

I have a database table that contain two fields "Categories" and "Tags" i need to create a third field lets say called Keywords as the result of combining both categories and tags so $Keywords = $tags." ".$categories; can you help me please on how to achieve this thanks ...

Mysql DML Performance

Hi In my case I have a Mysql Table with 2,976,977 records. This table has indexes on two columns, and I used these two columns while updating and inserting records from multiple clients. The problem is that it is taking too much time for updating or inserting the values. Is any Idea to speed up this? ...

Key problem: Which key strategy should I use in my database?

Problem: When I use an auto-incrementing primary key in my database, this happens all the time: I want to store an Order with 10 Items. The ordered Items belong to the Order. So I store the order, ask the database for the last inserted id (which is dangerous when it comes to concurrency, right?), and then store the 10 Items with the for...

How to generate sequential GUIDs?

Are there PHP libraries to generate sequential GUIDs for usage in a MySQL database? ...

MySQL 'Too many keys' error

I'm creating a MySQL table in Rails which has about 170 boolean fields, each of which needs to be searchable and hence indexed, but when I create the indexes I get the error message: To many keys specified; max 64 keys allowed Is this limit hard coded or is there a config switch I can flip which wold get around it? Or do I need to re...

#2006 MySQL Server has gone away error in Wamp

Hello, Im using Wampserver version 2.0 . When i try to import a sql file, either through MySQL Query Browser or PHPMyAdmin,i get the following error. Error 2006: MySQL Server has gone away. The size of the file is 54,528 KB. In C:\wamp\bin\mysql\mysql5.1.30\my.ini , i set the max_allowed_packet to 100M in [mysqldump] and [wampmysqld...

How to format mytext file?

I have to load set of questions to MYSQL database table.But the table format is like below QNO Questions Option a Option b Option c Option d Rightanswer... but my textfile which i need to load in database using LOADINFILE command is in different format. How can i match my textfile format to my table format? ...

Mysql worldwide database

Hello, is there a ready to use mysql database containing worldwide information about nation, city, state, cap, etc. to be used on registration form? Thank You Sal ...

Yet another 'Call to a member function on a non-object' problem

I have a html page that calls a php object to get some data back from the database. It works fine, but the script was getting unwieldy so I decided to break some of it out into a bunch of functions. So I have the following files: // htdocs/map.php <?php include("config.php"); include("rmap.php"); $id = 1; $gamenumber =...