Re: Is SSD suitable for mysql server?

2010-10-25 Thread Warren Young

On 10/25/2010 3:03 AM, Johan De Meersman wrote:


SSD may still be useful if you have a lot of writes, though.


Only if by a lot you mean a minority.

A lone 2 TB rotating disk will beat a top-of-the-line SSD for linear 
writes, and you can beat an SSD for linear reads with a pair of disks in 
RAID-0 or -1, or four disks in RAID-10.  (Or, I suppose, some huge 
number of spindles in RAID-5 or -6, but I've never seen such an array 
big enough to be called fast at writes.)  SSDs have a clearer advantage 
for random I/O, a useful property for databases, but still, you 
shouldn't ignore the fact that SSD writes are expensive.


Therefore, you get the SSD speed benefit only if writes are rare enough 
that more data is coming off the drive at any given time than is being 
written, or if your current disk subsystem is bottlenecked by rotating 
disk head seek time, or some combination.


Since the original poster is using RAID-10, it's definitely not a sure 
deal that replacing that array with a single SSD will help.


However, it might be entertaining to benchmark it against 4 SSDs in 
RAID-10.  Or 8.  :)



Incidentally, i'm not aware of how SSD plays with hard/software RAID setups
- anyone know more about this ?


Some software RAID and RAID-like systems are gaining SSD awareness so 
they can intentionally place frequently-accessed data on the SSD.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Is SSD suitable for mysql server?

2010-10-25 Thread Warren Young

On 10/25/2010 4:32 AM, Glyn Astill wrote:


There have been some reports of raid cards not behaving themselvs
with SSDs attached.


I'd be surprised if these bugs haven't all been worked out by now.  SSDs 
started to hit the mass market in force about two years ago.  Any vendor 
still shipping a disk controller that eats SSDs likely is trying to EOL 
that controller anyway.



I guess it depends on how important your data is too.  Quite a few of
the SSDs on the market have been proven to not honour flush requests,
so if the power goes out you've got corrupted data.


I doubt that's true of enterprise SSDs.  Sure, if you go and fill your 
server with SSDs made for laptops you may find yourself sliding down the 
bleeding edge, but one wouldn't do that, would one?


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Moving from one MySQL server to three MySQL servers?

2010-08-09 Thread Warren Young

On 8/5/2010 9:35 AM, Nunzio Daveri wrote:


So when I do top-c before I run the reports,
it says mysql is using 2GB, then I run the stress test (several reports) and it
hits 12GB then I stop the stress and even 30 mins later the server says there is
only 800mb of ram free???


That's normal Linux behavior:

http://www.linuxatemyram.com/

I've known this to be true for many years, but just for grins, I tested 
it again on a box here.  It's a development box, so it hadn't been used 
at all over the weekend, and hadn't been used yet today, yet it shows 
only 5% of its 6 GB total as free.



Also it doesn't help when your innodb index is larger than physical memory ;-)


Yes, you should indeed fix that.


But after all the chatter, I think I will use one of our test/dev servers,
install fresh OS, install 5.1.49 then import the db without indexing, run a good
100mb of sql statements against it from our prod servers logs, then look for
what fields need to be indexed under slow query logs and then go from there.  Is
this a good idea vs. going straight to splitting the load into 3 servers?


Yes.

Keep in mind that replication is a sidecar bolted onto DB systems like 
MySQL.  It's not a core behavior of the relational model, so it has a 
lot of penalties.  The current hoopla about NoSQL systems is one 
answer to this, and for a lot of applications, it is a much better way 
to get a distributed DB.



mgmt says throw hardware as it's cheaper then re-writting
code and re-architecting the db ;-)


They may well be right.

Just one observation: your 16 GB RAM number means you're not using 
DDR3 yet, either because the machine doesn't support it, or you're not 
putting memory sticks in it in threes like you should.


Either way, it means RAM accesses could be 50% faster simply by moving 
to DDR3, changing nothing else about the system configuration.  Couple 
that with the fact that the next common step up in RAM size for DDR3 
systems from where you are now is 24 GB, just over your current index 
size.  Those two simple changes may be enough to fix your problem.


If you find a way to optimize the indexes to get it all under 16 GB, 
well, so much the better.  Upgrade to 24 GB (or 36...?) anyway and be 
happy knowing you've bought yourself more time before you need to do the 
next upgrade.  Meantime, let Linux continue to eat your RAM. :)


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Moving from one MySQL server to three MySQL servers?

2010-08-04 Thread Warren Young

On 8/4/2010 12:40 PM, Nunzio Daveri wrote:

it pretty much came down to it's knees within two hours of
running tests.


Can you clarify what happened in those 2 hours, exactly?

If you mean it took 2 hours of running a single test for performance to 
collapse, I'm not sure this means anything.  2 hours of continuous 
pounding may not be representative of how your application will actually 
be used.  If there will be lulls and your test doesn't include lulls to 
give the system time to do periodic cleanups that let it withstand the 
next round of pounding, all you're testing here is what will happen when 
someone tries to DoS the system.


If instead you mean it took you 2 hours of trying before you found a 
test that would kill the box, what was the test, and is it 
representative of actual load conditions?  Again, if not, all you've 
done is found a DoS test case, not something that requires 
rearchitecting everything.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Why UTF8 need 24bit in MySQL?

2010-06-07 Thread Warren Young

On 6/7/2010 9:57 AM, Ryan Chan wrote:

http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html

Since MySQL only support BMP, so in fact 16 bit is needed actually?


I imagine they were thinking they'd extend the support to full Unicode 
in the future and didn't want you to have to dump and reload your 
databases when that happened.  The Unicode consortium has stated that 
Unicode will never require more than 21 bits per character[*], and 24 
bits is the next even multiple of 8 up from that.


[*] Why 21?  Because that's the maximum number of bits you can express 
in 4 bytes with UTF-8 encoding.  If Unicode were allowed to use all 2^32 
code points as originally envisioned, it would require up to 6 bytes per 
character in UTF-8 encoding.  This promise makes UTF-8 code easier to 
write and easier to future-proof without bad performance penalties.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Retrieving info from 2 tbls ordering it

2009-09-23 Thread Warren Windvogel

Hi

I have 2tables. 1 for incoming  the other for outgoing messages. They 
both have columns for the userid  datetime_received/sent. I'd like to 
retrieve all records from both tables for a specific user id  order all 
the records returned by the two datetime_received/sent fields. Is this 
possible  if so could someone help me out as to how I could achieve this.


Kind regards
Warren

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: about mysql_ping() function

2008-12-29 Thread Warren Young

raid fifa wrote:


Is this a bug of mysql_ping() ? or any other advice?


Probably not.  I think you'll find that it *does* time out, just after a 
longer period than you'd prefer.  Timeouts of 30, 60 and 120 seconds are 
common in network code, because it's not possible to reliably determine 
that a link is down until then.


Your OS might have a setting that makes it close all sockets using an 
interface that just lost its physical link to the network.  This is 
often more trouble than it's worth, because the link might come back up 
before any of those sockets need to send data again.  If you need 
immediate notification that the link to the DB is down, though, it might 
be what you want.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Problem with MySQL prompt

2008-12-22 Thread Warren Young

Stefano Elmopi wrote:


If I put the variable prompt in the general my.cnf, the prompt is 
changed but for all instances.

If I put in the variable prompt in the my.cnf associated with the instance
in the [mysql] section, the prompt does not change.


This is because the client reads from my.cnf before it starts talking to 
the server, and it can read any my.cnf file it likes.  There's no way 
you can mandate that a single my.cnf file gets used for both the server 
and any client session connecting to it.


Instead of running mysql(1) directly, I'd run it via one of three 
scripts, each of which sets up its environment so as to force mysql(1) 
to read a different my.cnf file in each case.  This will also let you 
hard-code other information about each particular server that isn't 
important to keep secret, like the login name and the DB name.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Windows source distribution

2008-12-15 Thread Warren Young

Edward Diener wrote:


The source distributions listed at 
http://dev.mysql.com/downloads/mysql/5.0.html#source do not specify any 
as the Windows source distribution. I downloaded the .zip file, thinking 
that might be the one, but it is not.


I just downloaded it, and it looks like the source code to me.  I think 
you're just not finding the build instructions, or not understanding them.


The zip file contains just one top-level directory, mysql-5.0.67. 
Inside that is a file called INSTALL-WIN-SOURCE.  Read it, ignoring the 
claims that you should find .sln files within the package; it's clearly 
outdated information.  You will probably need to get cmake from 
somewhere to generate the .sln and .vcproj files.  At that point, 
building MySQL should be straightforward.


Getting it to find the openssl libraries, as discussed on the other 
list, is another question...


I've not done this myself, just reporting on what I've figured out in a 
few minutes' poking around.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: C++ cache MYSQL_RES

2008-09-12 Thread Warren Young

Kandy Wong wrote:


Is there a way to cache the MYSQL_RES in C++?
I've tried to develop a class with functions returning the MYSQL_RES, 
MYSQL_ROW and MYSQL_FIELDS.


It sounds like you're trying to reinvent MySQL++:

http://tangentsoft.net/mysql++/
--
Warren Young, maintainer of MySQL++

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Lost connection

2008-08-19 Thread Warren Young

Mad Unix wrote:


During the update of the MySQL DB (delete/insert), I keep getting the
following message
Lost connection to MySQL server during query...


By default, the MySQL server drops a connection after 8 hours of 
receiving no queries on that connection.  This can happen in an 
application that keeps its connection open constantly, and people don't 
use it overnight or over a weekend.


You can either increase the timeout in my.cnf, or you can ping the 
connection occasionally with mysql_ping().  Or, you can add code to your 
applications to detect this, and reestablish the connection and retry 
the command.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Need help to query with timestamp in C++

2008-08-15 Thread Warren Young

Kandy Wong wrote:


And what is the good connector (C++ to MySQL) to use?


MySQL++ (http://tangentsoft.net/mysql++/) has native Date, Time, and 
DateTime data types.  You can convert to these types implicitly:


mysqlpp::DateTime dt = row[my_column];

Row::operator[] doesn't return DateTime, it returns a stringish type, 
which can convert itself to lots of different C++ data types.  This is 
useful because the MySQL C API normally returns results in string form, 
so you need a natural way to convert these values to the native C++ 
types for processing.  In this particular case, it saves you from having 
to do the timestamp string parsing yourself.

--
Warren Young, maintainer of MySQL++

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Restore information

2008-07-21 Thread Warren Windvogel

Hi All,
Is there a simple way of checking when the backup db server performed 
its last restore and whether it was successful or not. I need to ensure 
that the dump and restore of the production box has run successfully 
every night until proper backup/DRP procedures are in place. I'm not 
familiar with this sort of thing and searching has provided little 
assistance.


Thanks
Warren
--
Open Source Developer
Business Data Solutions
Email: [EMAIL PROTECTED]
Gmail: wwindvogel
MSN: wwindvogel
Skype: wwindvogel
Cell: 27 73 264 6700
Tel: 27 21 487 2177

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Restore information

2008-07-21 Thread Warren Windvogel

Olaf Stein wrote:

Is my assumption correct that you dump your main production db and restore
it to a second server? And this restore is what you want to verify?


That is correct.

Warren

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Count total number of records in db

2008-07-11 Thread Warren Windvogel

Hi,

Can anyone tell me how to check the total number of records in a 
database in MySQL version 4.0

Googling doesn't seem to help and all previous posts assume version 5.*

Regards
Warren

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Count total number of records in db

2008-07-11 Thread Warren Windvogel

Radoulov, Dimitre wrote:

mysql -NBe'show databases' |
 while IFS= read -r db; do
   printf show tables from %s;\n $db |
 mysql -N | while IFS= read -r t; do
   printf select count(1) from %s.%s;\n $db $t
 done
 done | mysql -N |
   awk '{ s += $1 }END{ print s }'


I quickly put together a PHP script to do it. Its dirty( purpose built 
:-) ) but it works.


?php

//EDIT YOUR MySQL Connection Info:
$DB_Server = localhost;//your MySQL Server
$DB_Username = root; //your MySQL User Name
$DB_Password = ;//your MySQL Password
$DB_DBName = DBName;//your MySQL Database Name

//create MySQL connection
$Connect = @mysql_connect($DB_Server, $DB_Username, $DB_Password)
  or die(Couldn't connect to MySQL:br . mysql_error() . br . 
mysql_errno());

//select database
$Db = @mysql_select_db($DB_DBName, $Connect)
  or die(Couldn't select database:br . mysql_error(). br . 
mysql_errno());


$tables = mysql_list_tables($DB_DBName);
$count = 0;
$total_rows = 0;

while ($count  mysql_numrows($tables)) {
$table_name = mysql_tablename($tables,$count);
$sql = 'SELECT COUNT(*) FROM '.$table_name;
$result = mysql_query($sql);
$table_count = mysql_fetch_row($result);
$table_count = $table_count[0];
$total_rows = $total_rows + $table_count;
echo 'Number of rows in i'.$table_name.'/i = 
'.$table_count.'/br';

$count++;
}
echo '/br';
echo 'bTotal number of rows in database: /b'.$total_rows;

?

Thanks guys.
Warren
--
Open Source Developer
Business Data Solutions
Email: [EMAIL PROTECTED]
Gmail: wwindvogel
MSN: wwindvogel
Skype: wwindvogel
Cell: 27 73 264 6700
Tel: 27 21 487 2177

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Forcing import

2008-07-10 Thread Warren Windvogel

Hi,

Is there a way to force mysql to import a dump which contains a mysql 
reserved word as a field name?


Regards
Warren

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Multi-Language Web Content

2008-07-09 Thread Warren Young

Ben A. Hilleli wrote:


Obviously this poses a problem for 'normal' relational-databases 


No, it just takes a little indirection to represent this in a properly 
normalized fashion.  What you need is:


1. A table of language names mapped to IDs:

Languages
INTEGER id AUTO_INCREMENT UNIQUE
VARCHAR name UNIQUE
PRIMARY_KEY(id)

You could add a sequence column to this if you'd like to be able to 
reorder the list for presentation.


2. A table of users with many attributes, one of which is their 
preferred language:


Users
INTEGER id AUTO_INCREMENT UNIQUE
VARCHAR name
... etc ...
INTEGER language_id
PRIMARY_KEY(id)

3. A table of questions, multiply translated into the languages you 
need, each of which has a unique ID, what language it is in, the 
question text, and which table contains the answers for this question:


Questions
INTEGER id
INTEGER language_id
VARCHAR question
VARCHAR answer_table
PRIMARY_KEY(id, language)

The first two columns are a composite primary key, with the question ID 
being the same for all questions with the same meaning.  So, the table 
will have N rows for the user's occupation question, where N is the 
number of rows in the Languages table.  All N rows will have the same 
'id' value, but different 'language' values.  Therefore, you can't use 
an AUTO_INCREMENT column here, so it'll be up to your code to add new 
values for this.


4. A table that lets you order the questions, so you don't have to do 
something like renumber all the question IDs to reorder the questions:


QuestionOrder
INTEGER question_id
INTEGER sequence

5. For each question, a list of answers, each translated into the same N 
langauges as you did for the questions:


Occupations
INTEGER id AUTO_INCREMENT
INTEGER language_id
VARCHAR name
PRIMARY_KEY(id, language)

6. For each table of question answers, a sequence table:

OccupationOrder:
INTEGER occupation_id
INTEGER sequence

7. A table to hold a mapping of questions to answers for each user:

Answers
INTEGER user_id
INTEGER question_id
INTEGER answer_id

Note that the answer doesn't say which language the user used when 
answering the question.  This table is only concerned with meaning, not 
presentation.


A few of the tables have no key field.  You could declare all columns in 
these tables as a single composite key, if you like.  Only the whole 
record is unique in these tables.


The query order thus looks like this:

SELECT * FROM QuestionOrder ORDER BY sequence
SELECT * FROM Questions WHERE id = QUESTION_ID_FROM_ORDER_TABLE AND
language_id = USERS_PREFERRED_LANGUAGE
SELECT * FROM ANSWER_TABLEOrder ORDER BY sequence
SELECT * FROM ANSWER_TABLE WHERE id = ANWSER_ID_FROM_ORDER_TABLE AND
language_id = USERS_PREFERRED_LANGUAGE


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: unescaping strings with the C api

2008-06-12 Thread Warren Young

Tim Johnson wrote:


I can not locate a C api function to _unescape_ strings. 


Why do you believe you need one?

You need to escape strings when building SQL query strings to avoid 
problems with quote characters, which are special in SQL.  When MySQL 
returns the queried data to your program, it's not using a SQL query to 
do so.  It just gives the data back in a directly usable form.


You'd only need an unescape function if you were writing a SQL parser.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: unescaping strings with the C api

2008-06-12 Thread Warren Young

Tim Johnson wrote:

  Not sure what you mean by directly usable.


I mean directly usable. :)


  If I do an insert statement with a backslash, for example:
  headline\one, I will retrieve headline\\one, and that will
  need to be unescaped, because it is not a true representation
  of what was submitted by the original insert.


My perspective is a little different from yours: as the maintainer of 
MySQL++ (http://tangentsoft.net/mysql++/), I have never actually used 
the C API directly.  I don't have any pure C sample code here to tweak 
to try things.


Instead, I changed one of the MySQL++ examples to insert a string with a 
backslash into the DB, and on retrieving the rows, I get a single 
backslash.  In the C++ code, the backslash is doubled due to C/C++ 
string parsing rules, but that's only one character in the underlying 
string data.  Due to the way this example uses MySQL++, that string gets 
automatically escaped on DB insertion, so I presume it's sent over the 
wire as two backslashes, though I haven't verified it.  Then when you 
retrieve rows through MySQL++, it returns a fairly direct copy of the 
data the C API gives you, with no real translation going on.


MySQL++ doesn't have an unescape function, so I don't see why your 
program would need one.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: latin1 vs UTF-8

2008-05-13 Thread Warren Young

Waynn Lue wrote:


I'm getting a weird ^A character when I
try to print it out in a textarea field.


In that case, what character set does the browser think it should be 
using for the page?  If you don't explicitly declare it, the browser has 
to guess, and you know what happens when you rely on a stupid computer 
to do thinking a human should have done instead.


You can either declare it for all pages on a site in your web server 
configuration (gets sent with HTTP headers), in the equivalent meta 
tag, or in an ?xml tag if you're using XHTML.



I'm trying to figure out if
there's some weird interaction between htmlentities that's causing it
to be displayed strangely.


To debug problems like this, I recommend studying hex dumps of the 
relevant data at every stage along the path:


1. echo 'query' | mysql --user=fred --password=barney mydb | hexdump

2. write hex dump of query results to PHP debug log

3. packet capture of HTTP reply containing finished page

4. in browser, save web page to disk, and run through hexdump tool

You'll find that a) the data isn't stored correctly in the database; or 
b) it's being translated to another character set along the way (it 
happens!); or c) the browser is misinterpreting it because you didn't 
tell it what it needs to know to display it correctly.


 Can I trust that mysql is displaying the

text correctly on the command line tool if I have 4.1, even if the
charset is set to latin1?


Unless you're on a very old or strangely configured system, your 
terminal is probably configured for UTF-8.  Since your DB is in Latin-1, 
there's a character set translation in there, and I can't confidently 
predict what will happen.


In this modern world, it's best to use some form of Unicode everywhere 
possible.  Then the worst you have to deal with is conversion among 
encodings, which is annoying but lossless.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: latin1 vs UTF-8

2008-05-12 Thread Warren Young

Waynn Lue wrote:

I'm trying to figure out if the fact that the charset
is set to latin1 is the reason why.


It shouldn't be.  The registered trademark symbol is code point 0xAE in 
ISO 8859-1 according to the 'pedia:


http://en.wikipedia.org/wiki/ISO_8859-1

So, it would seem that your data source isn't giving you 8859-1.  GIGO.


iconv
This was mentioned somewhere, but no one had a concrete implementation.


There's a command line tool by that name that converts text between 
character sets, but I don't see how that applies here.  You could use it 
to convert a dump file, but you're already on record as not wanting to 
do that, so...


I assume I should check if my mysql has support for UTF-8, 


I believe it just has to be 4.1 or newer.  And, that's only necessary so 
you can get UTF-8 aware sorting and such.  You don't need any special 
support to just _store_ UTF-8 data.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: C API routines and cobol

2008-04-25 Thread Warren Young

Michael wrote:

Has anyone successfully called the C API routines for MySQL from COBOL?


Dude, April 1 was, like, a month ago now.

You may have better luck finding an ODBC bridge for your COBOL 
environment, which let you access MySQL indirectly.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Migration from 32-bit to 64-bit MySQL

2008-04-25 Thread Warren Young

Mike wrote:


I have so much data that we can't take a mysqldump of our database. The
directory tared is about 18GB.


Worst-case expansion for SQL data from binary to text format is about 
5:1, which applies mainly to numeric data, not text.  That's only 90 GB; 
I carry a bigger hard drive in my backpack, which I use for moving files 
between machines.  Heck, my iPod holds more than that.


You don't even have to store a second copy of the data.  You can do 
something like pipe the mysqldump through a tool like nc (netcat) from 
the old machine to the new.  With a decent GigE network connection 
between the two, the transfer should complete in about an hour.  Add in 
a little data compression and you can probably cut that in half.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Migration from 32-bit to 64-bit MySQL

2008-04-25 Thread Warren Young

Mike wrote:


I not sure
what you mean by binary copy.  Can you please explain?


A binary copy means copying the MySQL data directory directly, rather 
than do a mysqldump, which converts the data to text format.  The text 
dump is converted back to binary format for disk storage on loading it 
back into the new database.


That conversion through a machine-neutral format is why it's always 
guaranteed to work.  Moving binary data between machines only works when 
both machines play by the same rules.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: unable to change root password on Mac OSX 10.5.2

2008-04-21 Thread Warren Young

Olga Lyashevska wrote:

e7253:mysql olichka$ /usr/local/mysql/bin/mysql


Try:

$ /usr/local/mysql/bin/mysql -u root -p

It looks like you aren't logging into MySQL as root, so you don't have 
permission to set the root password.  (If you don't give -u, it uses 
your OS X short user name as the MySQL user, which probably doesn't exist.)


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Migrate HUGE Database

2008-03-10 Thread Warren Young

Tim McDaniel wrote:
I was a bit puzzled seeing -p database_name, 


...


How very inconsistent and obnoxious.


It's best to think of -p as never taking an argument, always asking 
interactively.  Many operating systems will let a processes access the 
command line parameters of another process, making it possible to get 
the password in the clear if you pass it to a program this way.  It's 
nice to know that you can pass it this way if absolutely necessary, but 
I try not to use it.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can't find ft-min_word_len in /etc/my.conf ?

2008-01-31 Thread Warren Young

Lamp Lists wrote:

I need to change ft_min_word_len fro 4 to 3. the
proces is very well explained on mysql.com
though, when open /etc/my.conf can't find the
ft_min_word_len line?


If a value for a configurable isn't given in my.cnf, it takes the 
default value.  So, add the line, restart the server, and it will 
override the default.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Decimal - Maximum is 30

2008-01-31 Thread Warren Young

Eli Shemer wrote:

Actually I'm not in liberty to reveal but it is essential to the project.


In that case, I am awe-struck, even astounded, at the possibilities 
suggested by this hint.  You must be working on a project that is 
literally astronomical in scope.  Please, let me explain how I came to 
this conclusion:


Let the size of the universe be our unit quantity.  No one knows how big 
the universe really is, but if it is finite, 100 billion light years is 
plausible, and it is a nice, easy number to work with.


One light year is, very approximately, 10 trillion kilometers.

The average grain of sand is a bit smaller than a millimeter.  There are 
a million millimeters per kilometer.


10^11 * 10^13 * 10^6 = 10^30

In other words, the current system is sufficient for establishing the 
location of every grain of sand in the universe at this scale.  If we 
rescale by making use of the digits we're allowed to the left of the 
decimal point, we can probably describe the location of every atom in 
the universe instead.  You must be working on something absolutely 
mind-blowing for this amount of precision to be insufficient.


Good luck with your project, and I hope it is as excellent as your hint 
suggests.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Decimal - Maximum is 30

2008-01-31 Thread Warren Young

Michael Cole wrote:

I think you missed something in your formula,

You just have a 1 dimension dealt with here.

That would be every grain in that line.


Yes...so you use three columns to describe normal space.  Call them x, 
y, and z.  Or elevation, azimuth and range.  Or...


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Decimal - Maximum is 30

2008-01-30 Thread Warren Young

Eli Shemer wrote:


Is there any possible way to increase this limit ?


I'm curious to know what it is you're doing where you need accuracy 
better than one part in a nonillion.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQL on Leopard

2007-11-19 Thread Warren Young

Steffan A. Cline wrote:


Starting mysqld daemon with databases from /usr/local/mysql/var
/usr/local/mysql/bin/mysqld_safe: line 426: 77090 Segmentation fault
$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION
--datadir=$DATADIR $USER_OPTION --pid-file=$pid_file  $err_log 21
STOPPING server from pid file /usr/local/mysql/var/Phat-G5.local.pid
071117 12:21:39  mysqld ended

Is this some kind of shell error?


No, a segfault (see end of second line) indicates either a bug in MySQL 
or one of the libraries it uses (unlikely) or an incompatibility between 
them.  This being an OS less than 1 month out of the gate, I'd bet on 
the latter.


For now, try installing the version from Fink instead.  It'll have to 
rebuild itself from source, which will avoid many of the possible 
incompatibility problems.  http://fink.sf.net/


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQL on Leopard

2007-11-19 Thread Warren Young

Steffan A. Cline wrote:

I built MySQL 5.045 from source and it will run fine, just not
from launchd. 


My previous post was made with the assumption that you were using the 
official binaries, and that they had not yet qualified them on Leopard. 
 I suggested Fink because it's an easy way to ensure you build from 
source, not because I think Fink is in some essential way better.  The 
fact that you did build from source invalidates my whole line of reasoning.


Was this machine upgraded to Leopard, or freshly installed?  And if 
upgraded, did it have a previous version of MySQL on it before?  If so, 
environment differences when running under launchd may be causing the 
linker to pick up old incompatible dynamic libraries.  Try a 'make 
uninstall', then go back through /usr and /var by hand to ensure no 
traces remain, then reinstall.  If MySQL's Makefiles don't support 'make 
uninstall', just do a by-hand removal.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Warren Young

Tim Johnson wrote:


Can't find file: './mysql/(database_name).frm' for numerous databases.


That's the file the actual table data is stored in.  Unless you're on a 
shared machine and are trying to run a private copy of MySQL, you 
probably don't mean to put store table data in a subdirectory of the 
current directory (./mysql).  Typically this stuff goes in 
/var/lib/mysql   If that's what you want, you can either override the 
defaults by setting up a custom my.cnf or get a build of MySQL that has 
the defaults set sanely for your needs.


Perhaps the Ubuntu 6.06 LTS binaries you can download from mysql.com 
will work on your newer system.  If so, you can be sure they'll be 
configured sanely.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Warren Young

Tim Johnson wrote:


The file pattern is *not* as I expressed it above.


Yeah, I figured that out, and ignored the error in my reply.

The answer remains the same: unless you're purposefully doing something 
weird, there's a configuration error in that MySQL build.  It's not that 
the configuration cannot possibly be right, just that it's unlikely to 
be correct.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Warren Young

Tim Johnson wrote:


Is there a possible repair routine to run?


It isn't broken, per se.

Someone chose to build it with this configuration, and presumably that 
person made a choice that is sensible for their needs.  If it doesn't 
work for you, you can either build MySQL from source with the 
configuration choices you like, or switch to another build that has 
defaults you like.  That's why I suggested downloading the official 
binaries from mysql.com: they work for most people.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Can't find file: './mysql/(database_name).frm'

2007-10-30 Thread Warren Young

Tim Johnson wrote:

It isn't broken, per se.
  
  When you say that it isn't broken, could you please elaborate?


Once again: It seems to me that you're seeing a purposeful choice of 
configuration.  It could very well be that the configuration makes sense 
in some one's use.  The fact that it breaks for you doesn't mean the 
configuration makes no sense.


I don't know for a fact that this is what's going on.  I don't use 
Ubuntu.  I'm just trying to find an explanation for why it is the way it is.



   And thanks in advance, because, from where I'm sitting, time is money
   and I know that it takes time to answers these emails.


I'm glad you see that, but why then are you continuing to argue back and 
forth instead of going to mysql.com and getting a different set of 
binaries to try?  You could have done that about five times in the time 
it's took to have this exchange.  Even if it didn't work, we'd be 
farther along towards a solution by now.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Scheduled events

2007-08-15 Thread Warren Young

Beauford wrote:

Is there a way to run the following command via cron.


$ man mysql

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: segment fault when using mysql++

2007-08-03 Thread Warren Young

wangxu wrote:
actually I am using  this piece of code,but I replaced fprintf to printf 
just to simplify the problem.


Everything I said about printf() applies equally to fprintf().  The %s 
work-around suggested by Pete Harlan will work, but not for very good 
reasons.  Again: see examples/cgi_jpeg.cpp for a better way to handle 
this sort of issue.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: segment fault when using mysql++

2007-08-01 Thread Warren Young
I'm replying to you both personally and to the MySQL++ mailing list, 
where this message is on topic.  Please reply only on the list, not to 
me directly.


wangxu wrote:
below is my code;these code works very fine until, the length of the 
field content  exceeds 30,


How certain are you about this threshold?  It seems a very odd number 
for a computer to care about.  If you'd said 65536 bytes, or 16.7 MB, 
I'd put a lot more credence in your assertion.



   mysqlpp::Row r;
   while (r = res.fetch_row()) {
   printf (r[content]);
 }


I'm not sure it's the problem, but you really shouldn't use printf() for 
this.  The main reason is that printf() will scan the resulting string 
for % signs and try to interpret them as formatting options.  If it 
finds any, it will then try to find varargs, and fail; this would easily 
explain your segfault.  The byte count does affect the chances that this 
will happen, so maybe that's where your perception that it's data size 
related comes from.


Other reasons not to use printf() with MySQL++ data types are 
inefficiency and type safety.


See examples/cgi_jpeg.cpp for the right way to emit bulk MySQL++ to stdout.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Blob data

2007-06-26 Thread Warren Young

Kevin Waterson wrote:

This one time, at band camp, Warren Young [EMAIL PROTECTED] wrote:

 Storing arbitrary data in a BLOB column is 
tantamount to trying to turn the database into a file system.  If you 
want a file system, use a file system.


What is a file system, if not a database?


That's the sort of logic that leads one to believe that the only data 
structure anyone needs is a hash table (Javascript), or that because bc 
is Turing complete, that it is a good general purpose programming language.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Blob data

2007-06-25 Thread Warren Young

Ratheesh K J wrote:


I want to know whether this is the right approach. Or should we
actually store the attachments in directories and just stiore the
attachment path in the database.


Databases are designed to handle arbitrarily large numbers of rows of 
structured data, where each datum is small and roughly the same size as 
all others of its kind.  Storing arbitrary data in a BLOB column is 
tantamount to trying to turn the database into a file system.  If you 
want a file system, use a file system.


Microsoft's been promising a database-backed file system for something 
like 15 years now.  Maybe it's because they don't write software all 
that well up there in Redmond.  Or maybe it's because this is one of 
those ideas that sounds good on paper but doesn't work out so well in 
practice.  I'm betting on the latter.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Moving Large Innodb Table to other mysql

2006-11-17 Thread Warren Young

sofox wrote:

Message: Multi-statement transaction required more than
'max_binlog_cache_size'
bytes of storage; increase this mysqld variable and try again


Why don't you try doing what it suggests?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Does new Community version change C API licensing?

2006-10-30 Thread Warren Young

Kaj Arnö wrote:


So: For client licensing, nothing as changed -- but stay tuned for an 
announcement next week!


Did I miss it?  It's been almost 2 weeks, and I don't see anything in 
the MySQL press release archive or your blog.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: £ (Great Britain Pound) breaks MySQL insert and update - disastrous overwrit e

2006-10-20 Thread Warren Young

Paul Warner wrote:


When a user enters text with a £ sign (Great Britain Pound) in the
browser and clicks enter, any insert or update statement apparently
gets truncated in mysql.


It's possible that somewhere along the line, the character is getting 
translated to a multibyte Unicode format.  (UTF-16 or -32, most likely.) 
 The hex value for the pound sign is 00A3, which includes a null 
character, which the MySQL C API will interpret as end-of-string.


You either need to escape that null (which isn't really the right 
thing...this isn't a BLOB) or explicitly convert it to UTF-8.  UTF-8 is 
an encoding explicitly made to work around this limitation of C, which 
is why MySQL likes it.


And since you want to accept a wider character support, you should set 
the web server and database to also use UTF-8.  It's the right way to 
handle such characters.  ISO 8859 is a backwards compatibility hack to 
allow ancient technologies to support one of several subsets of the 
world's characters.  What you really want is to support them all, 
transparently.  That's Unicode.


See http://www.fileformat.info/info/unicode/char/00a3/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: £ (Great Britain Pound) breaks MySQL insert and update - disastrous overwrit e - FIXED

2006-10-20 Thread Warren Young

Paul Warner wrote:


Now we are in UTF-8, it is saving everything I can throw at it
without  creating garbage characters.  Whew.


Yep.  Even though it wasn't the solution to your immediate problem, 
switching to UTF-8 will prevent a whole class of future ones.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Does new Community version change C API licensing?

2006-10-17 Thread Warren Young
I've looked over as much of the information on the new Community vs. 
Enterprise version stuff as I can find, and I don't see an answer to 
this question.  Basically, I want to know if the MySQL C API is still 
dual licensed, under the GPL and the MySQL commercial license.  If so, I 
don't see how this new model is any different than before, except that 
the commercial version is now more expensive.


The practical upshot of the previous licensing scheme, for people that 
used the MySQL C API, was that you either had to buy a MySQL commercial 
license, or release your code under the GPL.  That means MySQL could 
never be free-of-charge (quoting today's email from Kaj Arnö) for 
those people.  For that to happen, the C API must be released under a 
more liberal license (LGPL at least), or explicitly made public-domain.


So, has anything substantial changed besides the price of a commercial 
license?

--
Warren Young
Maintainer of MySQL++  http://tangentsoft.net/mysql++/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: MySQL Replication Binary Logs - How Long to Keep?

2006-08-12 Thread Warren Crigger
 Note that you should not just delete the bin logs. Instead 
 use PURGE MASTER LOGS. See 
 http://dev.mysql.com/doc/refman/4.1/en/purge-master-logs.html
 
 hth,
 mark


Sorry, accidently hit Ctrl/Enter :(

Anyway, I can't purge with that command:

mysql PURGE MASTER LOGS TO 'mysql-bin.023';
ERROR: 
A purgeable log is in use, will not purge

Any ideas?  I'm tempted to just delete but would prefer to do this the right
way, and for some reason it thinks they are in use :/.  I'm showing:


mysql show master status; 
+--+---+--+--+
| File | Position  | Binlog_do_db | Binlog_ignore_db |
+--+---+--+--+
| repl.024 | 110962544 |  |  |
+--+---+--+--+
1 row in set (0.00 sec)

Thanks,
Warren


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



MySQL Replication Binary Logs - How Long to Keep?

2006-08-09 Thread Warren Crigger
I've just recently set up MySQL replication amongst two servers so I'm not
too familiar with it.  I was cleaning up my /var filesystem and found the
binary data below being stored in /var/lib/mysql, taking up 1.5gb.  

I did a little reading on mysql.org docs.  My interpretation was that you
can have it replicate every so often, then you can purge these after that
happens..however, my replication is instantaneous.  I can insert a record on
the master and then go select it on the slave immediately.  Is there any
reason to keep this data?  It's replicated to the 2nd server, in addition to
dumps of the more important databases nightly, and dumps of the entire
server weekly, which go to different physical drives and then ultimately
off-site.  I like redudancy obviously, however, this seems pretty useless to
me.

If it is of use, is there a way I can put this on a different filesystem,
keeping the databases themselves within /var/lib/mysql?

Thanks,
Warren

[EMAIL PROTECTED] mysql]# pwd
/var/lib/mysql
[EMAIL PROTECTED] mysql]# ls -lart |grep repl
-rw-rw1 mysqlmysql 3088434 Jun 11 04:02 repl.001
-rw-rw1 mysqlmysql 107 Jun 11 04:02 repl.002
-rw-rw1 mysqlmysql188387006 Jun 18 04:02 repl.003
-rw-rw1 mysqlmysql 107 Jun 18 04:02 repl.004
-rw-rw1 mysqlmysql 107 Jun 25 04:02 repl.006
-rw-rw1 mysqlmysql156749380 Jun 25 04:02 repl.005
-rw-rw1 mysqlmysql153489679 Jul  2 04:02 repl.007
-rw-rw1 mysqlmysql 107 Jul  2 04:02 repl.008
-rw-rw1 mysqlmysql 107 Jul  9 04:02 repl.010
-rw-rw1 mysqlmysql140922795 Jul  9 04:02 repl.009
-rw-rw1 mysqlmysql58638790 Jul 11 17:30 repl.011
-rw-rw1 mysqlmysql   38410 Jul 11 17:46 repl.012
-rw-rw1 mysqlmysql 5927431 Jul 12 09:00 repl.013
-rw-rw1 mysqlmysql80007235 Jul 16 04:02 repl.014
-rw-rw1 mysqlmysql 107 Jul 16 04:02 repl.015
-rw-rw1 mysqlmysql 107 Jul 23 04:02 repl.017
-rw-rw1 mysqlmysql155468996 Jul 23 04:02 repl.016
-rw-rw1 mysqlmysql 107 Jul 30 04:02 repl.019
-rw-rw1 mysqlmysql155806419 Jul 30 04:02 repl.018
-rw-rw1 mysqlmysql 107 Aug  6 04:02 repl.021
-rw-rw1 mysqlmysql159420166 Aug  6 04:02 repl.020
-rw-rw1 mysqlmysql 6366383 Aug  6 13:33 repl.022
-rw-rw1 mysqlmysql 1138297 Aug  6 17:36 repl.023
-rw-rw1 mysqlmysql 264 Aug  6 17:40 repl.index
-rw-rw1 mysqlmysql43014905 Aug  9 00:03 repl.024



Re: where may I find sqlplus.hh??

2006-08-07 Thread Warren Young

Greg 'groggy' Lehey wrote:

 I have downloaded a code on c++ to talk to MySQL database from net which
included a file sqlplus.hh , where may I find the file?Please help me
soon.


That's the main header file for MySQL++ v1.7.9.  You can download that 
release from the official MySQL++ page:


http://tangentsoft.net/mysql++/

However, it is highly recommended that you upgrade the code to the 
current version.  MySQL++ 1.7.9 is broken in too many ways to tolerate 
now that we have something better.


If you have anything more to discuss on this topic, please take it up on 
the MySQL++ mailing list, not here.

--
Warren Young
MySQL++ Maintainer

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql++1.7.1 vc++6 compile errors

2006-03-13 Thread Warren Young

Keith Lee wrote:


there is one link error
LINK : warning LNK4098: defaultlib LIBC conflicts with use of other libs; use 
/NODEFAULTLIB:library
In the settings if i do as it says above, i get over 200 errors!! so i revert 
back.


Visual C++ is very picky about the way programs are built when linked 
against third-party libraries.  Those libraries have to be built using 
the exact same build settings: whether to use multithreading or not, 
whether to use the dynamic C runtime library or the static one, whether 
to use Unicode or not, etc...  If you get one of these wrong, you can 
get all kinds of havoc.


Study the project settings for MySQL++ and either change them to match 
your program's build settings, or vice versa.



the crash error is abnormal program termination


Wrap the Connection object creation in a try block.  MySQL++ may be 
throwing an exception.  An uncaught exception kills the program.


P.S. You do realize that you can get the entry level version of Visual 
Studio 2005 for free right now, don't you?  Then you will be able to use 
the current version of MySQL++, so we can offer you better support. 
We're not picking on Visual C++ here.  We don't support eight year old 
versions of GCC, either.

--
Warren Young
Maintainer of MySQL++

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: libmysqld as shared library (The Sequel)

2005-11-10 Thread Warren Young

Peter M. Groen wrote:


Still no luck. I'm trying to build libmysqld as a shared library for use in a 
project. 


This is a platform-specific issue.  I don't see anything in this message 
or your previous thread that tells the details about your platform. 
What compiler, what operating system, what version of everything


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: C API - Language Setup and MyISAM table setup

2005-08-22 Thread Warren Young

Fábio Emilio Costa wrote:


I'm working in a project in C++ using MySQL C API (Win98/Dev-C++
4.9.9.8/MySQL DevPak/MySQL 4.1.13) and I want to know if it's possible
to setup the server environment language (--language) via
mysql_options() function.


It seems that you are actually asking whether the documentation for 
mysql_options() is wrong, since a glance at its documentation says that 
the answer is clearly no.  Do you not trust the people maintaining the 
MySQL C API documentation?


Also: http://dev.mysql.com/doc/mysql/en/languages.html


Also, I want to know if it's possible  to setup a table to  MyISAM
instead of InnoDB via C API. 


Again, the documentation answers your question.  From the introductory 
material in chapter 14:


To convert a table from one type to another, use an ALTER TABLE 
statement that indicates the new type:


ALTER TABLE t ENGINE = MYISAM;

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Using MySQL libraries for a client app

2005-08-19 Thread Warren Young

Steven Altsman wrote:

checking whether mysql clients can run... no
configure: error: Your MySQL client libraries aren't properly installed


Read through config.log to see what test was tried, and how it failed.


I've looked at the PureFTP archives and they aren't particularly helpful


I take it the configure script output above is from the PureFTP package? 
 If so, you really should take this up on their mailing list.  Each 
package tests for required libraries in a slightly different way, so you 
need some package-specific expertise here.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Using MySQL libraries for a client app

2005-08-19 Thread Warren Young

Steven Altsman wrote:


cp /usr/local/mysql/lib/mysql/* /usr/lib


No no no!  There are several better options:

1. Add /usr/local/mysql/lib/mysql to your system's dynamic loader 
configuration.  On Linux, for instance, this is /etc/ld.so.conf; you 
need to run ldconfig after changing that file.


2. Apparently you've installed MySQL from source.  Reconfigure it to 
install the library file in /usr/lib, if that's what you want.  Say 
./configure --help and read.


3. The ProFTPD configure script may have flags you can pass to tell it 
where MySQL is.  If not, you should send them a patch to add it.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: character encoding

2005-08-16 Thread Warren Young

Karima Velasquez wrote:
character is: \ (backslash). 


Of course that will cause problems.  This is the escape character in 
SQL, used extensively when inserting BLOB data.  Again, I believe 
MySQL++ would have prevented this problem, because its escape 
manipulator would have escaped the backslashes.


If you don't want to use MySQL++, then use mysql_escape_string() (or 
mysql_real_escape_string()) in the C API, which MySQL++'s escape 
manipulator is based on.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: character encoding

2005-08-15 Thread Warren Young

Karima Velasquez wrote:


i'm capturing raw audio/video data and want to store it into mysql. in my 
c++ program i create the query to do this, i use sprintf to create this 
query using %s format for the printing.


Um, you are aware that C strings (which sprintf uses) are 
null-terminated, and that nulls will be _everywhere_ in raw video and 
audio data, right?


You need to dig up some sample code on using BLOB columns.  That will 
show you how to insert raw binary data into a table.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: character encoding

2005-08-15 Thread Warren Young

Karima Velasquez wrote:
i know about the null terminating character, but i don't think this is the 
problem. 


It might not be your immediate problem, but you will run into it eventually.


rigth data: 82
wrong data: 

rigth data: ^
wrong data: 


That should only happen if your column is set as a non-binary type, 
which is a bad idea, for the reasons I've pointed out already. 
Character set conversions do not affect binary columns.  See:


http://dev.mysql.com/doc/mysql/en/blob.html

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: character encoding

2005-08-15 Thread Warren Young

Karima Velasquez wrote:
do you know about any sample code on 
using BLOB columns using c++ to create querys???


C++, eh?  I happen to be the MySQL++ maintainer.  Two of its example 
programs, cgi_image and load_file, deal with BLOBs.


http://tangentsoft.net/mysql++/

Notice the automatic escaping, and the use of C++ strings, both of which 
render the null issue irrelevant.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: UTF8 support in MySQL 4.0

2005-08-11 Thread Warren Young

Marco wrote:
So how can I do that? 


There's nothing special you need to do with MySQL itself.  Somehow your 
program obtains UTF-8 data.  Insert said data into database.  That's it.


Perhaps you should read up on UTF-8, to see why this is so.

Again, don't expect the database server to be able to do proper sorting, 
and searching will be tricky.  But it can be made to work.  Ultimately, 
it comes down to whether it's more work to work around these problems, 
or upgrade to v4.1.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQL C API Version incompatibility

2005-08-11 Thread Warren Young

Sujay Koduri wrote:
 
I was connecting to MySQL 5.0.4 through the C API and it was workign fine.

But when I downgraded to MYSQL 4.1.13, the same code is giving the following
error.


Try rebuilding your program against the v4.1 APIs.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: UTF8 support in MySQL 4.0

2005-08-09 Thread Warren Young

Marco wrote:


So is there any solution on how I can properly use foreign characters 
and store them in a MySQL 4.0 database?


You can store UTF-8 in any database in the world.  UTF-8 is compatible 
with any application capable of dealing with null-terminated strings of 
8-bit characters.  That's why it's possible in the Unix/C world, which 
was designed with null-terminated strings of 8-bit characters in mind.


What UTF-8 support gets you is the ability for the database server to do 
things like Unicode-aware collations and such.


But the lack of this feature doesn't prevent you from simply _storing_ 
UTF-8.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: UTF8 support in MySQL 4.0

2005-08-09 Thread Warren Young

Warren Young wrote:
That's why it's possible in the Unix/C world, 


Typo: should be That's why it's _popular_...

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Migration from ORACLE 9i to MySQL

2005-07-28 Thread Warren Young

Johnson, Michael wrote:

MySql is an 8th grade toy.


So why are you here?  Go haunt an Oracle mailing list.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Stored procedures and multi-queries: bug?

2005-07-14 Thread Warren Young
When you have a stored procedure that returns a result set, it seems 
that the server returns its results the same way as with a multi-query. 
 As a result, if you don't set the multi-query option when setting up 
the connection with the C API, the server refuses to return the result 
set.  You get this error:


PROCEDURE foo can't return a result set in the given context

If you set this flag in the mysql_real_connect() call, the stored 
procedure works fine.  But if you set it with mysql_set_server_option(), 
only regular multi-queries work fine; stored procedures returning result 
sets still fail.  According to this manual page:


http://dev.mysql.com/doc/mysql/en/c-api-multiple-queries.html

the two invocations should be equivalent.

Due to the way my program is structured, it is highly inconvenient to 
set this flag in the real_connect call.  I would much rather set it on 
the connection after it is established.


Is there a good reason why the server behaves differently than the 
manual indicates, or is it a bug?


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql cygwin

2005-07-11 Thread Warren Young

Maclen Marvit wrote:

1. The pexports did not find _mysql_server_init 


That function is only needed when using the embedded MySQL server.  It's 
probably an optional configuration setting, so it's no big suprise that 
you don't have that function.  If you're connecting to a separate MySQL 
server, you don't need to call that function.



If this isn't the best way, what is the recommended wayt to use mysql
with g++/gcc and cygwin?


Clearly going with a completely Cygwin-native build is better.  For one 
thing, it will make it easier to debug your crash.


I only pointed out the option of linking to the VC++-built library as 
one option.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Tough queries

2005-06-21 Thread mark warren bracher
David Legault wrote:

 Thanks for the reply, but I think you misinterpreted what I'm looking
 for here.

 For the first query I want to be able to get a row record of (in one
 query possibly)

 team_name for first team (team_id1)
 team_name for second team (team_id2)
 and each of these team points

 for a list of N games retreived (and NULL values for the scores if
 there are no points).


select g.game_id,
   concat( t1.name, ' (', count(p1.point_id), ') - ',
   t2.name, ' (', count(p2.point_id), ')' )
 from games g, teams t1, teams t2, points p1, points p2
 where g.team_id1 = t1.team_id
  and g.team_id2 = t2.team_id
  and g.team_id1 = p1.team_id
  and g.team_id2 = p2.team_id
 group by g.game_id, t1.name, t2.name

you need to include game_id to handle the case where two teams play more
than once, don't want to roll the scoring for the two teams together.

I'm assuming that for game score you're looking for just points scored,
not assists and other stuff.

 Same kind of query for the player stats where I'd retreive these infos
 on each row record :

 player_name
 total goals
 total assists
 total points
 sorted by total points DESC


select p.player_name,
   count( p1.point_id ) as goals,
   count( p2.point_id ) + count( p3.point_id ) as assists,
   count( p1.point_id ) + count( p2.point_id ) + count( p3.point_id
) as points
 from  players p, points p1, points p2, points p3
 where p.player_id = p1.goal_player_id
  and  p.player_id = p2.pass_player_id1
  and  p.player_id = p3.pass_player_id2
 group by p.player_name
 order by 4 desc
 
 
do we need to handle the double-counting case in which the scoring
player also has the first pass?  that starts to get tricky; at that
point I'd start pulling the data and handling it programmatically.

heck, I'd probably handle this programmatically as well, but handling it
in sql made for a nice diversion...  ;-)

how about players with the same name?  john smith or such...  at that
point I suppose you could include player_id in the select, just like I
included game_id above...

note, I haven't actually tested the above.  I'm pretty lazy and didn't
want to make up test data.  I've probably got a typo somewhere, but i
think it's probably pretty close.

- mark

 Thanks

 David

 [EMAIL PROTECTED] wrote:

 Hi,
 for the first query,
 select concat(team_id,' (',sum(points),')') from games,points
 where games.game_id=points.game_id
 and games.team_id1=points.team_id
 group by team_id

 can solve the problem.

 For the second, join players and points.


 Mathias

 Selon David Legault [EMAIL PROTECTED]:


 Hello,

 I'm a regular user of MySQL but lately on a personal project I've run
 into some very complexe query management and am a little bit
 confused on
 how to get it working. This is a hockey league stats website
 application.

 I have 4 tables with the following columns:

 teams - team_id | team_name
 players - player_id | team_id | player_name
 games - game_id | team_id1 | team_id2
 points- point_id | game_id | team_id | goal_player_id |
 pass_player_id1
 | pass_player_id2

 The kind of queries I'd like to perform would be (if possible in one
 query or a subset of queries) something to generate the following as a
 list of N games with the scores (if the game was played and team name)
 which would use the games, teams and points tables.

 Desired Output

 Team A (2) - Team B (7)
 Team D (3) - Team C (1)
 ...

 Thus, it needs to retreive the team names, and total score for each
 game
 that I want to list (using other criteria not essential in the example)

 Another Query would be to have the points of each player listed for a
 team (in ORDER DESC or total points):

 Team C:

 Player | Goals | Assists | Points

 AA 8 1 9
 BB 5 3 8
 CC 3 2 5
 DD 1 2 3
 

 If you could explain a little bit how each query answer you provide
 works, I'd like it. If you have any tutorials or good articles about
 such complexe queries, I'd be thankfull to be able to read them to
 help me.

 Thanks

 David

 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]










-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql cygwin

2005-06-13 Thread Warren Young

Jan Bartholdy wrote:


I want to use a mysql database in a cygwin application (GRASS). Should I
install mysql under cygwin or does exist any possibilities to use the
database with myodbc under cygwin only? Thanks, Jan


I believe people have gotten MySQL to build under Cygwin, but you should 
be aware of another option: Cygwin's build system can link against 
Microsoft C libraries, so you could just use the regular Win32 binary 
distribution and link your program against that.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql cygwin

2005-06-13 Thread Warren Young

[EMAIL PROTECTED] wrote:

If I understand Cygwin correctly, it is a Linux shell that runs under 
Windows. 


Uh, sort of.

Cygwin is a GNU environment ported to Windows.  You've got your bash, 
your GCC, your ls, etc.  To make all this work with minimal porting, 
there's a Cygwin DLL and library that the compiler automatically links 
programs to, which provide POSIX facilities.


Yes, it emulates Linux more closely than any other *ix, but to call it a 
Linux shell is glossing over a lot of things.  It doesn't run Linux 
binaries, for one thing.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How to find random records in a subset?

2005-06-02 Thread Warren Young

Brian Dunning wrote:


But I have to take it one more step: I want to first limit my found  set 
to those matching a different search criteria, and then find 50  of those.


SELECT id FROM bla WHERE whatever

That gets you a list of IDs that match the criteria.  Then select 50 
IDs, and issue the full-record SELECT for those 50.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: unicode and C API

2005-05-24 Thread Warren Young

Patrice Serrand wrote:


mysql_query (mysql, INSERT INTO db_unicode.unicode_tbl VALUES (6, _utf8 
'atüpedâ' COLLATE utf8_general_ci));


I'm no Unicode expert, but I've never seen that _utf8 bit before.  What 
is it?  Or more accurately, what do you expect it to do?  I ask because 
that string is probably already in UTF-8 form, if your text editor is 
UTF-8 aware.  The common Unix text editors are, as is the editor in the 
Visual Studio IDE.


I've done very similar things with MySQL++, the C++ wrapper for the C 
API, which I maintain.  http://tangentsoft.net/mysql++/  No _utf8 stuff 
was required.  Check out examples/resetdb.cpp and examples/custom3.cpp 
in the distribution.



Everything works like if the C API only accepts ANSI strings.


Nonsense.  All the C API cares about are null-terminated C strings, 
which UTF-8 data is.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Connection problem

2005-05-24 Thread Warren Young

razat gupta wrote:


But it gives an exception on the reach of 150 connections.It should
allow us to create almost 500 connection.


Use netstat on the server to find out how many connections are actually 
in use.  You may find that your program is not properly closing down 
connnections, for instance, leaving them in various WAIT states 
(TIME_WAIT, FIN_WAIT1...etc.).  If old connections are not being 
completely cleaned up, they can count against that 500 limit.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



What is mysql_refresh() ?

2005-05-19 Thread Warren Young
I'm the maintainer for MySQL++ (a C++ wrapper for the MySQL C API) and 
while digging through the code I found a reference to mysql_refresh(), 
apparently a C API function.  I can't find documentation for this 
anywhere.  What does it do?

If it's obsolete, I'd like to know that, too.  I'll remove it from 
MySQL++ in that case.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: What is mysql_refresh() ?

2005-05-19 Thread Warren Young
Paul DuBois wrote:
It's not obsolete, just undocumented.
Okay, thanks.  It's documented in MySQL++ now.  :)
(It doesn't say more than that bug DB entry, so I doubt you want a
corresponding MySQL doc patch.)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Stuck with older version of MySQL on RH9, want to install latest, but cant

2005-03-17 Thread Warren Young
Ankur G35 Saxena wrote:
All I had to do was rpm -Uvh --nodeps pkg_name
I have the MySQL AB RPMs running on Red Hat 9 just fine.  I didn't have 
to force them at all.

I suspect you had to force it because you had MySQL installed already. 
The problem is, the Red Hat package is called mysql, whereas the MySQL 
AB package is called MySQL -- they are different names in RPM's view, 
so files named the same in both packages cause a conflict.

If you had uninstalled the old MySQL RPMs and then installed the new 
ones, they wouldn't have required the --nodeps forcing argument.

did the server first, then the libraries and then client
You can give multiple RPM files to the rpm command:
$ rpm -ivh MySQL-*.rpm
You don't have to give the names in any particular order.  The rpm 
program will figure out the correct order to install them.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Server won't stop...

2005-03-17 Thread Warren Young
Jeff Justice wrote:
I'm not sure where I would go to 
change the .bash_profile.  
It's in your home directory.  You land there just by opening a new 
Terminal window.  I suppose if you had to wimp out, you could probably say:

$ TextEdit .bash_profile
But real Unix users don't use GUI text editors.  :)
(I say probably because I don't have an OS X box in front of me at the 
moment.)

You'll probably have to log out and back in for this to take effect.  Or 
reboot.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Report Designer

2004-11-12 Thread Warren Young
Ron Thomas wrote:
What do most people use for a report designer for linux?  
Perl.  :)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: problem retreiving data (mysql++1.7.17)

2004-11-08 Thread Warren Young
David Kinyanjui wrote:
I have a mysql++ question... I'm not sure if this is  right list to post 
to.
It isn't.  The MySQL++ mailing list's home is   

http://lists.mysql.com/plusplus
Well, I just upgraded mysql++ from version 1.7.9 to 1.7.17.
1.7.21 is the current version.  See http://tangentsoft.net/mysql++/
Now, my problem is I don't seem to be getting the collect data from a 
table.
Have you tried the example programs?
if (rs.begin() != rs.end())
That will never be true for any STL or STL-like container.  I think you 
want something like (rs.size()  0).

1. Glib::ustring lastname = row[LastName];
See the ChangeLog for why this does not work.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: problem retreiving data (mysql++1.7.17)

2004-11-08 Thread Warren Young
Warren Young wrote:
if (rs.begin() != rs.end())
That will never be true for any STL or STL-like container.  I think you 
want something like (rs.size()  0).
Sorry, I mean that will _always_ be true.
1. Glib::ustring lastname = row[LastName];
See the ChangeLog for why this does not work.
It's in the v1.7.10 entry, by the way.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: MySQL++ header files

2004-11-03 Thread Warren Young
Spenser wrote:
I'm trying to use the C++ API (a.k.a. MySQL++).  
There's a mailing list dedicated to MySQL++.  If you were subscribed, 
you would have seen the messages announcing the changes that are causing 
you problems.

The on-line manual 
...is badly outdated.
when I downloaded the latest version of
MySQL++ (1.7.19-1 for RedHat 9) from mysql.com, 
Actually, you didn't download it from mysql.com.  You downloaded it from 
my site, tangentsoft.net.  The only resource MySQL AB is giving to 
MySQL++ now is the mailing list.  And redirection from their old links 
to my site, of course.  :)

Has sqlplus.hh been replaced?  
Yes, a fact mentioned in the library's ChangeLog.
 What's the deal?
The deal is that there's a lot of legacy crud in the library dating back 
to the days when MySQL++ was supposed to be some kind of cross-database 
library.  Under my maintainership, this is being excised...MySQL++ has 
always been MySQL-specific, and I am committed to removing any illusion 
to the contrary within the library code.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Query Help

2004-10-26 Thread Keith Warren
I'm converting from LassoMySQL (MySQL 3.23.54) to the current version of
MySQL, and I'm running into a query problem.

(sum(Rush)+sum(Rec)+sum(KO)+sum(Punt)+sum(Inter)+sum(Fum)+sum(BP)) as TDs

Previously, this would produce a valid number. But now, I'm getting NULL.
This is a sports database for a newspaper, and we calculate individual
player stats via MySQL. All of these fields are the different methods a
player can score; rushing, receiving, kick off, punt, etc. So obviously,
some fields will have null values.

It appears that this query in MySQL 4.0.21 doesn't work because there are
null values in some of the fields. How can I get around this?

Thanks

Keith Warren
Systems Editor
The Clarion-Ledger
601-961-7058






-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: on big mysql .MYD files and linux's 2GB file size limit

2004-08-03 Thread Warren Young
David Brodbeck wrote:
Ext2 has not had a 2 gig filesize limit for a long time.  
32-bit file offsets are still the default in Linux on 32-bit systems, so 
these systems will still have the 2GB limit by default.  You have to 
compile your programs with special options to get 64-bit offsets.

I'm certain MySQL does this.  I'm just pointing out that it's just as 
incorrect to say that there is a 2GB limit as to say flat out that there 
is no limit.  The truth is more complicated than either statement.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: MySQL and Unicode

2004-04-09 Thread Warren Young
Pascal Francq wrote:

OK, you use a C char* using an UTF-8 encoding.
That's very commmon in the Unix world.  2-byte encodings are very rare 
on Unix-like systems, for compatibility reasons.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


[4.0] latin1 accented characters and fulltext

2004-03-16 Thread mark warren bracher
I've been playing around with fulltext searching in 4.0, and I ran into 
the following weirdness with accented characters.

| version | 4.0.14 
   | 
character_set   | latin1 

in my entire collection, there is just one row with the keyword 
'angélica' with the accent, several others without.  a fulltext search 
for 'angélica' returns all of them.  it's almost as if mysql knows what 
the base unaccented character is, and is performing some normalization 
before searching.  but I couldn't find this documented anywhere (tried a 
search for 'accented character fulltext', nothing looked relevant).

I don't think I _mind_ the behavior.  In fact it may actually save me 
jumping through some hoops in order to meet functional requirements, but 
I just didn't _expect_ it...

- mark

drop table test_search;
create table test_search (
  artist_id  integer  not null,
  lang_code  char(5)  not null,
  name   varchar(255) not null,
  keywords   varchar(255) not null,
  primary key ( artist_id, lang_code ),
  fulltext ( keywords )
) type=myisam;
insert into test_search values ( 740273, 'en-us', 'Angelica', 'Angelica' );
insert into test_search values ( 783679, 'en-us', 'Angelica Garcia', 
'Angelica Garcia' );
insert into test_search values ( 756774, 'en-us', 'Angélica Vale', 
'Angelica Angélica Vale' );
insert into test_search values ( 751119, 'en-us', 'Electric Junkyard', 
'Electric Junkyard' );
insert into test_search values ( 774590, 'en-us', 'Moncho', 'Moncho' );

select artist_id,lang_code,name,keywords
 FROM  test_search
 WHERE match(keywords) against ('angélica' in boolean mode)
 ORDER BY name asc
+---+---+-++
| artist_id | lang_code | name| keywords   |
+---+---+-++
|740273 | en-us | Angelica| Angelica   |
|783679 | en-us | Angelica Garcia | Angelica Garcia|
|756774 | en-us | Angélica Vale   | Angelica Angélica Vale |
+---+---+-++
3 rows in set (0.00 sec)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: [4.1.1] 1062 errors on non-unique index during data load

2004-02-23 Thread mark warren bracher
Victoria Reznichenko wrote:
[snip]
Could you create repeatable test case (table structure (output of SHOW CREATE TABLE) and text file with data that will be enough to reproduce the above behavior)?
I'll see if I can get something generic to error out.  there's pretty 
much no way I'll be able to send my actual data file though...

- mark

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: [4.1.1] 1062 errors on non-unique index during data load

2004-02-20 Thread mark warren bracher
heh, sometimes the obvious is right in front of you...

I still can't get the full dataset to load with indexes on the table, 
but I _can_ apply indexes after the load.  the indexes apply cleanly, so 
it doesn't seem to have been a data issue.  in any case, I can continue 
prototyping.

it remains to be seen whether this will crop back up during incremental 
update of the already filled (and indexed) table, but I've got a good 
bit of coding to do before I'll have an answer to that question...

- mark

mark warren bracher wrote:
In the last few days I've been doing some prototyping on mysql 4.1.1 
(mainly because I want fulltext indexes against utf-8 data).

I have a table, artists_search_A, in which I want to load ~100K records. 
 My load process will routinely load 14783 records successfully.  After 
14783 inserts, any insert attempt results in a 1062 error, duplicate 
entry; specifically,

Duplicate entry 'en-us' for key 2 error 1062 recorded
[snip]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


[4.1.1] 1062 errors on non-unique index during data load

2004-02-13 Thread mark warren bracher
In the last few days I've been doing some prototyping on mysql 4.1.1 
(mainly because I want fulltext indexes against utf-8 data).

I have a table, artists_search_A, in which I want to load ~100K records. 
 My load process will routinely load 14783 records successfully.  After 
14783 inserts, any insert attempt results in a 1062 error, duplicate 
entry; specifically,

Duplicate entry 'en-us' for key 2 error 1062 recorded

That's on the lang_code column.  Looking through my source data, I have 
precisely 4 distinct lang_codes, and at this point _only_ en-us data 
have been loaded.  The prior 14783 records should not have loaded 
successfully if the index were truly unique.  A quick check in the 
output of 'show index' (pasted below) shows the lang_code index to be 
non-unique.

Out of ~20 separate attempts in the last few days (each time I tweak 
something hoping to find a remedy), in only one case did all the data 
load.  Sadly, I have no idea what was unique about that run.  All other 
attempts bomb out after precisely 14783 records...

Anyone else encountering this?  It sounds a lot like bug 2401

http://bugs.mysql.com/bug.php?id=2401

except that it happens even if no other thread accesses the table during 
the load, and it always occurs after exactly the same number of inserts.

- mark

mysql desc artists_search_A;
+--+--+--+-+-+---+
| Field| Type | Null | Key | Default | Extra |
+--+--+--+-+-+---+
| artist_id| int(11)  |  | PRI | 0   |   |
| lang_code| varchar(5)   |  | PRI | |   |
| name | varchar(128) |  | MUL | |   |
| major_cat| smallint(6)  |  | MUL | 0   |   |
| minor_cat| smallint(6)  |  | MUL | 0   |   |
| events_scheduled | char(1)  |  | MUL | n   |   |
| unmapped | char(1)  | YES  | MUL | NULL|   |
| team | char(1)  | YES  | MUL | NULL|   |
| dma_ids  | varchar(255) | YES  | MUL | NULL|   |
| national_ids | varchar(64)  | YES  | MUL | NULL|   |
| keywords | text | YES  | MUL | NULL|   |
| tmol_modified| timestamp| YES  | | NULL|   |
+--+--+--+-+-+---+
12 rows in set (0.00 sec)
This is the second index on lang_code, snipped from show index...

+--++--+--+--+---+-+--++--++-+
| Table| Non_unique | Key_name | Seq_in_index | 
Column_name  | Collation | Cardinality | Sub_part | Packed | Null | 
Index_type | Comment |
+--++--+--+--+---+-+--++--++-+
| artists_search_A |  0 | PRIMARY  |1 | 
artist_id| A |NULL | NULL | NULL   |  | 
BTREE  | |
| artists_search_A |  0 | PRIMARY  |2 | 
lang_code| A |   14783 | NULL | NULL   |  | 
BTREE  | |
| artists_search_A |  1 | lang_code|1 | 
lang_code| A |NULL | NULL | NULL   |  | 
BTREE  | |
[snip]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Newbie question about stats

2004-02-10 Thread Keith Warren
I want to be able to track how many times any particular record is 
returned from a search, and I have two ideas about how to do this. But 
because I have little experience with MySQL, I may be totally off base.

This database is served on the web via Lasso.

Idea 1. Create an integer field in the table that contains the records 
I want to track, and increment this field each time the data is 
displayed.

Idea 2. Create a new table and create a new record in this table each 
time the record that I want to track is accessed.

Is either of these two ideas a reasonable way to accomplish this goal? 
Is there a better way?

Thanks,
Keith Warren
Systems Editor
The Clarion-Ledger
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


% vs localhost in user.host

2003-12-22 Thread Warren Burstein
I am running mysql  Ver 12.20 Distrib 4.0.13, for pc-linux (i686) on RedHat
6.2 (so shoot me, I'm using an old scratch computer so I won't break
anything on the real development machine)

 

I tried to create a user by inserting directly into mysql.user.  When I set
user.host to localhost, it works, when I set it to % it doesn't.  I thought
% matched anything, and so should match localhost.  In case I've missed
something in the docs, please direct me to the correct page.

 

I ran this, and it worked

--

mysql -u root mysql  EOF

delete from user where user = 'foo';

insert into user (host, user, password) values('localhost', 'foo',
password('bar'));

flush privileges;

EOF

 

mysql -u foo -pbar  EOF

quit

EOF 

--

So then I tried the same thing, just changing localhost to %, and  the
second mysql, where I try to log in as user foo, password bar (I know it's
unsafe to put the password on the command line, this is just for testing)
says

ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)

--

mysql -u root mysql  EOF

delete from user where user = 'foo';

insert into user (host, user, password) values('%', 'foo', password('bar'));

flush privileges;

EOF

 

mysql -u foo -pbar  EOF

quit

EOF

--

So I tried adding this line to after the insert

 

select host, user, password from user where user = 'foo';

 

in case maybe I had botched the insert, or there were other entries in the
user table that messed things up.  Here's what I got (looks OK to me):

 

hostuserpassword

localhost   foo 7c9e0a41222752fa

 

hostuserpassword

%   foo 7c9e0a41222752fa

 

 



automate MSAccess into MySQL

2003-12-04 Thread Warren
Is there a way to automate an export of a single table from a MS Access 
DB into a Temp MySQL DB?

I would like to make a front end that the client can select the correct 
MS Access DB and then the correct table and once those are selected the 
table will be exported into the MySQL DB for my C++ front end to utilize.

Does anyone know how to do this?

Thanks

Warren



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Uninstall binary install of mysql

2003-11-24 Thread Warren Young
Carlos wrote:

 have got no idea how to uninstall it completely off
the system.
You could try something vaguely like this:

# mkdir -p cd /tmp/mysqluninst
# cd /tmp/mysqluninst
# tar xvzf path-to-mysql-bin.tar.gz
# find . -exec rm /{} \;
DO NOT RUN THIS if you do not understand how it functions.  It may 
contain bugs, and I won't be responsible if you blindly run it and it 
eats your filesystem.  Even if you think you know how it functions, you 
should probably replace the 'rm' part of the last command with something 
harmless so you can ensure that it does the right thing before 
re-issuing the command with 'rm' instead.

If you don't understand what I have done above and you are unwilling to 
learn, just disable the mysql server and don't bother erasing its files. 
 It's probably only a few megs of disk space anyway.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Trouble acquiring proper AVG with TIME

2003-10-09 Thread Charles Warren
From: Egor Egorov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: Trouble acquiring proper AVG with TIME
Date: Thu, 9 Oct 2003 17:24:14 +0300
Charles Warren [EMAIL PROTECTED] wrote:

 I've searched the manuals and any websites I can find but am still at a 
loss
 on how to calculate what I thought was going to be an easy 'Average' of 
Call
 Times.

 Situation.  Have a table which is updated daily for users metrics and 
have
 configured one column as TIME which should have the default format (if I
 understand correctly) of HH:MM:SS.

 However when I try to calculate an average for an individual who has the
 following two times listed:

 00:09:15
 00:04:26

 it calculates the average as being 670.5

 The query I'm running is

 SELECT AVG(avg_tt)
 FROM table
 WHERE agent_ln = name

 It is changing the times to 915 + 426 = 1341/2 = 670.5

 Does anyone know what I'm doing wrong?

You should use AVG() with SEC_TO_TIME() and TIME_TO_SEC() functions.



--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



thank you sooo much Egor!!

Finally got it to work with the functions you mentioned.. (think so at 
least.. if there is a better way please let me know.

Used:
SELECT SEC_TO_TIME(AVG(TIME_TO_SEC(AVG_TT))) AS Avg_Talk_Time
FROM table
WHERE agent_ln = name
Came out with an average of 00:06:50  - when using 00:09:15 - 00:04:26

Thanks again!
Chuck
_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Trouble acquiring proper AVG with TIME

2003-10-08 Thread Charles Warren
Hello,

I've searched the manuals and any websites I can find but am still at a loss 
on how to calculate what I thought was going to be an easy 'Average' of Call 
Times.

Situation.  Have a table which is updated daily for users metrics and have 
configured one column as TIME which should have the default format (if I 
understand correctly) of HH:MM:SS.

However when I try to calculate an average for an individual who has the 
following two times listed:

00:09:15
00:04:26
it calculates the average as being 670.5

The query I'm running is

SELECT AVG(avg_tt)
FROM table
WHERE agent_ln = name
It is changing the times to 915 + 426 = 1341/2 = 670.5

Does anyone know what I'm doing wrong?

Much appreciated!!

Chuck

_
Tired of spam? Get advanced junk mail protection with MSN 8.  
http://join.msn.com/?page=features/junkmail

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


confused newbie -- Open Office 1.1 as front end

2003-10-05 Thread Warren Stanley
Hi guys n gals

OK MySQL is nice and robust, i'm stiil new to it and have an M$ Access mentality 
when it come to buiding and working with DBs.

Can i build an example_client table and an example_appointment table in MySQL and 
then use M$ Access(odbc) or data sources in Open Office to create the relationships 
and forms and things to make the DBs usable to the average person?

I haven't found a straight answer yet or even a a clear cut guide. All advice is 
GREATLY APPRECIATED(including what i can't do with this method)!! 

Thanks folks

---
Warren Stanley

Information Technology Support Officer
Bidgerdii Community Health
Rockhampton Q 4700
---

Newbie SQL question

2003-08-11 Thread Warren, Keith
I'm coming from a Filemaker Pro background and have very little SQL experience. I'm 
trying to write an SQL statement to extract data from two tables. One table has the 
Team IDs, Team Names for all the high school football teams in the state. The other 
table has the schedules for all the games. The schedules table has Game_ID, Team_ID, 
Opponent_ID and Game_Date fields.

I've got the SQL statement to return the data that I'm looking for, except, I only get 
team IDs. I want team names.

This is the MySQL statement:

mysql select Teams.Team_Name as 'Team 
Name',Schedules.Team_ID,Schedules.Opponent_ID,Schedules.Game_Date from Schedules,Teams 
where Teams.id=140 and (Teams.id=Schedules.Team_ID or 
Teams.id=Schedules.Opponent_ID) order  by Game_Date;

and here are the results.

+-+-+-++
| Team Name   | Team_ID | Opponent_ID | Game_Date  |
+-+-+-++
| Lawrence County | 140 | 88  | 2003-08-28 |
| Lawrence County | 163 | 140 | 2003-09-05 |
| Lawrence County | 140 | 237 | 2003-09-12 |
| Lawrence County | 140 | 161 | 2003-09-19 |
| Lawrence County | 263 | 140 | 2003-09-26 |
| Lawrence County | 129 | 140 | 2003-10-03 |
| Lawrence County | 153 | 140 | 2003-10-10 |
| Lawrence County | 140 | 284 | 2003-10-17 |
| Lawrence County | 323 | 140 | 2003-10-24 |
| Lawrence County | 140 | 26  | 2003-10-31 |
+-+-+-++
10 rows in set (0.01 sec)

This is exactly what I want, but, I want to be able to query the Teams table to give 
me the Team_Name for both the Team_ID (which is the Home team) and the Team_Name for 
the Opponent_ID (the visiting team).

I'm assuming I'd have to have a nested search, but I really don't even know enough 
about SQL to ask an intellegent question here. Can someone point me in the right 
direction?

Thanks,
Keith Warren
Systems Editor
The Clarion-Ledger

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: FileMaker Pro

2003-07-14 Thread Warren Young
Steve Marquez wrote:
Does anyone know how to export a FileMaker Pro Database so that MySQL can
use it? Anyone ever do something like this?
If you want a one-time transfer, the simple and cheap way is through 
some sort of text file; CVS or tab-delimited, for example.

If you want the two databases to collaborate on a single set of data, 
it's best to give MySQL the canonical copy and let FileMaker manipulate 
it through ODBC.

If the data doesn't change very often, you can use FileMaker's built-in 
ODBC support.  Just write a script to pull a copy of the data you want, 
manipulate it in FileMaker, and then you can export a copy through a 
text file as above.

If the data changes often or you need online manipulation of the data, 
you can add a SQL plugin to FileMaker.  Do a Google search, you'll find 
them.  There are at least two of them on the market, as I recall. 
They're about $100 for a single seat, with site licenses available.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Problems with the api c++

2003-03-19 Thread Warren Young
Tuomas Heroja wrote:
I have red hat 8.0, gcc-3.2-7, gcc-c++-3.2-7 and
mysql++-1.7.9-3.rh8x.i386.rpm. When I use the command
g++ -I/usr/include/sqlplus myfirstdatabaseprogram.cpp, I get
several basic errors concerning the include file sqlplus.hh
Right now, MySQL++ isn't very well tuned for modern C++ environments
like g++ 3.x.  The best thing to do is to download the source code,
apply the two GCC 3.x patches.  You may also wish to search out my 
custom.pl patch on the MySQL++ mailing list or ask me to email it to 
you, because that kills a whole bunch of warnings when building 
custom-macros.hh with g++ 3.x.  (I tried to post it to the list but the 
mailing list software rejects messages with attachments.)

With these patches applied, build and install the library.  You'll get 
some warnings, but don't worry about them.

Next, when building code that uses the library, use the -Wno-deprecated
flag to suppress warnings about uses of old pre-Standard header names
and such.
With all of this in place, you shouldn't be getting any warnings any
more.  If you do, send the compiler output to the list so that those
interested in fixing the problem have enough information to do so.  The 
deprecated C++ warnings will be fixed in 1.8.0, but that won't be out 
for a while yet.

You should send such messages to the MySQL++ mailing list, by the way.
It's a very low-volume list, so don't worry about subscribing to it.
-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Re: FreeBSD + MySQL bottleneck

2003-03-14 Thread Warren W. Gay VE3WWG
Jeremy Zawodny wrote:

On Fri, Mar 14, 2003 at 12:03:14PM -0800, Joe Stump wrote:
 

This may help - I just got this from a friend.
http://jeremy.zawodny.com/blog/archives/000203.html
   

Ugh.

I *really* need to update that.  It has become a popular reference.
But I have some new information to add.
The short version.  If you use LinuxThreads and MySQL 4.0.x (where x
is  4 or so), MySQL/FreeBSD is readlly damned good.  But using
LinuxThreads is a key piece there.  FreeBSD's threading still sucks
and can hamper MySQL.
Jeremy
 

The OP didn't indicate where the files are being kept, and under FreeBSD
this can be significant. I know for example, that using UFS file systems,
are very slow compared to newer file systems. However, I suppose, they
have the trade off that they're perhaps safer in the event of a system
crash. But the disk I/O is much much heavier on a UFS file system, than
on some of the newer systems, like ext3 file systems. UFS seems to
insist on doing writes as soon as possible, to prevent accidental loss of
information due to a crash (just my guess, based upon the experience).
I tried to speed up a very slow PostgreSQL database on UFS once.. I
turned off fsync(2) for the database, and that helped some, but the disk
I/O was still enormously extensive for what was going on.  The same
database under Linux flies (ext3) (with significantly less disk I/O
activity).
I was glad to see the MySQL supports the InnoDB in a partition (raw
disk space). This can eliminate the file system from the equation,
assuming that the necessary caching occurs in either the block device
or in the database engine (using a raw char device).
--
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Table Create Defaults (Type=InnoDB)?

2003-03-03 Thread Warren W. Gay VE3WWG
I would like to create a Table default (Type=InnoDB) for a particular
database.  Is there a way to do this, or is this being planned for in
a future release?  

For most of my databases, I am only interested in transactions. Having
to remember to specify that table type = InnoDB for each table create,
is a nuisance.  I am also trying to keep to SQL standard code.
TIA, Warren.
--
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


missing big5.conf in my sql

2003-01-15 Thread Warren
Dear Sir/ Madam,

I noticed that the character set big5 is missing in the installation file of
My SQL
but the index file indicate that MySQL does have this character set. Is
there a place to
download it?

Please help me. Thank you in advance.

Yours,
Warren




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




  1   2   >