Re: Using mySQL connectJ issue

2003-09-29 Thread Bernhard Schmidt
hi

it seems that the mysql-connector-java-3.0.8-stable-bin.jar file is not in
the classpath.

best regards
benny


- Original Message -
From: Joe Yan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 29, 2003 7:58 PM
Subject: Using mySQL connectJ issue


 Hi all,
 when I used JDBC driver (Connector/J3.0.8) to run my java database agent
 codes, It always have following errors:
   java.lang.classNotFoundException : com.mysql.jdbc.driver
   at java.net.URLClassloader$1.run(URLClassLoader.java:198)
 I set the Classpath to mysql-connector-java-3.0.8-stable-bin.jar
 and my url=jdbc:mysql://localhost:3306/test,,  (test is my
 database name)
 using JDBC DriverManager and com.mysql.jdbc.driver to load the driver:
 class.forName(com.mysql.jdbc.driver).newInstance();

 I have no clue what's going on, I appriciate if anyone can give soem
 advices!Thx.

 Joe

 _
 Add photos to your e-mail with MSN 8. Get 2 months FREE*.
 http://join.msn.com/?page=features/featuredemail


 --
 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: Data store/extract help almost there ,still error's

2003-09-20 Thread Bernhard Schmidt
hi

you mix the password and key, use

AES_ENCRYPT(the clear password, the key to crypt);
AES_DECRYPT(the crypted password, the key to crypt);

example

 UPDATE user_profile SET
username=james , password=AES_ENCRYPT(bond007, sydo89)
 WHERE personid=1;

saves the password in the record with the id = 1

 SELECT username, AES_DECRYPT(password,sydo89) AS psw
 FROM user_profile
 WHERE personid=1

retrieves the username and the clear password

regards
benny



- Original Message -
From: Stout, Jeff [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 20, 2003 4:09 PM
Subject: RE: Data store/extract help almost there ,still error's


Thanks John, I'm trying various syntax changes but still getting
Empty set

mysql INSERT INTO user_profile (userid,password)
- VALUES (James,AES_ENCRYPT(bond,007));
Query OK, 1 row affected (0.00 sec)

mysql SELECT * FROM user_profile WHERE userid=james AND
- AES_DECRYPT(password,bond)=007;
Empty set (0.00 sec)




-Original Message-
From: John Hopkins [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 6:38 PM
To: Stout, Jeff
Subject: RE: Data store/extract help almost there


I've been following with interest.  As I understand the previous messages,
you are indeed almost there

Try this:

mysql INSERT INTO user_profile (userid,password)
- VALUES (joeblow,AES_ENCRYPT(spit,swallow));
Query OK, 1 row affected (0.01 sec)

mysql SELECT * FROM user_profile WHERE userid=joeblow AND
- AES_DECRYPT(password,swallow)=spit;

I don't have MySQL running anywhere right now, can't test it.  The point is
you need to decrypt what's in *password*, and compare that to the
unencrypted password (entered by the user?).

Hope this helps,

John Hopkins
Hopkins IT


-Original Message-
From: Stout, Jeff [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 4:31 PM
To: PF: MySQL; [EMAIL PROTECTED]
Subject: RE: Data store/extract help almost there


Almost there, here is the error

mysql INSERT INTO user_profile (userid,password)
- VALUES (joeblow,AES_ENCRYPT(spit,swallow));
Query OK, 1 row affected (0.01 sec)

mysql SELECT * FROM user_profile WHERE userid=joeblow AND
- password=AES_DECRYPT(spit,swallow);
Empty set (0.01 sec)

-Original Message-
From: PF: MySQL [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 4:48 PM
To: [EMAIL PROTECTED]
Subject: RE: Data store/extract help !!


Woops, Sorry, Phone call distracted me

AES_ENCRYPT(string,key_string)
AES_DECRYPT(string,key_string)

These functions allow encryption/decryption of data using the official AES
(Advanced Encryption Standard) algorithm, previously known as Rijndael.
Encoding with a 128-bit key length is used, but you can extend it up to 256
bits by modifying the source. We chose 128 bits because it is much faster
and it is usually secure enough. The input arguments may be any length. If
either argument is NULL, the result of this function is also NULL. As AES is
a block-level algorithm, padding is used to encode uneven length strings and
so the result string length may be calculated as
16*(trunc(string_length/16)+1). If AES_DECRYPT() detects invalid data or
incorrect padding, it returns NULL. However, it is possible for
AES_DECRYPT() to return a non-NULL value (possibly garbage) if the input
data or the key are invalid. You can use the AES functions to store data in
an encrypted form by modifying your queries:

INSERT INTO t VALUES (1,AES_ENCRYPT(text,password));

You can get even more security by not transferring the key over the
connection for each query, which can be accomplished by storing it in a
server side variable at connection time:

SELECT @password:=my password;
INSERT INTO t VALUES (1,AES_ENCRYPT(text,@password));

AES_ENCRYPT() and AES_DECRYPT() were added in version 4.0.2, and can be
considered the most cryptographically secure encryption functions currently
available in MySQL.

-Kevin

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


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
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]



Re: Select statement with a field name that is a number?

2003-08-14 Thread Bernhard Schmidt
hi

use ` instead of ' may solve the problem.

regards
benny

- Original Message -
From: Zach [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 06, 2003 7:04 PM
Subject: Select statement with a field name that is a number?


I'm trying to use a select statement for a table that uses numbers for the
field names. Here is the query I've been trying. Please help!

SELECT * FROM table_name WHERE '18'=1; (18 is the field name, 1 obviously is
the value I'm looking for.)

Everytime I have tried a variation, I get the same result where MySQL keeps
evaluating the WHERE statement like a mathematical equation.

-Zach


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



i need help, innodb blocks insertion into table for a while

2003-07-17 Thread Bernhard Schmidt
hi dear mysql list members

 

i have setup a mysql database 4.013 with innodb enabled. when i set the transaction 
isolation level to serializable. after executing a specific query is the insertion 
into a table blocked for about 20 seconds. the table is defined as follows

 

CREATE TABLE `slide` 

( 

`id` bigint(20) unsigned NOT NULL auto_increment, 

`identifier` varchar(255) NOT NULL default '', 

`comment` varchar(255) default NULL, 

`fromid` bigint(20) unsigned NOT NULL default '0', 

`system` tinyint(1) unsigned NOT NULL default '0', 

`size` int(10) unsigned NOT NULL default '0', 

`data` text NOT NULL, 

`modifyid` bigint(20) unsigned NOT NULL default '0', 

`modifytime` bigint(20) unsigned NOT NULL default '0', 

PRIMARY KEY (`id`)  

) TYPE=InnoDB 

 

 

executing the following query seems to work well. it returns quickly and the result is 
as expected.

 

SELECT `id`, `data` FROM `slide` WHERE LOCATE('filterid=7',`data`) != 0

 

but the first insertion into the slide table after that select is locked for about 20 
seconds. selects work without any timeout. i would be happy if someone has an idea how 
i can resolve the problem.

 

best regards

benny




RE: i need help, innodb blocks insertion into table for a while

2003-07-17 Thread Bernhard Schmidt
hi

i solved the problem by executing the commit after the select.

best regards
benny




compare longblob with binary data

2003-07-16 Thread Bernhard Schmidt
hi all

a question about checking the data of a longblob for equality. assume the `data` field 
is of type longblob. the following statement returns the image records with equal data.

SELECT * FROM `image` WHERE `data`=?

how does mysql performe the test. does it check the length of the blob before 
comparing the data, or makes it sense to add the length test as follows

SELECT * FROM `image` WHERE LENGTH(`data`) = ? AND `data`=?

any suggestions?

best regard
benny



recursive sql statement

2003-07-09 Thread Bernhard Schmidt
hi

i searched the mysql doc for support of recursive sql statements, but found nothing. i 
am right that mysql does not support such kind of statements?

best regards
benny


Re: recursive sql statement

2003-07-09 Thread Bernhard Schmidt
for me a recursive sql statement is when the result of a query can be used for a 
following query. the statement has start and stop condition. such kind of queries is 
useful for tree traversal. sql is based on relational algebra that does not allow to 
write such expressions. but as mentioned by rudy metzger some databases defines 
extensions to sql, oracle uses connect by. db2 has another apporach using with. 



best regards

benny

 


Re: recursive sql statement

2003-07-09 Thread Bernhard Schmidt
hi victoria

sorry for this mysql newbie question, but what means planned for the near future? 
ist this weeks, months or years away?

best regards
benny



RE: RESETTING AUTO_INCREMENT

2003-07-09 Thread Bernhard Schmidt
hi mike

you suggested the following

 If you are referring to recovering some auto_increment values that were previously 
 used by no rows now use  them, it is better to avoid this.

how can you prevent this?

best regards
benny



innodb transaction

2003-07-07 Thread Bernhard Schmidt
hi all

i started working with the innodb databasel. after reading the manual i am not sure 
how i shall use transctions. say i have the following case:

SELECT read some row
UPDATE depending on the select
COMMIT

to make the command sequence safe, the select has to lock the table. it would be nice 
to have something like:

START TRANSACTION
SELECT read some row
UPDATE depending on the select
COMMIT

any row accessed between START TRANSACTION and COMMIT automatically locks the rows. 
but the manual does not exactly describe the behavior of the commands START 
TRANSACTION, BEGIN etc. It only denotes that it servers for ad-hoc transactions. i 
know that i can use the LOCK IN SHARE MODE with the SELECT command, but is this the 
only way?

best regards
benny




Re: innodb transaction

2003-07-07 Thread Bernhard Schmidt
hi

many thanks for that quick and precise answer - a big smile. i am very
impressed by this user group, especially regarding the speed and quality of
the answers.

regards
benny


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



Re: AUTO_INCREMENT

2003-06-07 Thread Bernhard Schmidt
hi

you can reset the counter yourself with the following sql statement

ALTER TABLE tbl_name AUTO_INCREMENT = 1;


best regards
benny

- Original Message -
From: Dylan Pham [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 7:27 PM
Subject: AUTO_INCREMENT


 Hi,
 I am new and am wodering if anyone can point out how
 to make AUTO_INCREMENT readjust the numbers so that
 when you delete a row it will go back to using the
 next number after the last row in the table?

 Thank you.
 Hai

 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
 http://calendar.yahoo.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]