Re: Document / Image (Blob) archival -- Best Practices

2006-04-18 Thread Michael Kruckenberg
Tim, I did this for a large collection of images, ~1million images up around 40 gigs total last time I checked (no longer involved in the project). It worked very well, performance was not horrible compared to file-based storage. I always feared that MyISAM table getting corrupted and

Re: Fetch and updation in single step/query

2006-04-18 Thread Michael Kruckenberg
Seems like what you need is an auto-increment key. Is that out of the question? On Apr 18, 2006, at 1:34 AM, abhishek jain wrote: Dear Friends, I run several processes and they need to query the mysql 5.0.8 database simultaneously .I have a config table which have the record id. I need to

Re: could a Trigger execute a outside command?

2005-06-27 Thread Michael Kruckenberg
On Jun 27, 2005, at 1:32 PM, Ted Zeng wrote: I don't know if it is possible under Mac OS. But I assume it is, consider it is basically a UNIX. I just want to trigger a shell script, say, a perl script. Could a shell script be called from a C program? It looks like I will need to go through a

Re: Backup and Maintenance Strategies

2005-06-25 Thread Michael Kruckenberg
I don't know how big your tables are, and if you can withstand any downtime. Because we're using MyISAM tables, we use mysqlhotcopy, which locks the database as it copies the tables to another location. Once that's been done you can rely on your filesystem backup to keep copies of the data

Re: CHECK constraint

2005-06-25 Thread Michael Kruckenberg
A trigger is a good place to check the value, and change it, bit I don't believe you can actually generate a MySQL error within the trigger that will prevent the data from being inserted. Currently (unless there's been an update to triggers that's not yet in the docs), you can only change

Re: CHECK constraint

2005-06-25 Thread Michael Kruckenberg
Hi, Use enum with a default type and let mysql do the check for you. The problem with an enum is that if you insert a value that's not in the enum, MySQL doesn't stop the insert, it leaves the column empty. This doesn't enforce data integrity like I think Chris wanted. mysql desc

Re: Help with pathnames on a LOAD DATA INFILE

2005-06-20 Thread Michael Kruckenberg
First, remember when MySQL interacts with the filesystem it does so with the privileges of the mysql user (or whatever user is running the database). You'll have problems if that user doesn't have permissions in that dir. I'm not sure what OS GoDaddy runs, but if it's a flavor of Linux the

Re: remote connection problem

2005-03-22 Thread Michael Kruckenberg
One other thing to check, make sure --skip-networking isn't specified in your configuration. mysql show variables like 'skip_networking'; +-+---+ | Variable_name | Value | +-+---+ | skip_networking | OFF | +-+---+ 1 row in set (0.00

Re: remote connection problem

2005-03-22 Thread Michael Kruckenberg
Not necessary to change my.cnf, unless --skip-networking was specified. Also assuming that you are using port 3306. mysql show variables like 'port'; +---+---+ | Variable_name | Value | +---+---+ | port | 3306 | +---+---+ 1 row in set

create view - what does the algorithm clause do?

2005-01-17 Thread Michael Kruckenberg
I'm using 5.0.2 and playing with views. The documentation indicates: CREATE [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}] VIEW . . . I can't figure out what that alrorithm setting changes (it's not discussed in the MySQL documentation). I don't see it in the SQL:2003 docs I have. It looks like

Re: Dumping Select statement output onto a text file

2004-10-28 Thread Michael Kruckenberg
There are several ways to get output to a text file, from the Unix shell you can: mysql -e select * from table database output.txt or if you're looking for more of a log of what happened in the MySQL client, from the MySQL shell: tee output.txt select * from table; Mulley, Nikhil wrote: Hi

Re: Server hanging

2004-09-01 Thread Michael Kruckenberg
Back in 3.23.x we used to see MySQL hang on a corrupt table (typically caused by an improper shutdown). A kill -9 was needed to stop the process, upon restart we'd run a mysqlcheck (MyISAM tables) and repair the table. We didn't see anything obvious in the logs except the last query, which was

Re: UPDATE string segment?

2004-09-01 Thread Michael Kruckenberg
You can use the replace string function: update table set file_path=replace(file_path,'aFolder','aFolder/aChildFolder'); In each update aFolder will be replaced by the new path. John Mistler wrote: I have a column that holds hard disk file location info such as: /Volumes/External

Re: all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Michael Kruckenberg
It's ulgy, and I'm not sure how efficient it is, but this will do the trick: select concat(left(first,1),substring(lower(first) from 2)) as first; Aaron Wolski wrote: Hey guys, I have a column in a table called 'first'. Currently all records are upper case. Is it possible for me to do a select

Re: update synopsis error

2004-05-31 Thread Michael Kruckenberg
What version of MySQL are you using? Subqueries aren't available until 4.1.x. saiph wrote: hi, mysql update table1 set c = (select c2 from table2 where c2 = 'value') where id = 123; give me an ERROR 1064. i.e. create table t1 ( id int primary key, name varchar(20) ); create table t2 ( id int

Re: A Request from a Software Programmer

2004-05-28 Thread Michael Kruckenberg
There are a number of steps after installation that need to happen before you will be able to connect: http://dev.mysql.com/doc/mysql/en/Unix_post-installation.html naresh bhalala wrote: Respected Sir/Madam, I have download the MySQL4.0 from www.dev.mysql.com and file is

Re: Problems with Order By (phpMyAdmin)

2004-05-27 Thread Michael Kruckenberg
David Blomstrom wrote: I'm working on an add/edit form, illustrated by the screehnshot at http://www.geoworld.org/addedit2.gif I decided to arrange the rows by ID, rather than alphabetically. So I opened the table in phpMyAdmin, clicked Operations, then changed Order by from a field named SCode to

Re: Error 1054

2004-05-26 Thread Michael Kruckenberg
Maybe a long shot, but creating this table should have required using backticks around `Column` because it's a reserved word. Made me wonder if the ID field in the create statement was in backticks as well and maybe has an extra character. What does show create table Spot show? Hi, I have a

Re: Problem while insert binary

2004-05-25 Thread Michael Kruckenberg
giovanni cordeschi wrote: Using PHP i'm not able to insert a binary variable into a field of type mediumblob of mysql. The command I've used is: $cfg_Query = Insert into (operazioni, datacreazione) Values ('.$contents.', Now()); $result = mysql_query($cfg_Query, $conn) It doesn't appear there

Re: DB hanging

2004-05-25 Thread Michael Kruckenberg
Brandon Metcalf wrote: We are running 3.23.58 on Solaris 8 and seeing the following problem. Periodically, mysqld gets into a state where we can't query just one table in all of our DBs--queries just hang. Restarting mysqld always fixes the problem, but a SIGKILL is required to stop it. Have you

Re: Posting Articles in Databases

2004-05-25 Thread Michael Kruckenberg
David, MySQL is up to the task. Oodles of people doing this. We do something similar for course syllabi, thousands of documents (currently 113,676), both in XML and HTML, which can be as large as 100 pages when printed. I'm sure there are examples out there with more impressive statistics.

Re: Adding to a record

2004-05-25 Thread Michael Kruckenberg
Seems like you could do it either way: PHP ? $new_num = $mysql_num + $user_num; mysql_query(update table set number = $new_num where . . .) ? or MySQL ? mysql_query(update table set number = number + $user_num where...) ? Depends if you want php or mysql to perform the calculation. Daniel

Re: Sorting Problem

2004-05-21 Thread Michael Kruckenberg
H Bartel wrote: I have the following tables which look like this: table tartist ++--+--+---+---+ | id | name | info | image | genre | ++--+--+---+---+ table programm ++--+---++ | id | date | stage | artist | ++--+---++

Re: copying longblob value to another table...

2004-05-21 Thread Michael Kruckenberg
Abubakr wrote: I am trying to copy a file stored in longblob column of a table to a longblod column of another table, can any one tell me what kind of insert statement should i use for that purpose. You should be able to insert into your upload table with a select from your testing table.

Re: BLOB's - General Guidance

2004-05-19 Thread Michael Kruckenberg
In a lot of cases storing images on the filesystem makes the most sense. We store images in a database because we have multiple webservers that need to both read and write images. Keeping them in MySQL makes this easy. NFS isn't an option for us. Having images in the database also makes

Re: Installation of mysql-3.23.58 on Redhat 9

2004-05-14 Thread Michael Kruckenberg
There's a quick install guide on the MySQL site, which has most of what you've listed: http://dev.mysql.com/doc/mysql/en/Quick_install.html The INSTALL-SOURCE doc which comes in the tarball covers the process in great detail. There may be others, those are two I've used. Kamal Ahmed wrote:

Re: ORDER BY Question

2004-05-12 Thread Michael Kruckenberg
Dirk Bremer (NISC) wrote: The following query produces the following results: select job_coop as 'Job/Coop', count(*) as Count from queue group by job_coop; +--+---+ | Job/Coop | Count | +--+---+ | B03013 |19 | | B05044 | 9 | | B07037 | 6 | | B15037 |

Re: How to export data with no headers?

2004-05-10 Thread Michael Kruckenberg
Using --skip-column-names with the client or mysqldump suppresses the column names. Cao, Wenhong wrote: Hi All, I am trying to export the records from the tables in the mysql database into a file. The problem I am having now is that I don't know how to export the records into a file without

Re: Importing at command line from text file

2004-05-10 Thread Michael Kruckenberg
Robert Ameeti wrote: I'm a newbie trying to follow a tutorial. The tutorial says to type: mysql employees employee.dat The employee.dat file doesn't have to be in any specific location, as long as you can read it. To run the command above, cd into the directory with the employee.dat file

Re: Directory Permissions on files

2004-05-08 Thread Michael Kruckenberg
Yes, the file permissions do affect whether the table can be updated. The files need to be writable (in the filesystem sense) by the user running mysqld. By default MySQL creates directories umask 0700 and files 0660 unless the UMASK env variable is set differently when mysqld is started. If

Re: Export query to text file

2004-05-05 Thread Michael Kruckenberg
Add the -t option to ensure you're getting the table output stuck into your file. mysql -t -uuser -N -eselect date_format('2004-02-29','%X') sample2.txt Yingyos wrote: Hi Victor Pendleton , I type this command line. mysql -uuser -N -eselect date_format('2004-02-29','%X') sample2.txt When i

Re: Installing MySQL

2004-03-29 Thread Michael Kruckenberg
Yes. We do something like this to build packages from a local install. ./configure --prefix=/usr/local/mysql-4.018 make make test make DESTDIR=${HOME}/build/mysql/pkg install Adaikalavan Ramasamy wrote: Dear all, Is it possible to install mysql locally on Sun Solaris 8 as I do not have root