Re: Help with AES_DECRYPT

2004-02-09 Thread Jigal van Hemert
$query = "SELECT date, AES_DECRYPT('cardnumber1','jmbjd'),
AES_DECRYPT('cardnumber2','jmbjd'), AES_DECRYPT('cardnumber3','jmbjd'),
AES_DECRYPT('cardnumber4','jmbjd'), upload_type, z_errors, a_errors,
db_errors FROM customers WHERE refrence_number = '$refnum'";

If 'cardnumber1' is the name of the column you need to decrypt, then the
quotes are wrong!

Either use backticks: `cardnumber1`
or no quotes: cardnumber1

Regards, Jigal.


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



FLUSH error

2004-02-09 Thread Scott Taylor
I've been getting this error in myPhpAdmin.

 Database /mydb/ - table /testing_table/ running on /localhost/

*Error*

SQL-query : 

FLUSH TABLE `testing_table`

MySQL said:

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



My sysadmin said that if you could DROP the table and recreate it that 
you should have full access to the database, including FLUSH.  I have 
been able to successfuly DROP.

He suggested that usually one would get this error if the syntax is 
incorrect.  Can you find any problems with it?

Best Regards,

Scott Taylor

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


Re: 2 datatables 1 db

2004-02-09 Thread Jigal van Hemert
> Eg, I have say mod_calendar_events which is old and 
> mod_mod_calendar_events which is new. How can I combine the the old 
> into the new? I read about union but dont know how to do the query.

Maybe it's easier to run a query like:
INSERT INTO mod_mod_calendar_events SELECT * FROM mod_calendar_events
to copy the data from the old to the new table.

You probably have some tool available to run your own queries.

Regards, Jigal.

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



2 datatables 1 db

2004-02-09 Thread Wayne Mac
Hi, Im running phpwebsite. I installed and then it crashed with dbs 
left untouched. I reinstalled and directed the new install to existing 
dbs. But a new set of data tables were created and phpwebsite now reads 
the new tables which are now empty.

Eg, I have say mod_calendar_events which is old and 
mod_mod_calendar_events which is new. How can I combine the the old 
into the new? I read about union but dont know how to do the query.

What would I write to do this?

Regards, Wayne in Japan

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


Re: Problem with UTF-8 in 4.1.1a [SOLVED]

2004-02-09 Thread Mehran Ziadloo
Thanks Jeremy a lot, it did help.
You were right; I've been entering data correctly. I only could not see it 
the right way. After a little of tests, I finally figured it out how to do 
this and I'm going to tell it here so if any one had my problem, so he can 
use this.


Before saying any of the solution, let me explain the situation. I'm using 
MySQL 4.1.1a-alpha-win and I did not touch any of the configuration files 
(you know, like my.ini). All I did was using queries, and that's big point I 
think since you can not always reach configuration files. I'm trying to 
enter UTF-8 data to data base and retrieve them back, using the new 
capabilities of multi-lingual of the MySQL. These new capabilities contains 
Full-Text search on UTF-8 fields too.
First create a table like this:

CREATE TABLE my_table (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
my_field VARCHAR( 100 ) CHARACTER SET utf8,
);
Entering data is so simple, only a little change is enough; this change is 
to put a "_utf8" before your string:

INSERT INTO my_table (my_field) VALUES ( _utf8 'string_encoded_in_utf8' );

After that, when you want to retrieve data from data base, there it comes 
the problem that took me a week. After you made the connection to data base 
and before executing your select query, use the following query:

SET CHARACTER SET utf8;

And then, with the same connection, run your select query like this:

SELECT my_field FROM my_table;

Which is an ordinary one, of course.
That was all.

The only problem with this solution is that "SET CHARACTER SET" query can 
not be run before select query always. I mean consider interfaces like 
phpMyAdmin, in a web host they won't let you change its code, neither the 
configuration files of MySQL. Then how can we make MySQL to translate 
strings to UTF-8? There is a one way and that's making it the default 
character set which completely make sense since it's an international 
character set. But I'm sure it's up to MySQL's sponsors.

Thank you Jeremy, it was all your help. You found me after I've been lost.
Mehran Ziadloo
_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
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]


SQL SECURITY

2004-02-09 Thread K Sunil
Hi,

I have created a stored procedure in mysql with definer sql
security.
If there is another user 'X' how to give him the invoker rights
in the procedures itself.


Thanks and Regards,
Sunil.K


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



A "current row updating" counter for a mass "Update" or similar?

2004-02-09 Thread admin
Hi all, I'll just get straight to the problem (simplified):

Say I have the following table/columns:
ID, Score, Rank
1, 20, 0
2, 50, 0
3, 10, 0
4, 5, 0
5, 97, 0

Is it possible, in a single query (using sub-queries if necessary), to give
all of these "ID's" the correct rank... ie if such a thing existed it might
look like:

UPDATE table_name SET rank=(current_row_updating+1) ORDER BY score DESC;

Which would, you'd hope, make the table data then read:
ID, Score, Rank
1, 20, 3
2, 50, 2
3, 10, 4
4, 5, 5
5, 97, 1

But I could find no nice looking commands that would give me this (perhaps
that is not possible due to the nature of the database structure and the
nature of updating? Though there must be some counter for it to report back
with how many rows matched, how many were updated etc.).

I also tried with a sub-query which the equivalent for the above example
might look something like:

UPDATE table_name SET rank=(SELECT COUNT(*) FROM table_name AS t2 WHERE
t2.score>table_name.score);

But couldn't seem to make it work - I received MySQL error messages with my
attempts, I think possibly because I am trying to use the table I am trying
to update to also pull select data from during the update - and it'd need a
little adding to it anyway - if scores were equal, it'd want to default to
lower ID number "wins" the higher rank.

I can't seem to find any obvious nice way of doing this, other than the poor
method of looping/iterating through with an "Ordered" select, and then
sending individual "UPDATES" for each and every row received by the select
(which in the above simplified example would be 6 query calls - 1 to get the
select, followed by 5 seperate updates sent by PHP using PHP to know what
"rank #" we were currently on).

Thanks in advance, I hope somebody can point me to a possible solution of
getting all of this with a single query as I have attempted, I'd appreciate
any help on this matter.



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



Re: Automatic conversion from `char` TO `varchar`

2004-02-09 Thread Matt Fagan
OK, this will be my last post on this topic. Mainly I want
to point out that I was taking the wrong conclusions from
the results of my tests. I followed the advice of Michael
Stassen and ran some more tests using int columns for joins
and got pretty much the same trend. So I guess the real
answer is that joins between static tables are faster than
joins between dynamic tables (by about 20% for the int
column join). I guess this is what the MySQL manual is
talking about (and other people who posted the same thing
to this thread).

Matt Fagan
[EMAIL PROTECTED]

http://greetings.yahoo.com.au - Yahoo! Greetings
Send your love online with Yahoo! Greetings - FREE!

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



Help with AES_DECRYPT

2004-02-09 Thread John DellaPia
Hey,
I am currently having alot of trouble using the AES_DECRYPT function. Can anyone 
explain to me where I am going wrong. I can get the inserts to work, but I cannot 
retrive the decoded string with the following Select statement:
$query = "SELECT date, AES_DECRYPT('cardnumber1','jmbjd'), 
AES_DECRYPT('cardnumber2','jmbjd'), AES_DECRYPT('cardnumber3','jmbjd'), 
AES_DECRYPT('cardnumber4','jmbjd'), upload_type, z_errors, a_errors, db_errors FROM 
customers WHERE refrence_number = '$refnum'";

I am using the same exact key during the insert statement and my column is of blob 
type.
Is my syntax wrong? Please help.
Thanks in advance.
JD


John A Della Pia
Intranet Application Developer
Systems Administrator
WiFiLand
877 WiFi LAND Ext.850 
http://www.WiFiLand.net
Free to be...


Re: There has to be a way to do this

2004-02-09 Thread Ryan Yagatich

Ignore this as aparently someone already posted almost the exact same 
thing :)

Thanks,
Ryan Yagatich

,_,
\ Ryan Yagatich [EMAIL PROTECTED] \
/ Pantek Incorporated  (877) LINUX-FIX /
\ http://www.pantek.com/security(440) 519-1802 \
/   Are your networks secure? Are you certain? /
\___F49F3365CFC4F2613AD204C58E50C1AD73F23DC722666BD4___\

On Mon, 9 Feb 2004, Ryan Yagatich wrote:

>
>Try something like this:
>
>MYSQLSTRING="/usr/local/mysql/bin/mysql -u $username -p $password -h $server 
>cetechnology"
>RESQUERY="SELECT COUNT(*) FROM hardware_assets WHERE 
>ethernet_address='$ethernet_address'"
>RESULT=`echo "$RESQUERY;" | $MYSQLSTRING`
>INSERTQUERY="INSERT INTO hardware_assets (ethernet_address) VALUES 
>($ethernet_address)"
>UPDATEQUERY="UPDATE hardware_assets SET Operating_system='10.3.3'"
>if [ $result -eq 0 ]; then
>   echo "$INSERTQUERY;" | $MYSQLSTRING
>else
>   echo "$UPDATEQUERY;" | $MYSQLSTRING
>fi
>
>
>Thanks,
>Ryan Yagatich
>
>,_,
>\ Ryan Yagatich [EMAIL PROTECTED] \
>/ Pantek Incorporated  (877) LINUX-FIX /
>\ http://www.pantek.com/security(440) 519-1802 \
>/   Are your networks secure? Are you certain? /
>\___F49F3365CFC4F2613AD204C58E50C1AD73F23DC722666BD4___\
>
>On Mon, 9 Feb 2004, Mike Tuller wrote:
>
>>I changed my script to this:
>>
>>/usr/local/mysql/bin/mysql  --user=$username --password=$password
>>--host=$server 
>>
>>RESULT=`echo "select count(*) from hardware_assets where
>>ethernet_address='$ethernet_address'" | cetechnology'
>>if [ "$RESULT" = "0" ] ; then
>>echo "INSERT INTO hardware_assets (ethernet_address) VALUES
>>($ethernet_address);"
>>else
>>echo "UPDATE hardware_assets SET operating_system='10.3.3';"
>>fi
>>
>>Where cetechnology is the database. All the variables are set.
>>
>>When I run this, it starts the mysql client application,  with the mysql>
>>prompt. Nothing is inserted or updated in the database though.
>>
>>This is the same problem I had when I tried to do it this way, but I am not
>>knowledgeable in shell scripting yet to know what I am doing wrong.
>>
>>
>>
>>
>>> From: gerald_clark <[EMAIL PROTECTED]>
>>> Date: Mon, 09 Feb 2004 11:11:24 -0600
>>> To: Mike Tuller <[EMAIL PROTECTED]>
>>> Cc: MySql List <[EMAIL PROTECTED]>
>>> Subject: Re: There has to be a way to do this
>>> 
>>> IF works on the selections not on the query.
>>> Select  IF(lastname='clark','Correct',''Incorrect'), firstname from
>>> namefile;
>>> 
>>> You need to do the checking in your script.
>>> For example in bash:
>>> RESULT=`echo "select count(*) from manefile where lastname='clark'" |
>>> mysql database`
>>> if [ "$RESULT" = "0" ] ; then
>>>   echo "insert into namefile ...
>>> else
>>>   echo "update namefile ..
>>> fi
>>> 
>>> 
>>> Mike Tuller wrote:
>>> 
 I have posted this question a few times, and have not seen the answer that I
 need.
 
 I have a shell script, that gathers information from systems, and I want
 that info to be entered into a database. I want it to check first to see if
 the data is already entered, and if not, add it. If it has already been
 entered, then update the record.
 
 I would think that some type of if/else statement would work, but I can't
 get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to work
 correctly in MySql.
 
 Here is what I have:
 
 "IF SELECT * FROM hardware_assets WHERE ethernet_address='$ethernet_address'
 IS NULL\
THEN INSERT into hardware_assets (ethernet_address) VALUES
 ($ethernet_address)\
 ELSE\
UPDATE hardware_assets SET operating_system='10.3.3'\
 END IF;"
 
 I get back that I have an error in my SQL syntax. $ethernet_address is set,
 so that is not my problem.
 
 Does anyone know a way to go about this in SQL, or in a shell script? I
 don't want to do it in Perl or PHP.
 
 
 Thanks,
 Mike
 
 
  
 
>>> 
>>> 
>>> 
>>> -- 
>>> 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]



Foreign Key Reference to a VARCHAR

2004-02-09 Thread Sven Woltmann
Hi,

I hope this is not a well known problem since I just signed up to this list.  But I 
checked the February archive and couldn't find anything on this.

I was trying for a couple of hours now to create a foreign key reference on a varchar 
field:

CREATE TABLE users
(
loginVARCHAR(20)  NOT NULL,
password VARCHAR(20)  NOT NULL,
email_addressVARCHAR(100) NOT NULL,
--
PRIMARY KEY(login),
INDEX(email_address)
)
TYPE = InnoDB;

create table email_alias
(
aliasVARCHAR(100) NOT NULL,
email_addressVARCHAR(100) NOT NULL,
--
PRIMARY KEY(alias),
INDEX(email_address),
FOREIGN KEY (email_address) references users(email_address)
)
TYPE = InnoDB;

Actually my tables were a lot bigger, but I stripped them down to these short tables 
to resolve my problem, which is:

When creating the second table, I get the error message:
ERROR 1005 (HY000): Can't create table './test/email_alias.frm' (errno: 150)

I admit, the first time I didn't put an INDEX on email_address.  I figured that out 
quite fast.  Then I searched again in the Newsgroups and did a SHOW INNODB STATUS.  I 
got the following message:

"Cannot find an index in the referenced table where the referenced columns appear as 
the first columns [...]"

Well - this didn't help at all :(  So I changed my table definitions a hundred times 
to find out what exactly the problem was.  And after hours, I found out:

The VARCHAR must not be longer than 85 characters.  If you replace the "100" in the 
example above by a "85", IT WORKS!!!

So... have I missed the fine print in the documentation or did I actually find a bug?

Here's my configuration:  

- 4.1.1-alpha-standard-log
- Official MySQL-standard binary
- i686
- pc-linux (debian 3.0 woody)

Sven



Schlund + Partner AG
Brauerstraße 48
76135 Karlsruhe

Dipl.-Inf. Sven Woltmann   
[EMAIL PROTECTED]  
http://www.schlund.de 


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



Re: HOW TO RUN SQL

2004-02-09 Thread KKoTY
hi, to run a sql script from mysql shell just use command "source
your_sql_script.sql"
if you want to run it directly from prompt use this

mysql --force -uusername -ppassword -e"source your_sql_script.sql"



- Original Message -
From: "Seena Blace" <[EMAIL PROTECTED]>
To: "Remko Lodder" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 11:10 PM
Subject: HOW TO RUN SQL


> how to run sql script like
> if i have mysql prompt
> mysql >
> at above prompt I want to run sql script. how to do this? what will be
extenstion of file?
>
> Remko Lodder <[EMAIL PROTECTED]> wrote:
> mysql -p
>  -u -e
>
> that can be runned from any shell script.
>
> use enum to check Y/N TRUE/FALSE etc.
>
> CREATE TABLE testtest (
> test ENUM( 'TRUE', 'FALSE' ) NOT NULL
> );
>
>
> it automaticly sets true as default value with me.
> otherwise add:
>
> DEFAULT 'FALSE'
>
> after not null
>
> Hope this helps
> --
>
> Kind regards,
>
> Remko Lodder
> Elvandar.org/DSINet.org
> www.mostly-harmless.nl Dutch community for helping newcomers on the
> hackerscene
> mrtg.grunn.org Dutch mirror of MRTG
>
> -Oorspronkelijk bericht-
> Van: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Seena Blace
> Verzonden: maandag 9 februari 2004 22:14
> Aan: [EMAIL PROTECTED]
> Onderwerp: [Mysql-discussions] HOW TO RUN SQL and default value ?
>
>
> Hi,
> How to run script at mysql prompt?
> Like if i want to create a table or select some query and I want to put
> those sql statement into one file ,how to run that and what would be the
> extention of that query?
> I want to create on column which contains only default value TRUE or
> False.how to do that?
> Create table test1 (no int, flag char (6) default ...
> thx -seena
>
>
>
> -
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>
>
> -
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online


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



Re: There has to be a way to do this

2004-02-09 Thread Ryan Yagatich

Try something like this:

MYSQLSTRING="/usr/local/mysql/bin/mysql -u $username -p $password -h $server 
cetechnology"
RESQUERY="SELECT COUNT(*) FROM hardware_assets WHERE 
ethernet_address='$ethernet_address'"
RESULT=`echo "$RESQUERY;" | $MYSQLSTRING`
INSERTQUERY="INSERT INTO hardware_assets (ethernet_address) VALUES ($ethernet_address)"
UPDATEQUERY="UPDATE hardware_assets SET Operating_system='10.3.3'"
if [ $result -eq 0 ]; then
echo "$INSERTQUERY;" | $MYSQLSTRING
else
echo "$UPDATEQUERY;" | $MYSQLSTRING
fi


Thanks,
Ryan Yagatich

,_,
\ Ryan Yagatich [EMAIL PROTECTED] \
/ Pantek Incorporated  (877) LINUX-FIX /
\ http://www.pantek.com/security(440) 519-1802 \
/   Are your networks secure? Are you certain? /
\___F49F3365CFC4F2613AD204C58E50C1AD73F23DC722666BD4___\

On Mon, 9 Feb 2004, Mike Tuller wrote:

>I changed my script to this:
>
>/usr/local/mysql/bin/mysql  --user=$username --password=$password
>--host=$server 
>
>RESULT=`echo "select count(*) from hardware_assets where
>ethernet_address='$ethernet_address'" | cetechnology'
>if [ "$RESULT" = "0" ] ; then
>echo "INSERT INTO hardware_assets (ethernet_address) VALUES
>($ethernet_address);"
>else
>echo "UPDATE hardware_assets SET operating_system='10.3.3';"
>fi
>
>Where cetechnology is the database. All the variables are set.
>
>When I run this, it starts the mysql client application,  with the mysql>
>prompt. Nothing is inserted or updated in the database though.
>
>This is the same problem I had when I tried to do it this way, but I am not
>knowledgeable in shell scripting yet to know what I am doing wrong.
>
>
>
>
>> From: gerald_clark <[EMAIL PROTECTED]>
>> Date: Mon, 09 Feb 2004 11:11:24 -0600
>> To: Mike Tuller <[EMAIL PROTECTED]>
>> Cc: MySql List <[EMAIL PROTECTED]>
>> Subject: Re: There has to be a way to do this
>> 
>> IF works on the selections not on the query.
>> Select  IF(lastname='clark','Correct',''Incorrect'), firstname from
>> namefile;
>> 
>> You need to do the checking in your script.
>> For example in bash:
>> RESULT=`echo "select count(*) from manefile where lastname='clark'" |
>> mysql database`
>> if [ "$RESULT" = "0" ] ; then
>>   echo "insert into namefile ...
>> else
>>   echo "update namefile ..
>> fi
>> 
>> 
>> Mike Tuller wrote:
>> 
>>> I have posted this question a few times, and have not seen the answer that I
>>> need.
>>> 
>>> I have a shell script, that gathers information from systems, and I want
>>> that info to be entered into a database. I want it to check first to see if
>>> the data is already entered, and if not, add it. If it has already been
>>> entered, then update the record.
>>> 
>>> I would think that some type of if/else statement would work, but I can't
>>> get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to work
>>> correctly in MySql.
>>> 
>>> Here is what I have:
>>> 
>>> "IF SELECT * FROM hardware_assets WHERE ethernet_address='$ethernet_address'
>>> IS NULL\
>>>THEN INSERT into hardware_assets (ethernet_address) VALUES
>>> ($ethernet_address)\
>>> ELSE\
>>>UPDATE hardware_assets SET operating_system='10.3.3'\
>>> END IF;"
>>> 
>>> I get back that I have an error in my SQL syntax. $ethernet_address is set,
>>> so that is not my problem.
>>> 
>>> Does anyone know a way to go about this in SQL, or in a shell script? I
>>> don't want to do it in Perl or PHP.
>>> 
>>> 
>>> Thanks,
>>> Mike
>>> 
>>> 
>>>  
>>> 
>> 
>> 
>> 
>> -- 
>> 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: Admin Question

2004-02-09 Thread Ryan Yagatich
Ronan,
The command you are looking for is 'SHOW PROCESSLIST' or 'SHOW 
FULL PROCESSLIST'. Additionally, take a look at 'mytop', which you can 
find at http://jeremy.zawodny.com/mysql/mytop/


mytop - a top clone for MySQL
mytop is a console-based (non-gui) tool for monitoring the threads and 
overall performance of MySQL 3.22.x, 3.23.x, and 4.x servers. It runs on 
most Unix systems (including Mac OS X) which have Perl, DBI, and 
Term::ReadKey installed. And with Term::ANSIColor installed you even get 
color. If you install Time::HiRes, you'll get good real-time 
queries/second stats. As of version 0.7, it even runs on Windows 
(somewhat).


Thanks,
Ryan Yagatich

,_,
\ Ryan Yagatich [EMAIL PROTECTED] \
/ Pantek Incorporated  (877) LINUX-FIX /
\ http://www.pantek.com/security(440) 519-1802 \
/   Are your networks secure? Are you certain? /
\___F49F3365CFC4F2613AD204C58E50C1AD73F23DC722666BD4___\

On Mon, 9 Feb 2004, Ronan Lucio wrote:

>Hello,
>
>We have an MySQL-4.0.14 Server installed and sometimes the
>it takes 90% from CPU.
>
>So, my question is:
>Is there a way to know what is taking so many CPU process?
>What query is causing such problem?
>
>Thanks
>Ronan
>
>
>
>


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



RE: HOW TO RUN SQL

2004-02-09 Thread Remko Lodder
if you want to do sql scripting
then i suggest you use  a  bash script with the settings i provided to you

oh If you are able to, please don't use HTML mail thanks
cheers



--

Kind regards,

Remko Lodder
Elvandar.org/DSINet.org
www.mostly-harmless.nl Dutch community for helping newcomers on the
hackerscene

mrtg.grunn.org Dutch mirror of MRTG
-Oorspronkelijk bericht-
Van: Seena Blace [mailto:[EMAIL PROTECTED]
Verzonden: maandag 9 februari 2004 23:11
Aan: Remko Lodder; [EMAIL PROTECTED]
Onderwerp: HOW TO RUN SQL


how to run sql script like
if i have mysql prompt
mysql >
at above prompt I want to run sql script. how to do this? what will be
extenstion of file?

Remko Lodder <[EMAIL PROTECTED]> wrote:
mysql -p -u -e

that can be runned from any shell script.

use enum to check Y/N TRUE/FALSE etc.

CREATE TABLE testtest (
test ENUM( 'TRUE', 'FALSE' ) NOT NULL
);


it automaticly sets true as default value with me.
otherwise add:

DEFAULT 'FALSE'

after not null

Hope this helps
--

Kind regards,

Remko Lodder
Elvandar.org/DSINet.org
www.mostly-harmless.nl Dutch community for helping newcomers on the
hackerscene
mrtg.grunn.org Dutch mirror of MRTG

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Seena Blace
Verzonden: maandag 9 februari 2004 22:14
Aan: [EMAIL PROTECTED]
Onderwerp: [Mysql-discussions] HOW TO RUN SQL and def ault value ?


Hi,
How to run script at mysql prompt?
Like if i want to create a table or select some query and I want to put
those sql statement into one file ,how to run that and what would be the
extention of that query?
I want to create on column which contains only default value TRUE or
False.how to do that?
Create table test1 (no int, flag char (6) default ...
thx -seena



-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online


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



Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online


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



HOW TO RUN SQL

2004-02-09 Thread Seena Blace
how to run sql script like
if i have mysql prompt 
mysql > 
at above prompt I want to run sql script. how to do this? what will be extenstion of 
file?

Remko Lodder <[EMAIL PROTECTED]> wrote:
mysql -p
 -u -e 

that can be runned from any shell script.

use enum to check Y/N TRUE/FALSE etc.

CREATE TABLE testtest (
test ENUM( 'TRUE', 'FALSE' ) NOT NULL
);


it automaticly sets true as default value with me.
otherwise add:

DEFAULT 'FALSE'

after not null

Hope this helps
--

Kind regards,

Remko Lodder
Elvandar.org/DSINet.org
www.mostly-harmless.nl Dutch community for helping newcomers on the
hackerscene
mrtg.grunn.org Dutch mirror of MRTG

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Seena Blace
Verzonden: maandag 9 februari 2004 22:14
Aan: [EMAIL PROTECTED]
Onderwerp: [Mysql-discussions] HOW TO RUN SQL and default value ?


Hi,
How to run script at mysql prompt?
Like if i want to create a table or select some query and I want to put
those sql statement into one file ,how to run that and what would be the
extention of that query?
I want to create on column which contains only default value TRUE or
False.how to do that?
Create table test1 (no int, flag char (6) default ...
thx -seena



-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online


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


-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: There has to be a way to do this

2004-02-09 Thread Mike Tuller
When I run this, it always updates the record, not matter what the value for
$ethernet_address is. I have tested this by changing the line under else to
echo "Update" Every time the script is run, it comes back with update.

I then we back and commented out the whole if/else statement and had only
the line for RESULT=, and then did echo $RESULT. It returns nothing. Not a 0
or a 1, nothing.

> From: gerald_clark <[EMAIL PROTECTED]>
> Date: Mon, 09 Feb 2004 14:28:27 -0600
> To: Mike Tuller <[EMAIL PROTECTED]>
> Cc: MySql List <[EMAIL PROTECTED]>
> Subject: Re: There has to be a way to do this
> 
> This is NOT a script that can run under mysql.
> It  is a bash script that calls mysql.
> 
> MYSQL="/usr/local/mysql/bin/mysql  --user=$username --password=$password
> --host=$server cetechnology"
> 
> RESULT=`echo "select count(*) from hardware_assets where
> ethernet_address='$ethernet_address'" | $MYSQL
> if [ "$RESULT" = "0" ] ; then
>   echo "INSERT INTO hardware_assets (ethernet_address) VALUES
> ($ethernet_address);" |$MYSQL
> else
>   echo "UPDATE hardware_assets SET operating_system='10.3.3';" | $MYSQL
> fi
> 
> 
> Mike Tuller wrote:
> 
>> I changed my script to this:
>> 
>> /usr/local/mysql/bin/mysql  --user=$username --password=$password
>> --host=$server 
>> 
>> RESULT=`echo "select count(*) from hardware_assets where
>> ethernet_address='$ethernet_address'" | cetechnology'
>> if [ "$RESULT" = "0" ] ; then
>>echo "INSERT INTO hardware_assets (ethernet_address) VALUES
>> ($ethernet_address);"
>> else
>>echo "UPDATE hardware_assets SET operating_system='10.3.3';"
>> fi
>> 
>> Where cetechnology is the database. All the variables are set.
>> 
>> When I run this, it starts the mysql client application,  with the mysql>
>> prompt. Nothing is inserted or updated in the database though.
>> 
>> This is the same problem I had when I tried to do it this way, but I am not
>> knowledgeable in shell scripting yet to know what I am doing wrong.
>> 
>> 
>> 
>> 
>>  
>> 
>>> From: gerald_clark <[EMAIL PROTECTED]>
>>> Date: Mon, 09 Feb 2004 11:11:24 -0600
>>> To: Mike Tuller <[EMAIL PROTECTED]>
>>> Cc: MySql List <[EMAIL PROTECTED]>
>>> Subject: Re: There has to be a way to do this
>>> 
>>> IF works on the selections not on the query.
>>> Select  IF(lastname='clark','Correct',''Incorrect'), firstname from
>>> namefile;
>>> 
>>> You need to do the checking in your script.
>>> For example in bash:
>>> RESULT=`echo "select count(*) from manefile where lastname='clark'" |
>>> mysql database`
>>> if [ "$RESULT" = "0" ] ; then
>>>  echo "insert into namefile ...
>>> else
>>>  echo "update namefile ..
>>> fi
>>> 
>>> 
>>> Mike Tuller wrote:
>>> 
>>>
>>> 
 I have posted this question a few times, and have not seen the answer that
 I
 need.
 
 I have a shell script, that gathers information from systems, and I want
 that info to be entered into a database. I want it to check first to see if
 the data is already entered, and if not, add it. If it has already been
 entered, then update the record.
 
 I would think that some type of if/else statement would work, but I can't
 get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to work
 correctly in MySql.
 
 Here is what I have:
 
 "IF SELECT * FROM hardware_assets WHERE
 ethernet_address='$ethernet_address'
 IS NULL\
   THEN INSERT into hardware_assets (ethernet_address) VALUES
 ($ethernet_address)\
 ELSE\
   UPDATE hardware_assets SET operating_system='10.3.3'\
 END IF;"
 
 I get back that I have an error in my SQL syntax. $ethernet_address is set,
 so that is not my problem.
 
 Does anyone know a way to go about this in SQL, or in a shell script? I
 don't want to do it in Perl or PHP.
 
 
 Thanks,
 Mike
 
 
 
 
  
 
>>> 
>>> -- 
>>> 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: LEFT JOIN to a table using 2 keys from different tables

2004-02-09 Thread Brent Baisley
It's tough to answer your question without seeing your actual table 
structure. You can use AND in a join:
SELECT * FROM a1 LEFT JOIN b1 ON a1.f1=b1.f1 AND a1.f2=b1.f2

In you example query, MySQL will try to do the LEFT JOIN first (I'm 
pretty sure), which is not what you what. But if you change it to a 
RIGHT JOIN, it will do it last, which is what I think you are looking 
for. The LEFT and RIGHT join syntax are exactly the same.

On Feb 9, 2004, at 3:47 PM, David Perron wrote:

Is there a way to do this?  Im trying to LEFT JOIN to a table that 
needs to
select based on 2 keys, but the query Im writing only has the keys
individually in two separate tables, like this.
The documentation shows how to do this when you are using 2 keys from 
both
tables, but not 1 key from 1 table and another key from another table
combined.
http://www.mysql.com/doc/en/JOIN.html

SELECT
FROM
t1,
INNER JOIN t2 on (c1)
INNER JOIN t3 on (c2)
LEFT JOIN t4 on (c1,c2)
Thanks!

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


question about replication

2004-02-09 Thread Liying Huang
Hi,

I tried to create replication. I have edited my.cnf on master and slave side. 

Grant necessary privileges on master side, then start both servers, when I update

 the database in master side, I could see the query showed up in ***-bin.001, 

and it is passed to slave side successfully, shown in ***-bin.001, but database 

doesn't reflect the change. I have checked status, "slave running" is on,  check 

slave status, slave_IO_Running and Slave_SQL_Running both are 'yes', 

What could be possibly wrong or what shall I do to make the database updating?

Appreciated any help.

Liying




RE: [Mysql-discussions] HOW TO RUN SQL and default value ?

2004-02-09 Thread Remko Lodder
mysql -p -u  -e 

that can be runned from any shell script.

use enum to check Y/N TRUE/FALSE etc.

CREATE TABLE testtest (
test ENUM( 'TRUE', 'FALSE' ) NOT NULL
);


it automaticly sets true as default value with me.
otherwise add:

DEFAULT 'FALSE'

after not null

Hope this helps
--

Kind regards,

Remko Lodder
Elvandar.org/DSINet.org
www.mostly-harmless.nl Dutch community for helping newcomers on the
hackerscene
mrtg.grunn.org Dutch mirror of MRTG

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Seena Blace
Verzonden: maandag 9 februari 2004 22:14
Aan: [EMAIL PROTECTED]
Onderwerp: [Mysql-discussions] HOW TO RUN SQL and default value ?


Hi,
How to run script at mysql prompt?
Like if i want to create a table or select some query and I want to put
those sql statement into one file ,how to run that and what would be the
extention of that query?
I want to create on column which contains only default value TRUE or
False.how to do that?
Create table test1 (no int, flag char (6) default ...
thx -seena



-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online


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



HOW TO RUN SQL and default value ?

2004-02-09 Thread Seena Blace
Hi,
How to run script at mysql prompt?
Like if i want to create a table or select some query and I want to put those sql 
statement into one file ,how to run that and what would be the extention of that query?
I want to create on column which contains only default value TRUE or False.how to do 
that? 
Create table test1 (no int, flag char (6) default ...
thx -seena
 


-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: LEFT JOIN to a table using 2 keys from different tables

2004-02-09 Thread Jack McKinney
Not sure if this is what you are asking, but how about:

SELECT *
FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c2

Big Brother tells me that David Perron wrote:
> 
> Is there a way to do this?  Im trying to LEFT JOIN to a table that needs to
> select based on 2 keys, but the query Im writing only has the keys
> individually in two separate tables, [...]

-- 
"What we observe is not nature itself, but nature  Jack McKinney
 exposed to our method of questioning. http://www.lorentz.com
 -Werner Karl Heisenberg   [EMAIL PROTECTED]
   1024D/D6056304 4096g/1D649CB4
2004 Chicago Cubs magic number: 163


pgp0.pgp
Description: PGP signature


LEFT JOIN to a table using 2 keys from different tables

2004-02-09 Thread David Perron

Is there a way to do this?  Im trying to LEFT JOIN to a table that needs to
select based on 2 keys, but the query Im writing only has the keys
individually in two separate tables, like this.
The documentation shows how to do this when you are using 2 keys from both
tables, but not 1 key from 1 table and another key from another table
combined.
http://www.mysql.com/doc/en/JOIN.html

SELECT
FROM
t1,
INNER JOIN t2 on (c1)
INNER JOIN t3 on (c2)
LEFT JOIN t4 on (c1,c2)

Thanks!


Re: There has to be a way to do this

2004-02-09 Thread gerald_clark
This is NOT a script that can run under mysql.
It  is a bash script that calls mysql.
MYSQL="/usr/local/mysql/bin/mysql  --user=$username --password=$password
--host=$server cetechnology" 

RESULT=`echo "select count(*) from hardware_assets where
ethernet_address='$ethernet_address'" | $MYSQL
if [ "$RESULT" = "0" ] ; then
   echo "INSERT INTO hardware_assets (ethernet_address) VALUES
($ethernet_address);" |$MYSQL
else
   echo "UPDATE hardware_assets SET operating_system='10.3.3';" | $MYSQL
fi
Mike Tuller wrote:

I changed my script to this:

/usr/local/mysql/bin/mysql  --user=$username --password=$password
--host=$server 

RESULT=`echo "select count(*) from hardware_assets where
ethernet_address='$ethernet_address'" | cetechnology'
if [ "$RESULT" = "0" ] ; then
   echo "INSERT INTO hardware_assets (ethernet_address) VALUES
($ethernet_address);"
else
   echo "UPDATE hardware_assets SET operating_system='10.3.3';"
fi
Where cetechnology is the database. All the variables are set.

When I run this, it starts the mysql client application,  with the mysql>
prompt. Nothing is inserted or updated in the database though.
This is the same problem I had when I tried to do it this way, but I am not
knowledgeable in shell scripting yet to know what I am doing wrong.


 

From: gerald_clark <[EMAIL PROTECTED]>
Date: Mon, 09 Feb 2004 11:11:24 -0600
To: Mike Tuller <[EMAIL PROTECTED]>
Cc: MySql List <[EMAIL PROTECTED]>
Subject: Re: There has to be a way to do this
IF works on the selections not on the query.
Select  IF(lastname='clark','Correct',''Incorrect'), firstname from
namefile;
You need to do the checking in your script.
For example in bash:
RESULT=`echo "select count(*) from manefile where lastname='clark'" |
mysql database`
if [ "$RESULT" = "0" ] ; then
 echo "insert into namefile ...
else
 echo "update namefile ..
fi
Mike Tuller wrote:

   

I have posted this question a few times, and have not seen the answer that I
need.
I have a shell script, that gathers information from systems, and I want
that info to be entered into a database. I want it to check first to see if
the data is already entered, and if not, add it. If it has already been
entered, then update the record.
I would think that some type of if/else statement would work, but I can't
get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to work
correctly in MySql.
Here is what I have:

"IF SELECT * FROM hardware_assets WHERE ethernet_address='$ethernet_address'
IS NULL\
  THEN INSERT into hardware_assets (ethernet_address) VALUES
($ethernet_address)\
ELSE\
  UPDATE hardware_assets SET operating_system='10.3.3'\
END IF;"
I get back that I have an error in my SQL syntax. $ethernet_address is set,
so that is not my problem.
Does anyone know a way to go about this in SQL, or in a shell script? I
don't want to do it in Perl or PHP.
Thanks,
Mike


 

--
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]


unhex a varchar column

2004-02-09 Thread Mark S Pryor
Hello,

Using MySQL 4.017 on Win2k sp3:

using MySQL built-ins: 
how can I convert a
value stored as a hexadecimal string back to
a binary string while logged into the shell?

>set @t1=616263;
>select 0x616263;

how can I turn @t1 back into 0x616263? What is
the syntax? I tried
select concat('0x', @t1);
this returns an unevaluated literal.

tia,
msp



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



error connecting using ByteFX ADO.NET data provider to a MySQL 5.0.0a database

2004-02-09 Thread Dominique Plante
I was wondering if someone has had the error
"ByteFX.Data.MySqlClient.MySqlException: Bad handshake" when trying to talk
to a MySQL 5.0.0a database when using ByteFX's ADO.NET data provider.

I used pretty much the same code to connect to a table in an Access Database
with no problem.

The code and the error page I get are shown below.

Any help would be greatly appreciated.
 
Thanks,
Dominique
 
<%@ Page Language="C#" Debug="true" %>
<%@ import Namespace="ByteFX.Data.MySqlClient" %>

 
    public void Page_Load()
    {
    String mySqlConnectionString
="DataSource=localhost;Database=test;Username=dplante;Password=secret;Persis
t Security Info=true";
    MySqlConnection dbconn = new MySqlConnection(mySqlConnectionString);
    dbconn.Open();
    String sql="SELECT * FROM update_track";
    MySqlCommand dbcomm=new MySqlCommand(sql,dbconn);
    MySqlDataReader dbread = dbcomm.ExecuteReader();
    update_track.DataSource = dbread;
    update_track.DataBind();
    dbread.Close();
    dbconn.Close();
    }
 





    
    
    
    
    
    update_id
    description
    os
    bugTraqID
    
    
    
    
   
<%#DataBinder.Eval(Container.DataItem,"update_id")%>
   
<%#DataBinder.Eval(Container.DataItem,"description")%>
    <%#DataBinder.Eval(Container.DataItem,"os")%>
   
<%#DataBinder.Eval(Container.DataItem,"bugTraqID")%>
    
    
    
    
    
    
    


 
ERROR PAGE I GET:
 
Server Error in '/' Application. 

Bad handshake 
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code. 

Exception Details: ByteFX.Data.MySqlClient.MySqlException: Bad handshake

Source Error: 
 
Line 7:  String mySqlConnectionString
="DataSource=localhost;Database=test;Username=dplante;Password=secret;Persis
t Security Info=true";
Line 8:  MySqlConnection dbconn = new
MySqlConnection(mySqlConnectionString);
Line 9:  dbconn.Open();
Line 10: String sql="SELECT * FROM update_track";
Line 11: MySqlCommand dbcomm=new MySqlCommand(sql,dbconn);

Source File: C:\dev\sandbox\ASP.NETSandbox\wmSandbox\nwMySQLCS.aspx    Line:
9 

Stack Trace: 
 
[MySqlException: Bad handshake]
   ByteFX.Data.MySqlClient.Driver.ReadPacket() +167
   ByteFX.Data.MySqlClient.Driver.AuthenticateSecurely(Packet packet, String
password) +46
   ByteFX.Data.MySqlClient.Driver.Authenticate(String userid, String
password, Boolean UseCompression) +210
   ByteFX.Data.MySqlClient.Driver.Open(MySqlConnectionString settings) +393
   ByteFX.Data.MySqlClient.MySqlInternalConnection.Open() +45
   ByteFX.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() +168
   ByteFX.Data.MySqlClient.MySqlPool.GetPooledConnection() +454
   ByteFX.Data.MySqlClient.MySqlPool.GetConnection() +56
  
ByteFX.Data.MySqlClient.MySqlPoolManager.GetConnection(MySqlConnectionString
settings) +208
   ByteFX.Data.MySqlClient.MySqlConnection.Open() +69
   ASP.nwMySQLCS_aspx.Page_Load() in
C:\dev\sandbox\ASP.NETSandbox\wmSandbox\nwMySQLCS.aspx:9
   System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object sender,
EventArgs e) +10
   System.Web.UI.Control.OnLoad(EventArgs e) +55
   System.Web.UI.Control.LoadRecursive() +27
   System.Web.UI.Page.ProcessRequestMain() +731
 

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Dominique Plante - dplante AT pacbell dot net
Agile Developer for Hire - San Francisco Bay Area
http://www.binaryshift.com
-Founder of the Bay Area Software Developers Tribe -http://basd.tribe.net-



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



Admin Question

2004-02-09 Thread Ronan Lucio
Hello,

We have an MySQL-4.0.14 Server installed and sometimes the
it takes 90% from CPU.

So, my question is:
Is there a way to know what is taking so many CPU process?
What query is causing such problem?

Thanks
Ronan



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



Re: Version 4.1.2. when?

2004-02-09 Thread Heikki Tuuri
Mirza,

- Original Message - 
From: "Mirza" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Monday, February 09, 2004 1:54 PM
Subject: Version 4.1.2. when?


> Is there any info on when 4.1.2. is scheduled for relase? I am stucked
> in 4.1.1. with fulltext problem (bug #2490).
>
> Thanks for info,
> mirza

2 months ago I predicted 4.1.2-beta would be released Jan 25th, 2004. But
now I would guess March 5, 2004.

Best regards,

Heikki Tuuri
Innobase Oy
http://www.innodb.com
Foreign keys, transactions, and row level locking for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM
tables

Order MySQL technical support from https://order.mysql.com/


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



Re: SQL2000 and MySql

2004-02-09 Thread Martijn Tonies
Hi,


> I have a software of insurance to do quotations directly on the web. It
uses
> a SQL 2000 database and I want to use MYSQL database. Do you think it is
> possible ?

That depends on the requirements, doesn't it.

What do you use in your MS SQL 2000 database?

For example, MySQL doesn't have triggers and stored procedures.

(please reply to the MySQL list only, not to me personally)

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com


> > Does somebody can explain the technical difference beetwen SQL2000 and
> MySQL
>
> In exactly what area?
>
> In short: MS SQL 2000 is more advanced, has more build in stuff,
> is more expensive, most probably has more security leaks :-)


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



(FOUO) Anyone seen any Banking/Database Web applications ....

2004-02-09 Thread Johnson, Michael
CLASSIFICATION: UNCLASSIFIED
SECURITY CONTROL MARKING: FOR OFFICIAL USE ONLY

I am looking for a Banking Web application with all the Web pages, content
and Database behind it.   Any example will do.  

Thanks, Mike

Classification: UNCLASSIFIED
Security Control Marking: FOR OFFICIAL USE ONLY


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



Re: auto_increment pseudo sequence?

2004-02-09 Thread Kevin Carlson
alter table AUTO_INCREMENT=x

Scott Purcell wrote:

Hello,

I have an application in which I am using auto_increment as a kind of sequence replacement. The only problem I have is trying to get the auto_increment to start at a larger number than 0. 

Is auto_increment the replacement for sequences? and if so, is there a way to set the digit to a larger number when creating?

Thanks,
Scott
 



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


Re: auto_increment pseudo sequence?

2004-02-09 Thread Peter J Milanese

When you create the table I think you just set it..

ie-  create table blah  AUTO_INCREMENT=

P

-"Scott Purcell" <[EMAIL PROTECTED]> wrote: -

To: <[EMAIL PROTECTED]>
From: "Scott Purcell" <[EMAIL PROTECTED]>
Date: 02/09/2004 12:21PM
Subject: auto_increment pseudo sequence?

Hello,

I have an application in which I am using auto_increment as a kind of
sequence replacement. The only problem I have is trying to get the
auto_increment to start at a larger number than 0.

Is auto_increment the replacement for sequences? and if so, is there a way
to set the digit to a larger number when creating?

Thanks,
Scott

--
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: There has to be a way to do this

2004-02-09 Thread Alec . Cawley







Mike Tuller <[EMAIL PROTECTED]> wrote on 09/02/2004 16:53:00:

> I have posted this question a few times, and have not seen the answer
that I
> need.
>
> I have a shell script, that gathers information from systems, and I want
> that info to be entered into a database. I want it to check first to see
if
> the data is already entered, and if not, add it. If it has already been
> entered, then update the record.
>
> I would think that some type of if/else statement would work, but I can't
> get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to
work
> correctly in MySql.
>
> Here is what I have:
>
> "IF SELECT * FROM hardware_assets WHERE
ethernet_address='$ethernet_address'
> IS NULL\
> THEN INSERT into hardware_assets (ethernet_address) VALUES
> ($ethernet_address)\
> ELSE\
> UPDATE hardware_assets SET operating_system='10.3.3'\
> END IF;"

You probably want the REPLACE command (
http://www.mysql.com/doc/en/REPLACE.html )
which provides exactly this functionality:

REPLACE INTO hardware_assets VALUES ($ethernet_address, ) ;

where the ethernet_address column has been specified to be UNIQUE.

The MySQL IF is an operator, not a flow control structure: It would map
more closely to the C "A?x:y" operator rather than the " if () then {} else
{}".

  Alec


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



Re: Problem with UTF-8 in 4.1.1a

2004-02-09 Thread Jeremy March
It sounds like you are using the mysql client to display your queries. 
You should do: 

SELECT HEX(arabic_column) FROM your_table;

to really see what characters are stored in the table.  To see the
unicode codepoints you can do this:

SELECT HEX(CONVERT(arabic_column USING ucs2)) FROM your_table;

If the mysql client only displays ? it could be that the terminal
you are using does not have a proper unicode font.  When you type arabic
into the terminal is it displayed correctly?  

Another thing to try if you still can't input the data properly is to
input the data as hex values:

INSERT INTO your_table (arabic_column) VALUES (_utf8 0x);

where  is the utf8 hex value of the characters you want to enter. 
Since most people only know the ucs2 codepoint of the characters its
usually easier to enter it like this:

INSERT INTO your_table (arabic_column) VALUES (CONVERT(_ucs2 0x,
USING utf8));

Finally just to be sure, type \s in the terminal to be sure the client
and server are both using utf8.  

Hope this helps,

Jeremy



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



Re: SQL2000 and MySql

2004-02-09 Thread Peter J Milanese

And then there's the whole opensource thing :)

Your platform focus depends a lot on it too. If you're a MS shop, I'd
imagine SQL would be the way to go. All the fancy MS integration stuff is
there.

Connecting to it from other OS's is generally done with ODBC. ODBC is
pretty stinky as it's an abbreviated syntax in most senses.

There are probably a thousand points one can make to differ the two.

'Technically' (and broadly) they are the same thing. 'Practically' you'd
need to figure out the other parts of the solution before honing in on a
choice.


-"Martijn Tonies" <[EMAIL PROTECTED]> wrote: -

To: <[EMAIL PROTECTED]>
From: "Martijn Tonies" <[EMAIL PROTECTED]>
Date: 02/09/2004 12:16PM
Subject: Re: SQL2000 and MySql

Hi,

> Does somebody can explain the technical difference beetwen SQL2000 and
MySQL

In exactly what area?

In short: MS SQL 2000 is more advanced, has more build in stuff,
is more expensive, most probably has more security leaks :-)



With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com


--
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: There has to be a way to do this

2004-02-09 Thread Mike Tuller
I changed my script to this:

/usr/local/mysql/bin/mysql  --user=$username --password=$password
--host=$server 

RESULT=`echo "select count(*) from hardware_assets where
ethernet_address='$ethernet_address'" | cetechnology'
if [ "$RESULT" = "0" ] ; then
echo "INSERT INTO hardware_assets (ethernet_address) VALUES
($ethernet_address);"
else
echo "UPDATE hardware_assets SET operating_system='10.3.3';"
fi

Where cetechnology is the database. All the variables are set.

When I run this, it starts the mysql client application,  with the mysql>
prompt. Nothing is inserted or updated in the database though.

This is the same problem I had when I tried to do it this way, but I am not
knowledgeable in shell scripting yet to know what I am doing wrong.




> From: gerald_clark <[EMAIL PROTECTED]>
> Date: Mon, 09 Feb 2004 11:11:24 -0600
> To: Mike Tuller <[EMAIL PROTECTED]>
> Cc: MySql List <[EMAIL PROTECTED]>
> Subject: Re: There has to be a way to do this
> 
> IF works on the selections not on the query.
> Select  IF(lastname='clark','Correct',''Incorrect'), firstname from
> namefile;
> 
> You need to do the checking in your script.
> For example in bash:
> RESULT=`echo "select count(*) from manefile where lastname='clark'" |
> mysql database`
> if [ "$RESULT" = "0" ] ; then
>   echo "insert into namefile ...
> else
>   echo "update namefile ..
> fi
> 
> 
> Mike Tuller wrote:
> 
>> I have posted this question a few times, and have not seen the answer that I
>> need.
>> 
>> I have a shell script, that gathers information from systems, and I want
>> that info to be entered into a database. I want it to check first to see if
>> the data is already entered, and if not, add it. If it has already been
>> entered, then update the record.
>> 
>> I would think that some type of if/else statement would work, but I can't
>> get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to work
>> correctly in MySql.
>> 
>> Here is what I have:
>> 
>> "IF SELECT * FROM hardware_assets WHERE ethernet_address='$ethernet_address'
>> IS NULL\
>>THEN INSERT into hardware_assets (ethernet_address) VALUES
>> ($ethernet_address)\
>> ELSE\
>>UPDATE hardware_assets SET operating_system='10.3.3'\
>> END IF;"
>> 
>> I get back that I have an error in my SQL syntax. $ethernet_address is set,
>> so that is not my problem.
>> 
>> Does anyone know a way to go about this in SQL, or in a shell script? I
>> don't want to do it in Perl or PHP.
>> 
>> 
>> Thanks,
>> Mike
>> 
>> 
>>  
>> 
> 
> 
> 
> -- 
> 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]



auto_increment pseudo sequence?

2004-02-09 Thread Scott Purcell
Hello,

I have an application in which I am using auto_increment as a kind of sequence 
replacement. The only problem I have is trying to get the auto_increment to start at a 
larger number than 0. 

Is auto_increment the replacement for sequences? and if so, is there a way to set the 
digit to a larger number when creating?

Thanks,
Scott

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



RE: There has to be a way to do this

2004-02-09 Thread Schwartz, Evelyn
If you are always updating the entire row you could delete the record
(ignoring failures) and then insert the record.  Not efficient but it
would work.

If you are able to trap errors in your shell script and there is a
unique index on the ethernet_address field then you can do this:

Update Record
If update fails
  Insert record


-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 09, 2004 11:53 AM
To: MySql List
Subject: There has to be a way to do this


I have posted this question a few times, and have not seen the answer
that I need.

I have a shell script, that gathers information from systems, and I want
that info to be entered into a database. I want it to check first to see
if the data is already entered, and if not, add it. If it has already
been entered, then update the record.

I would think that some type of if/else statement would work, but I
can't get the IF statement http://www.mysql.com/doc/en/IF_Statement.html
to work correctly in MySql.

Here is what I have:

"IF SELECT * FROM hardware_assets WHERE
ethernet_address='$ethernet_address'
IS NULL\
THEN INSERT into hardware_assets (ethernet_address) VALUES
($ethernet_address)\ ELSE\
UPDATE hardware_assets SET operating_system='10.3.3'\
END IF;"

I get back that I have an error in my SQL syntax. $ethernet_address is
set, so that is not my problem.

Does anyone know a way to go about this in SQL, or in a shell script? I
don't want to do it in Perl or PHP.


Thanks,
Mike


-- 
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: SQL2000 and MySql

2004-02-09 Thread Martijn Tonies
Hi,

> Does somebody can explain the technical difference beetwen SQL2000 and
MySQL

In exactly what area?

In short: MS SQL 2000 is more advanced, has more build in stuff,
is more expensive, most probably has more security leaks :-)



With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com


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



Re: There has to be a way to do this

2004-02-09 Thread gerald_clark
IF works on the selections not on the query.
Select  IF(lastname='clark','Correct',''Incorrect'), firstname from 
namefile;

You need to do the checking in your script.
For example in bash:
RESULT=`echo "select count(*) from manefile where lastname='clark'" | 
mysql database`
if [ "$RESULT" = "0" ] ; then
   echo "insert into namefile ...
else
   echo "update namefile ..
fi

Mike Tuller wrote:

I have posted this question a few times, and have not seen the answer that I
need.
I have a shell script, that gathers information from systems, and I want
that info to be entered into a database. I want it to check first to see if
the data is already entered, and if not, add it. If it has already been
entered, then update the record.
I would think that some type of if/else statement would work, but I can't
get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to work
correctly in MySql.
Here is what I have:

"IF SELECT * FROM hardware_assets WHERE ethernet_address='$ethernet_address'
IS NULL\
   THEN INSERT into hardware_assets (ethernet_address) VALUES
($ethernet_address)\
ELSE\
   UPDATE hardware_assets SET operating_system='10.3.3'\
END IF;"
I get back that I have an error in my SQL syntax. $ethernet_address is set,
so that is not my problem.
Does anyone know a way to go about this in SQL, or in a shell script? I
don't want to do it in Perl or PHP.
Thanks,
Mike
 



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


Re: There has to be a way to do this

2004-02-09 Thread vpendleton
You could create a User defined Function that contains this logic. At the 
present time, an UDF needs to be coded in C.
Depending on how your `users` interface with the application, you could 
write a C/C++ or java command line interface as well.

>> Original Message <<

On 2/9/04, 10:53:00 AM, Mike Tuller <[EMAIL PROTECTED]> wrote 
regarding There has to be a way to do this:


> I have posted this question a few times, and have not seen the answer 
that I
> need.

> I have a shell script, that gathers information from systems, and I want
> that info to be entered into a database. I want it to check first to see 
if
> the data is already entered, and if not, add it. If it has already been
> entered, then update the record.

> I would think that some type of if/else statement would work, but I can't
> get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to 
work
> correctly in MySql.

> Here is what I have:

> "IF SELECT * FROM hardware_assets WHERE 
ethernet_address='$ethernet_address'
> IS NULL\
> THEN INSERT into hardware_assets (ethernet_address) VALUES
> ($ethernet_address)\
> ELSE\
> UPDATE hardware_assets SET operating_system='10.3.3'\
> END IF;"

> I get back that I have an error in my SQL syntax. $ethernet_address is 
set,
> so that is not my problem.

> Does anyone know a way to go about this in SQL, or in a shell script? I
> don't want to do it in Perl or PHP.


> Thanks,
> Mike


> --
> 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]



There has to be a way to do this

2004-02-09 Thread Mike Tuller
I have posted this question a few times, and have not seen the answer that I
need.

I have a shell script, that gathers information from systems, and I want
that info to be entered into a database. I want it to check first to see if
the data is already entered, and if not, add it. If it has already been
entered, then update the record.

I would think that some type of if/else statement would work, but I can't
get the IF statement http://www.mysql.com/doc/en/IF_Statement.html to work
correctly in MySql.

Here is what I have:

"IF SELECT * FROM hardware_assets WHERE ethernet_address='$ethernet_address'
IS NULL\
THEN INSERT into hardware_assets (ethernet_address) VALUES
($ethernet_address)\
ELSE\
UPDATE hardware_assets SET operating_system='10.3.3'\
END IF;"

I get back that I have an error in my SQL syntax. $ethernet_address is set,
so that is not my problem.

Does anyone know a way to go about this in SQL, or in a shell script? I
don't want to do it in Perl or PHP.


Thanks,
Mike


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



SQL2000 and MySql

2004-02-09 Thread Aubais30
Does somebody can explain the technical difference beetwen SQL2000 and MySQL

Thks a lot

Bertrand


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



Re: mySQL search engine

2004-02-09 Thread Curtis Maurand

Have you tried "explain?"  Have you indexed the table?

Curtis

On Sun, 8 Feb 2004, ___bug wrote:

> Hello,
> 
> 
> What is the best way to search a table with about 500.000 rows of varchar
> type.
>  ---
> / id / time / name /
> ---
> Like '%blah%' and x Like '%blub%' is too slow (takes about 20 sec)
> I tried using a fulltext index and search by using MATCH() AGAINST()
> The problem is each varchar (name) contains not space seperated words but
> they are combined with . or - or _
> For example I have the following row:
> 
> | 567456 | 20040102 | Owg-08299-abzu_via.lap-2003 |
> 
> Now i want to be able to search for (sorted by date):
> Owg abzu lap
> or 
> 082 abzu_via 2003
> or
> Owg-08299-abzu_via.lap-2003
> or
> Owg 08299 abzu via lap 2003
> or 
> 99-abzu
> 
> Anyone can help me?
> 
> Thanks Chris
> 
> 
> 

-- 
--
Curtis Maurand
mailto:[EMAIL PROTECTED]
http://www.maurand.com



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



Re: Stored procedures

2004-02-09 Thread Victoria Reznichenko
"Prasad Budim Ram" <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm testing stored procedure on  MySQL5.0.My question is can I change
> the definition of a procedure body  using ALTER PROCEDURE?(Not the
> characteristics). I'm not sure if it is implemented!
> 

You can't do it with ALTER PROCEDURE. Only DROP procedure and then CREATE a new one.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [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]



RE: MySQL and Coldfusion

2004-02-09 Thread Matt Lynch
Hi Ian,

What is the problem you are hitting?  I have been successfully using MX
with MySQL.

Matt

-Original Message-
From: Ian O'Rourke [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 08, 2004 10:52 AM
To: [EMAIL PROTECTED]
Subject: MySQL and Coldfusion


Is anyone on the list using Coldfusion MX with MySql? It's just I've hit
a problem I've been hitting my head against for a week or so. The
coldfusion people I know have hit a blank (but they are using SQL
Server). I'm stretching now in an attempt to find someone with
experience of both sides?

Thanks in advance.


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004
 



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



RE: Advice

2004-02-09 Thread Matt Lynch
Hi Alexander,

Perhaps the console application would be better suited for you.  That
way the response is always ASCII text, and you only need to type the
commands.

In case you haven't tried the console before ...

To start the console application: 1. Open a DOS prompt (in windows) or a
command shell (in Linux)  2. type mysql and press enter.

Regards,

Matt

-Original Message-
From: Alexander Pfingstl [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 07, 2004 4:29 AM
To: [EMAIL PROTECTED]
Subject: Advice


Hi,

I am a blind user and for me it would be very helpful if I could use
this GUI. At the moment I have got the problem, that you have to click
on every item. There are no short cuts and it is not posible to navigate
using the tab-key or context-menue. Or the arror-keys.

Perhapts you can include this in future versions. 
It would make it much easier for blind people to use this GUI under
windows.

If you need more help or info about special problems of blind people or
the screenreaders, than feal free to contact me.

Best regards,
Alexander 


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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004
 



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



Re: Last record

2004-02-09 Thread Patricio Gigoux
the idea is:
table1:
id own
1A
2B
3A
4C

table2:
id type
13
14
12
34
35
41

I need as result

query:
own  type
A   2
A   5
C   1

Thanks in advance


- Original Message - 
From: "Michael Satterwhite" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 10:29 AM
Subject: Re: Last record


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday 09 February 2004 08:44, Patricio Gigoux wrote:
> Hi:
> How Can I do for after a query I put at the its last record?

I'm not sure I followed the question, but I think you're asking how to look
at
the last record in the set you just returned. If so, the easiest way is to
do
a descending sort. For example Assume a table as follows:

Table1
ID Value
 --
1 23
2 30
3 45

Then

Select * from Table1 Order by ID Desc;

Will return

ID Value
  
3 45
2 30
1 23

Now the *FIRST* record you will see is the last record in the set.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQFAJ5lEjeziQOokQnARAsmPAJ96yzc+WcieFt5cj2zMLvAIY17nSQCgh8XS
rciGckLMnLCqkfvf3z+GqSU=
=hwzq
-END PGP SIGNATURE-


-- 
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: Problem with UTF-8 in 4.1.1a

2004-02-09 Thread Mehran Ziadloo
Hi Lorenzo,

Well I've tested all the possible ways. I even made a php file to insert 
data into the data base without getting it from user (inserting a constant 
string). In that file I'm sure that my string is encoded in UTF-8.
Even though I'm sure that with IE's encode set to UTF-8, it will send form's 
data encoded in UTF-8 (and I mean I'm sure).
Since first byte of each character is considered but not the second ones, 
then it means that mysql can recognize the characters and becuase there's 
something wrong with it, only first bytes are stored. Otherwise I'm doing 
something wrong.

Thanks Lorenzo, but still need help..
Mehran Ziadloo
_
MSN 8 with e-mail virus protection service: 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]


2000 Vs. NT [No Virus found]

2004-02-09 Thread experanto
Hi All,

We recently migrate our MySql DB from a Win NT Server (Biprocessor, RAM 2Go) to a Win 
2000 Server (Quadriprocessor, RAM 4Go).

Hopefully we noticed a global performance gain, but some scripts seem to be slower 
than before !

For some reason, we are still running the old 3.23.51 release.

My question is : Is this version of MySql better optimized for NT than for 2000 Server 
? What about version 4.0 ?

Thanx for your help.
Have a nice day : )

Olivier

RE: non unique index on MySQL 5.0

2004-02-09 Thread Gordon
Sorry for the repost, but I just realized that the index information for
key 3 did not get copied into the 1st email.

-Original Message-
From: Gordon [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 09, 2004 8:48 AM
To: [EMAIL PROTECTED]
Subject: non unique index on MySQL 5.0

I just installed MySQL 5.0 on my windows machine and was trying to load
the output from a MySQLFront export from our 4.0.16 production system

when I got the following error..


C:\>mysql -u root mailprint < e:\mp20040205.sql

ERROR 1062 at line 7893168: Duplicate entry 'Name-4928 N Brooklyn
Kansas City' for key 3


I'm not sure why I would get a "Duplicate entry" error on an index that
was not defined as Unique. 


Have the rules for indexes changed somewhere between 4.0.16 and 5.0 ?


Here is the table definition from the 4.0.16 machine.

| product_order_features | CREATE TABLE `product_order_features` (
  `ordr_ID` int(11) unsigned NOT NULL default '0',
  `poft_Sub_Month` char(3) NOT NULL default '0',
  `poft_ID` tinyint(3) unsigned NOT NULL auto_increment,
  `poft_Sub_Item` char(1) NOT NULL default '0',
  `poft_Feature` varchar(40) NOT NULL default '',
  `poft_Value` text NOT NULL,
  `poft_Contents` text,
  `poft_Active` enum('Yes','No','Mail Sent','Deleted','PKOR','PK Hold')
NOT NULL default 'Yes',
  `poft_Timestamp` timestamp(14) NOT NULL,
  `poft_Create` datetime NOT NULL default '-00-00 00:00:00',
  PRIMARY KEY  (`ordr_ID`,`poft_Sub_Month`,`poft_Feature`,`poft_ID`),
  KEY `Feature_Value_IDX` (`poft_Feature`,`poft_Value`(20)),
  KEY `Feature_Contents_IDX` (`poft_Feature`,`poft_Contents`(20))
) TYPE=MyISAM |
C:\>mysql -u root mailprint

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 7 to server version: 5.0.0-alpha-nt

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



-- 
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]



non unique index on MySQL 5.0

2004-02-09 Thread Gordon
I just installed MySQL 5.0 on my windows machine and was trying to load
the output from a MySQLFront export from our 4.0.16 production system

when I got the following error..


C:\>mysql -u root mailprint < e:\mp20040205.sql

ERROR 1062 at line 7893168: Duplicate entry 'Name-4928 N Brooklyn
Kansas City' for key 3


I'm not sure why I would get a "Duplicate entry" error on an index that
was not defined as Unique. 


Have the rules for indexes changed somewhere between 4.0.16 and 5.0 ?


Here is the table definition from the 4.0.16 machine.

| product_order_features | CREATE TABLE `product_order_features` (
  `ordr_ID` int(11) unsigned NOT NULL default '0',
  `poft_Sub_Month` char(3) NOT NULL default '0',
  `poft_ID` tinyint(3) unsigned NOT NULL auto_increment,
  `poft_Sub_Item` char(1) NOT NULL default '0',
  `poft_Feature` varchar(40) NOT NULL default '',
  `poft_Value` text NOT NULL,
  `poft_Contents` text,
  `poft_Active` enum('Yes','No','Mail Sent','Deleted','PKOR','PK Hold')
NOT NULL default 'Yes',
  `poft_Timestamp` timestamp(14) NOT NULL,
  `poft_Create` datetime NOT NULL default '-00-00 00:00:00',
  PRIMARY KEY  (`ordr_ID`,`poft_Sub_Month`,`poft_Feature`,`poft_ID`),
  KEY `Feature_Value_IDX` (`poft_Feature`,`poft_Value`(20)),
  K
) TYPE=MyISAM |
C:\>mysql -u root mailprint

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 7 to server version: 5.0.0-alpha-nt

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



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



Re: reg MySQL C API Prepared statements

2004-02-09 Thread Egor Egorov
Arunachalam <[EMAIL PROTECTED]> wrote:
> Hi!
> 
> MySQL C API Prepareed statements routines;
>  mysql_prepare, 
>  mysql_bind_param, 
>  mysql_fetch, 
>  mysql_execute  are present in *libmysql.lib* file - right...
> 
> I have currently used MySQL 4.0.17-max 
> 
> I want to clarify that starting from which version, MySQL provides this?
> 

Prepared statements were implemented in version 4.1.



-- 
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]



Re: WHERE NOT EXISTS

2004-02-09 Thread Michael Satterwhite
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday 09 February 2004 08:05, Carl Schéle, IT, Posten wrote:
> I use php 4.1.1. mysql 3.23.49 and phpmyadmin 2.5.4
>
> I have two tables
>
> classes
> 
> - class_id (int)
> - class_name (text)
> 
> HS
> HD
> DD
> DS
> MD
>
> champions
> 
> - champions_id (int)
> - year (text)
> - class_name (text)
> - winner (text)
> 
> 1981 HS PETER
> 1981 DS ANNE
>
> What I want to do is to list all class_name from classes that aren't
> represented a specific year.
>
> So what I want as result is HD, DD, MD
> I'm trying to use the following query:
>
> SELECT class_name FROM classes WHERE NOT EXISTS (SELECT * FROM champions
> WHERE champions.class_name=classes.class_name AND champions.year='1981')
>
> ERRORREPORT:
> #1064 - You have an error in your SQL syntax.  Check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 'EXISTS (
>
> Someday please help me. Am I not using the right version of php? Or is it
> mysql?

The problem is that subselects aren't supported in 3.23 of MySQL. Try the 
following query:

Select cl.class_name 
from classes cl left join champions ch on cl.class_name = ch.class_name
where ch.class_name is null;

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQFAJ5pWjeziQOokQnARAuWaAJ9rYuMSD9fm62FdC45k9utKElVJhACePdhN
pqJAXScklcXHI9zJSY/L1Wg=
=AYsU
-END PGP SIGNATURE-


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



Re: Last record

2004-02-09 Thread Michael Satterwhite
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday 09 February 2004 08:44, Patricio Gigoux wrote:
> Hi:
> How Can I do for after a query I put at the its last record?

I'm not sure I followed the question, but I think you're asking how to look at 
the last record in the set you just returned. If so, the easiest way is to do 
a descending sort. For example Assume a table as follows:

Table1
ID  Value
--
1   23
2   30
3   45

Then 

Select * from Table1 Order by ID Desc;

Will return

ID  Value
    
3   45
2   30
1   23

Now the *FIRST* record you will see is the last record in the set.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQFAJ5lEjeziQOokQnARAsmPAJ96yzc+WcieFt5cj2zMLvAIY17nSQCgh8XS
rciGckLMnLCqkfvf3z+GqSU=
=hwzq
-END PGP SIGNATURE-


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



Re: WHERE NOT EXISTS

2004-02-09 Thread Victoria Reznichenko
"Carl Sch?le, IT, Posten" <[EMAIL PROTECTED]> wrote:
> I use php 4.1.1. mysql 3.23.49 and phpmyadmin 2.5.4

[skip] 

> What I want to do is to list all class_name from classes that aren't represented a 
> specific year.
> 
> So what I want as result is HD, DD, MD
> 
> I'm trying to use the following query:
> 
>
> SELECT class_name FROM classes WHERE NOT EXISTS (SELECT * FROM champions WHERE 
> champions.class_name=classes.class_name AND champions.year='1981')
>
> 
> ERRORREPORT:
>
> #1064 - You have an error in your SQL syntax.  Check the manual that corresponds to 
> your MySQL server version for the right syntax to use near 'EXISTS ( 
> 
> SELECT  * 
> 
> FROM champions
>
> WHERE champions.class_name
> 
>
> Someday please help me. Am I not using the right version of php? Or is it mysql?

Your version of MySQL doesn't support sub-selects. Subqueries are supported from 
version 4.1.0. You can rewrite the above query using LEFT JOIN:
http://www.mysql.com/doc/en/Rewriting_subqueries.html


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [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]



Re: Remote Access with Linux

2004-02-09 Thread vpendleton
One way is to expose the port that MySQL is running on via the firewall. 
Another option could be to run ssh on the target MySQL machine and 
forward the MySQL ports giving you a secure connection.

>> Original Message <<

On 2/9/04, 6:41:19 AM, Carlos J Souza <[EMAIL PROTECTED]> wrote 
regarding Remote Access with Linux:


> Hello ALL,

> I have a Linux Debian server and need access remotely Mysql Server from
> other windows client.

> When i try to connect mysql server via internet, one error occurs that as
> follows:
> Error no. 2003 - can´t connect to mysql server on 200.153.25.58 ( 10061).

> My Username and Password are correct! I Sure!.

> How to configure Squid and Firewall from linux for MySql  Remore Access?

> Regards

> Carlos Souza


> --
> 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]



reg MySQL C API Prepared statements

2004-02-09 Thread Arunachalam
Hi!

MySQL C API Prepareed statements routines;
  mysql_prepare, 
  mysql_bind_param, 
  mysql_fetch, 
  mysql_execute  are present in *libmysql.lib* file - right...

I have currently used MySQL 4.0.17-max 

I want to clarify that starting from which version, MySQL provides this?

thanks in advance

regards,
Arun.


Yahoo! India Education Special: Study in the UK now.
Go to http://in.specials.yahoo.com/index1.html

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



Re: Version 4.1.2. when?

2004-02-09 Thread Victoria Reznichenko
Mirza <[EMAIL PROTECTED]> wrote:
> Is there any info on when 4.1.2. is scheduled for relase? I am stucked 
> in 4.1.1. with fulltext problem (bug #2490).
> 

Binaries of 4.1.2 will be available in a month.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [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]



Re: WHERE NOT EXISTS

2004-02-09 Thread AllesKunst.net ID GesmbH
Hello Carl.

You are using mysql version 4+ ?

Gesundheit,
Rudi Dorn

Fa. AllesKunst.net I.D. GesmbH
A - 1020 Wien Zirkusgasse 39/37
Tel.: 0699 - 10 242 880
Die Firma: http://www.alleskunst.at
Das Projekt: http://www.alleskunst.net




- Original Message - 
From: "Carl Schéle, IT, Posten" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 3:05 PM
Subject: WHERE NOT EXISTS


I use php 4.1.1. mysql 3.23.49 and phpmyadmin 2.5.4



I have two tables



classes



- class_id (int)

- class_name (text)



HS

HD

DD

DS

MD



champions



- champions_id (int)

- year (text)

- class_name (text)

- winner (text)



1981 HS PETER

1981 DS ANNE



What I want to do is to list all class_name from classes that aren't
represented a specific year.

So what I want as result is HD, DD, MD

I'm trying to use the following query:



SELECT class_name FROM classes WHERE NOT EXISTS (SELECT * FROM champions
WHERE champions.class_name=classes.class_name AND champions.year='1981')



ERRORREPORT:

#1064 - You have an error in your SQL syntax.  Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'EXISTS (

SELECT  *

FROM champions

WHERE champions.class_name



Someday please help me. Am I not using the right version of php? Or is it
mysql?











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



Re: Multiple mysql on same linux Box.

2004-02-09 Thread mathan
Hai

1. To use another conf file
Use this option "--defaults-file=#" to refer the default values from the file 
other than  /etc/my.cnf file. In t
eg:
# mysql --defaults-file=/opt/mysql/share/my.cnf

2. To change the data dir

Do the following changes to change the "data dir" other than /var/lib/mysql

In this example we are changing the dir from '/opt/mysql/var' to '/var/opt/mysql'
###
file: bin/mysql_config

line 74
# ldata='/opt/mysql/var'
ldata='/var/opt/mysql'
### 
file: bin/mysql_install_db

line 76
#test -z "$ldata" && ldata=/opt/mysql/var
test -z "$ldata" && ldata=/var/opt/mysql
###
file: bin/mysqld_safe

line 113
 # DATADIR=/opt/mysql/var
DATADIR=/var/opt/mysql
###
file: share/mysql/mysql.server

line 52
#datadir=/opt/mysql/var
datadir=/var/opt/mysql

line 132
#if test "$datadir" != "/opt/mysql/var"
if test "$datadir" != "/var/opt/mysql"
###



Thanks
Mathan
[EMAIL PROTECTED]
www.visolve.com


- Original Message - 
From: "tasvir rohila" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 2:27 PM
Subject: Multiple mysql on same linux Box.


> Hello,
> 
> I have installed multiple mysql servers on the same box running Redhat linux 9.0.
> one through mysql RPM (version 3.2.54a) and other through source (version 3.2.58).
> The RPM installation has default configuration (like /etc/my.cnf, /var/lib/mysql etc 
> etc). The second source installation has been configured as follows:-
> port = 4406, --prefix=/usr/local/somedir/sw/mysql/ 
> --localstatedir=/usr/local/somedir/db/ 
> --with-unix-socket-path=/usr/local/somedir/sock/mysql.sock --with-tcp-port=4406
>  
> The problem is that even after specifying the prefix and localstatedir the second 
> type of installation references the configuration directives from my.cnf and the 
> database is installed in /var/lib/mysql and the socket and ports are from the 
> default.
>  
> Is there a way to run multiple mysql servers with different ports, database 
> directories and different sockets on Redhat 9.0 ???
>  
> any help in this regard is appreciated...in advance.
> 
> thanks
> 
> Tasvir
> 
> 
> -
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online

WHERE NOT EXISTS

2004-02-09 Thread "Carl Schéle, IT, Posten"
I use php 4.1.1. mysql 3.23.49 and phpmyadmin 2.5.4

 

I have two tables

 

classes



- class_id (int)

- class_name (text)



HS

HD

DD

DS

MD

 

champions



- champions_id (int)

- year (text)

- class_name (text)

- winner (text)



1981 HS PETER

1981 DS ANNE

 

What I want to do is to list all class_name from classes that aren't represented a 
specific year.

So what I want as result is HD, DD, MD

I'm trying to use the following query:

 

SELECT class_name FROM classes WHERE NOT EXISTS (SELECT * FROM champions WHERE 
champions.class_name=classes.class_name AND champions.year='1981')

 

ERRORREPORT:

#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to 
your MySQL server version for the right syntax to use near 'EXISTS ( 

SELECT  * 

FROM champions

WHERE champions.class_name

 

Someday please help me. Am I not using the right version of php? Or is it mysql?

 

 

 

 



Last record

2004-02-09 Thread Patricio Gigoux
Hi:
How Can I do for after a query I put at the its last record?

Thanks in advance

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



Re: Problem with UTF-8 in 4.1.1a

2004-02-09 Thread Lorenzo Sicilia
> So, am I doing anything wrong or there’s a problem with MySQL itself?
I'am not sure but I had a bug like that.
You use Explore when you insert data in db?
Exlorer use UTF-16 when send data. Mozilla use UTF-8.
try change Browser.
I have solved with this line in my jsp:
request.setCharacterEncoding("UTF-8");
I hope this help.

Regard Lorenzo Sicilia



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


Stored procedures

2004-02-09 Thread Prasad Budim Ram
Hi,
I'm testing stored procedure on  MySQL5.0.My question is can I change
the definition of a procedure body  using ALTER PROCEDURE?(Not the
characteristics). I'm not sure if it is implemented!

TIA,
Ram



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



Problem with UTF-8 in 4.1.1a

2004-02-09 Thread Mehran Ziadloo
Note: to see this script correctly, please set your encoding to UTF-8.

Hi
I'm trying to use the new capabilities of the MySQL 4.1.1a, which is 
supporting of Unicode. I prefer to use UTF-8 instead of UCS-2 since I'm 
working on web and for web UTF-8 is much more suitable.
Before asking my current question, I would like to say that before this 
version of MySQL I was storing data in data bases encoded in UTF-8. I had no 
problem, all was fine, storing, retrieving and compares. The only problem 
(which is not a problem, but a lack) was about using FullText search on 
UFT-8 fields since this search takes out the unnecessary characters from the 
index, and most of my characters are not in the specified range (since 
it’s UTF-8). I hoped this was solved in the new one.
My current question:
I'm trying to insert data into a table and my data, before insertion, is 
encoded in UTF-8. I've created a table like this:

CREATE TABLE `articles` (
`id` INT NOT NULL AUTO_INCREMENT,
`article` TEXT CHARACTER SET utf8,
PRIMARY KEY (`id`),
FULLTEXT (`article`)
)
And then tried to insert data like this:

INSERT INTO `articles` (`id`, `article`) VALUES ('', _utf8 'مهران')

I even tried this one, which gave me the same result:

INSERT INTO `articles` (`id`, `article`) VALUES ('', CONVERT(_utf8 
'مهران' USING utf8))

My string to store is an Arabic word, which in UTF-8 it takes two bytes per 
letter. All first bytes in each letter is 0x06 which is the ‘?’ 
character in ASCII. The problem is that all data stored in data base will be 
‘?’. It means that only the first bytes are stored, from each character 
entered.
So, am I doing anything wrong or there’s a problem with MySQL itself?

[more information]
I'm using:
mysql-4.1.1a-alpha-win
php-4.3.4-Win32
windows 2000-sp4
phpMyAdmin-2.5.3-php
and IIS version 5.0
Thanks in advance,
Mehran Ziadloo
_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
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]


Version 4.1.2. when?

2004-02-09 Thread Mirza
Is there any info on when 4.1.2. is scheduled for relase? I am stucked 
in 4.1.1. with fulltext problem (bug #2490).

Thanks for info,
mirza


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


Remote Access with Linux

2004-02-09 Thread Carlos J Souza
Hello ALL,

I have a Linux Debian server and need access remotely Mysql Server from
other windows client.

When i try to connect mysql server via internet, one error occurs that as
follows:
Error no. 2003 - can´t connect to mysql server on 200.153.25.58 ( 10061).

My Username and Password are correct! I Sure!.

How to configure Squid and Firewall from linux for MySql  Remore Access?

Regards

Carlos Souza


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



Re: Stability of MyISAM-Ststis vs. Dynamic - (was: Automatic conversion from `char` TO `varchar`)

2004-02-09 Thread Jocelyn Fournier
Hi,

If all your fields have a fixed length, you can change the type of the table
by doing :

   ALTER TABLE your_table ROW_FORMAT=fixed;

Regards,
  Jocelyn
- Original Message - 
From: "Merten Christian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 10:01 AM
Subject: Stability of MyISAM-Ststis vs. Dynamic - (was: Automatic conversion
from `char` TO `varchar`)


As to the discussion about char vs. varchar fields, I am now into a problem
which is near by the above one:

We are about to design a new database with high importance to stability and
crash
recovery. So I found, that two types of MyISAM tables exist (static and
dynamic).
If you have only fixed length fields, the table will be static. But when you
add
just one field of variable length, the table will be dynamic.

Therefore, I tried to move any i.e. varchar type fields to char, but the
type of the
table does not change when I am using the ALTER statement. Right now, I only
can do
this conversion by dumping data and structure, removing the table, changing
the fields
and then inserting structure and data again.

* Is there another way to do this ?
* Has anybody ever had to rebuild a corrupted table, and is rebuiling a
static table
  really easier for software than rebuilding a dynamic one?

Greetinx,
 Chris

SZM Studios *
Dipl.Ing. Christian Merten * Ingenieur Broadcast-Support
Oberwallstraße 6 * 10117 Berlin
Tel. [030] 2090-3167 * Fax [030] 2090-3092
[EMAIL PROTECTED] 



-- 
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: primary key - user entered/auto increment

2004-02-09 Thread Victoria Reznichenko
David Johnston <[EMAIL PROTECTED]> wrote:
> I am starting to design a database in sql, to replace a flat file db.
> 
> The database holds records, currenlty there is a new database for each 
> record, so each record for each project starts with a id and increments.
> 
> I want to create a sql database that will hold all records for all 
> projects, so I'd like to have a primary key -
> 
> xxx/x
> 
> The first three digits would be the project ID, the following 5 digits 
> would be the records unique number.
> 
> Is it possilbe to create a field, that I can enter the first three 
> digits, while the following 5 auto increment?
> 
> The result would be that all projects would still have records starting 
> from 1, and auto incrementing.

If I've got you right you should specify auto_increment on the secondary column of 
multiple-column index:
http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html

For example:

mysql> create table t1(
-> p_id int not null,
-> id int not null auto_increment,
-> primary key (p_id, id));
Query OK, 0 rows affected (0.07 sec)

mysql> insert into t1 values
-> (111,NULL),
-> (222,NULL),
-> (111,NULL);
Query OK, 3 rows affected (0.01 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> select * from t1;
+--++
| p_id | id |
+--++
|  111 |  1 |
|  111 |  2 |
|  222 |  1 |
+--++
3 rows in set (0.01 sec)



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [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]



primary key - user entered/auto increment

2004-02-09 Thread David Johnston
I am starting to design a database in sql, to replace a flat file db.

The database holds records, currenlty there is a new database for each 
record, so each record for each project starts with a id and increments.

I want to create a sql database that will hold all records for all 
projects, so I'd like to have a primary key -

xxx/x

The first three digits would be the project ID, the following 5 digits 
would be the records unique number.

Is it possilbe to create a field, that I can enter the first three 
digits, while the following 5 auto increment?

The result would be that all projects would still have records starting 
from 1, and auto incrementing.

--
Regards,
David Johnston

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


Re: Insert with multiple value lists

2004-02-09 Thread Victoria Reznichenko
Duncan Hill <[EMAIL PROTECTED]> wrote:
> While reading the manual the other day, I noticed that MySQL supports a syntax 
> of INSERT INTO table VALUES (x),(y),(z).  Very handy, and nice and fast.  
> However, when this syntax was tested on an AS/400 and an Ingres installation, 
> it doesn't work.  The manual doesn't list this format as an extension from 
> ANSI 92 though.  So, is it standard SQL or an extension?
> 

I have no ANSI SQL, but INSERT statement with multiple value lists is mentioned in the 
standart SQL 99.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [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]



Re: New Timestamp format woes

2004-02-09 Thread Egor Egorov
DALive Editor <[EMAIL PROTECTED]> wrote:
> 
> I just upgraded my MySQL to distribution version 4.0.17 up from 4.0.15 
> (i think). I read in the readme file i think it was that the mechanics 
> or output of the timestamp column had changed. I had grown to like that 
> column type. What's the best way to handle this change? Espially 
> considering I have alot of data already in place. I read something about 
> the use of '+0': i haven't really understood that.
> 

Format of TIMESTAMP column was changed in version 4.1.0. In version 4.0.17 you can get 
new TIMESTAMP format if you run MySQL server with --new option.
 Using +0 you get the same format like version 4.0 does:

mysql> select mydate+0 from test;
++
| mydate+0   |
++
| 20040209110608 |
++
1 row in set (0.00 sec)

mysql> select mydate from test;
+-+
| mydate  |
+-+
| 2004-02-09 11:06:08 |
+-+
1 row in set (0.00 sec)  



-- 
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]



Stability of MyISAM-Ststis vs. Dynamic - (was: Automatic conversion from `char` TO `varchar`)

2004-02-09 Thread Merten Christian
As to the discussion about char vs. varchar fields, I am now into a problem
which is near by the above one:

We are about to design a new database with high importance to stability and crash
recovery. So I found, that two types of MyISAM tables exist (static and dynamic).
If you have only fixed length fields, the table will be static. But when you add
just one field of variable length, the table will be dynamic.

Therefore, I tried to move any i.e. varchar type fields to char, but the type of the
table does not change when I am using the ALTER statement. Right now, I only can do
this conversion by dumping data and structure, removing the table, changing the fields 
and then inserting structure and data again.

* Is there another way to do this ?
* Has anybody ever had to rebuild a corrupted table, and is rebuiling a static table
  really easier for software than rebuilding a dynamic one?

Greetinx,
 Chris 

SZM Studios *
Dipl.Ing. Christian Merten * Ingenieur Broadcast-Support
Oberwallstraße 6 * 10117 Berlin
Tel. [030] 2090-3167 * Fax [030] 2090-3092
[EMAIL PROTECTED]   



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



Multiple mysql on same linux Box.

2004-02-09 Thread tasvir rohila
Hello,

I have installed multiple mysql servers on the same box running Redhat linux 9.0.
one through mysql RPM (version 3.2.54a) and other through source (version 3.2.58).
The RPM installation has default configuration (like /etc/my.cnf, /var/lib/mysql etc 
etc). The second source installation has been configured as follows:-
port = 4406, --prefix=/usr/local/somedir/sw/mysql/ 
--localstatedir=/usr/local/somedir/db/ 
--with-unix-socket-path=/usr/local/somedir/sock/mysql.sock --with-tcp-port=4406
 
The problem is that even after specifying the prefix and localstatedir the second type 
of installation references the configuration directives from my.cnf and the database 
is installed in /var/lib/mysql and the socket and ports are from the default.
 
Is there a way to run multiple mysql servers with different ports, database 
directories and different sockets on Redhat 9.0 ???
 
any help in this regard is appreciated...in advance.

thanks

Tasvir


-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

problem connecting with PHP

2004-02-09 Thread Nikola Skoric
Hello,

I've recently upgraded from 3.23 to 4.0.16. Before upgrading my PHP
scripts connecting to mysql server from another machine (not from
localhost) were doing just fine. But, since upgrading, I get tihs
warnings:

Warning:  Lost connection to MySQL server during query in
/home/users2/nick/public_html/umzpa/data_connect.php on line 3

Warning:  MySQL Connection Failed: Lost connection to MySQL server
during query in
/home/users2/nick/public_html/umzpa/data_connect.php on line 3

And the query on line 3 is just a mysql_connect function. Now, the
problem isn't in wrong username, password or hostname as I haven't
been changing then in scripts nor on server... so, where could be
the problem?

--
Pozdrav/Regards, Nikola [Nick] Skoric.
"...Usne, tice-rugalice - a u oku tajac
Da sam kaput sa dva lica, da sam Gospo'n Propalica..."
http://newusers.cjb.net/ - site o Usenetu na hrvatskom!

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



RE: is it possible...

2004-02-09 Thread Ligaya Turmelle
Boy do I feel dumb.  :^)

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 4:54 PM
To: [EMAIL PROTECTED]
Subject: RE: is it possible...


UPDATE EMAIL_TEST_LIST SET EMAIL_DATE = curdate();

-Original Message-
From: Ligaya Turmelle [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 08, 2004 10:42 PM
To: [EMAIL PROTECTED]
Subject: is it possible...


Is it possible to have an update statement that uses curdate()?

Example:
UPDATE EMAIL_TEST_LIST SET EMAIL_DATE = "(SELECT curdate())";



-- 
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]



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