RE: primary key based on unique value for two columns

2001-11-12 Thread Daniel Las

Hi

You are wrong.

Just try for example:

 create table test(
pk1 int not null,
pk2 int not null,
primary key(pk1,pk2)
);

Regards


Daniel £aœ
e-direct Polska sp. z o.o.
WWW: http://www.e-direct.pl
E-mail: [EMAIL PROTECTED]
45-072 Opole ul. Reymonta 45
tel. +48 77 44 26 073
fax. +48 77 44 26 074

 -Original Message-
 From: Brendin [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 12, 2001 7:37 PM
 To: [EMAIL PROTECTED]
 Subject: primary key based on unique value for two columns


 I would like to have a table that has a primary key defined on a
 combination of two columns in the table.  In other words a unique key
 based upon the values in two columns.

 I don't think I am able to do this in mysql.  I think you can only have
 a primary key on one column and not on a combination of columns.  If I
 am wrong please correct me.

 I am looking for work arounds.  I have thought of one.  That would be to
 concatenate the columns and use a field terminator such as a - to
 separate the values or (columns) in the single column.  Then you could
 use string functions to parse the columns.  Ex:

 For column 1 in concatenated column
 left( ColumnName, (instr( ColumnName, '-') - 1) )

 For column 2 in concatenated column
 Substr (ColumName, (instr ( ColumnName, '-') + 1) , length(ColumnName)-
 (instr ( ColumnName, '-') + 1)  )

 Is there any other way to do this?


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

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



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

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




RE: how to move db

2001-11-12 Thread Daniel Las

Hi

The safest way to do this is to use mysqldump utility.

mysqldump -u [username] -p dbname  /path/to/dumpfile

and then

mysql -u [username] -p dbname  /path/to/dumpfile

Regards


Daniel £aœ
e-direct Polska sp. z o.o.
WWW: http://www.e-direct.pl
E-mail: [EMAIL PROTECTED]
45-072 Opole ul. Reymonta 45
tel. +48 77 44 26 073
fax. +48 77 44 26 074

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 12, 2001 8:57 PM
 To: [EMAIL PROTECTED]
 Subject: how to move db




 I'm switching over to a bigger better faster server. My old
 server is running
 version 3.23.22-6 mysql on RH and I need to move all the db's to
 my new box
 using 3.23.41 installed on RH7.2. So do I just simply move all of the db
 directories from /var/lib/mysql from one box to the next or are
 there other
 files that I need to copy as well.

 Thanks for the assist





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

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



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

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




ODP: MySQL privileges

2001-10-29 Thread Daniel Las

Hi

Just type: mysql -u root

Regards

 -Oryginalna wiadomoϾ-
 Od: COLLINEAU Franck FTRD/DMI/TAM
 [mailto:[EMAIL PROTECTED]]
 Wys³ano: 29 paŸdziernika 2001 15:05
 Do: '[EMAIL PROTECTED]'
 Temat: MySQL privileges


 Hi!

 I'm working on a Linux Mandrake 8.1 station.
 I have installed MySQL. I have typed './mysql_install_db'
 When i type mysql, i have the prompt mysql
 But when i type create database phpdig i have the error message: ERROR
 1044: Access denied for user:
 '@localhost' to database 'phpdig'.

 Can anybody help me ?


 Thanks

 Franck

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

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



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

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




ODP: Tree in SQL

2001-10-22 Thread Daniel Las

Thank you. I was trying too long to do this in SQL.

 -Oryginalna wiadomoϾ-
 Od: Dan Nelson [mailto:[EMAIL PROTECTED]]
 Wys³ano: 22 paŸdziernika 2001 23:38
 Do: Daniel _a_
 DW: Lista MySQL
 Temat: Re: Tree in SQL


 In the last episode (Oct 22), Daniel _a_ said:
  I have a table in database which describes tree structure of
 article groups.
  In this table I have:
  1. group_id - group identifier
  2. parent_group_id - identifier of parent group
  I need to select history, from top to wanted group.
  I can't change the database design and ofcourse this is MySQL
 3.23 database.
  Can somebody help me ?

 You'll have to do multiple selects.  Loop:

 select parent_group_id from table where group_id = :myid
 :myid = parent_group_id

 Stop when myid == the ID of the top of the tree.

 --
   Dan Nelson
   [EMAIL PROTECTED]



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

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




ODP: Can only create 127 records in a table :o(

2001-06-15 Thread Daniel Las

Hi

WHat is your hardware configuration ?
I had such problem with Alpha/Linux (RedHat 5.2)

Regards

Daniel £aœ
e-direct Polska sp. z o.o.
WWW: http://www.e-direct.pl
E-mail: [EMAIL PROTECTED]
45-072 Opole ul. Reymonta 45
tel. +48 77 44 26 073
fax. +48 77 44 26 074

 -Oryginalna wiadomoϾ-
 Od: Mette Møller Madsen [mailto:[EMAIL PROTECTED]]
 Wys³ano: 15 czerwca 2001 13:46
 Do: mysql listserver
 Temat: Can only create 127 records in a table :o(


 Hi there!

 When I try to insert more than 127 rows/records in a table I get
 this error:

 ERROR 1062: Duplicate entry '127' for key 1
 (the key is an auto incremented primary key)

 Does anyone know how to store _more_ than 127 rows in a table?

 My guess is that I need to change to settings of my db, but I cannot find
 anything in the manual. (I'm running version 3.23.38 which should be a
 stable one.)

 best regards,
 Mette Madsen


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

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



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

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