Trigger Lock table

2005-08-21 Thread Häusler Tom
System Linux SUSE 9.1 with mysql-max-5.0.11-beta-linux-i686.tar.gz
Trigger:
 
create trigger CustomerHistoryUPD
BEFORE Update
on Customer
  For each ROW BEGIN
  insert into CustomerHist select * from Customer where FD_ID = OLD.FD_ID;
  Update CustomerHist set HistDate = NOW() where FD_ID = OLD.FD_ID;
  END;
  
create trigger CustomerHistoryDEL
BEFORE Delete
on Customer
  For each ROW BEGIN
  insert into CustomerHist select * from Customer where FD_ID = OLD.FD_ID;
  Update CustomerHist set HistDate = NOW() where FD_ID = OLD.FD_ID;
  END;
 
 
Have anyone an hind for, why this trigger Lock the Table Customer ??
Is it a problem, that i have not compile the version on my system ?

Thanks to all who have a hind form e.

 




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



Trouble configuring mysql-nt as a service with --skip-.* switches

2005-08-21 Thread Maxim Vexler
C:\mysql\binmysqld-nt.exe --version
mysqld-nt.exe  Ver 4.0.25-nt-log for Win32 on ia32 (Official MySQL binary)

C:\mysql\binmysqld-nt.exe --install MySQL --defaults-file=%windir%\my.ini
Service successfully installed.

C:\mysql\binmysqld-nt.exe --remove
Service successfully removed.

C:\mysql\binmysqld-nt.exe --skip-bdb --skip-isam --install MySQL
--defaults-file=%windir%\my.ini
050821 12:50:39 mysqld-nt.exe: unknown option '--isam'



What am I doing wrong ?

-- 
Cheers, 
Maxim Vexler (hq4ever).

Do u GNU ?

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



'ODBC'@'localhost' instead of 'root'@'invalid_hostname.com' ?!??

2005-08-21 Thread Martin Olsson

Hi,

I'm using PHP/MySQL to development a web-based application. I just 
upgraded both PHP and MySQL and I noticed that some of my MySQL calls 
are now broken and I don't see any easy way to fix them.


My script calls mysql_connect() and does very careful error checking. 
It's important that I can tell apart invalid hostname errors from say 
incorrect username/password errors. Previously, I did this by checking 
mysql_errno(), where 2003 would mean bad hostname and 1045 would 
indicate bad username/password.


In the latest PHP/MySQL bundle I downloaded this functionality changed 
though. In this new version, whenever I feed it with a invalid hostname 
it will fallback to localhost (where I actually have a database running) 
and then it will subsequently report a 1045 instead of a 2003.


Oddly enough, the exact error message (mysql_error) I get attached to 
this 1045 says; mysql_error()==


Access denied for user 'ODBC'@'localhost' (using password: NO)

Now, what is this about? I sure did not feed it with a username 'ODBC'. 
I do use Windows 2005 but how could ODBC possibly be related to this? (I 
assume ODBC means that [Microsoft?] database connection thing, I'm not 
sure exactly what is it; i've never used it). For the record, the actual 
username I specified in the call with the invalid hostname was root.


---

So, the question is how can I tell these errors apart?

Why is mysql_error() reporting back that it tried to connect to 
localhost as user ODBC when I asked it to connect to an invalid 
hostname as user root ?!?!




sincerly,
martin

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



renaming a database

2005-08-21 Thread Octavian Rasnita
Hi,

Please tell me how to rename a database. I couldn't find this in the manual.
I have tried to rename manually the name of the directory that holds that
database, but some tables can't be accessed after that. (I have found that
they are InnoDB tables, even though I never specified that I want this type
of engine when creating the tables).

Thank you.


Teddy



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



Re: renaming a database

2005-08-21 Thread Peter Brawley




Octavian

Please tell me how to rename a database. 

As you already found, there are database features that don't survive
renaming its directory. Best method I know is to mysqldump it and
recreate it
from the dump under the desired name.

PB
http://www.artfulsoftware.com

-

Octavian Rasnita wrote:

  Hi,

Please tell me how to rename a database. I couldn't find this in the manual.
I have tried to rename manually the name of the directory that holds that
database, but some tables can't be accessed after that. (I have found that
they are InnoDB tables, even though I never specified that I want this type
of engine when creating the tables).

Thank you.


Teddy



  



No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.13/78 - Release Date: 8/19/2005


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

Re: MySQLDUMP Problem

2005-08-21 Thread Jeff Shapiro
On Thursday 18 August 2005 09:34, Carlos J Souza wrote:
 Sirs,

 When i use  mysqldump on Version 4.1.x, all tables had a one record insert
 generated in script. When i use mysqldump on a 4.0.x version this problem
 dos not occurs.

 How to solve it?

That's because extended inserts are on by default in 4.1.x. To get multiple 
inserts (usually slower) use a command like:

mysqldump --skip-extended-insert mydatabase  mydatabase.sql

-- 
Jeff Shapiro
listserv only address

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



MySQLD aborts

2005-08-21 Thread Tim Johnson
Hi:
I have version 4.0.20 on slack 10.0.
Mysqld fails on startup.

From mysqld is the following:

50821 11:10:44  mysqld started
050821 11:10:44  Warning: Can't create test file /var/lib/mysql/linus.lower-test
^G/usr/libexec/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
050821 11:10:44  Aborting

050821 11:10:44  /usr/libexec/mysqld: Shutdown Complete

050821 11:10:44  mysqld ended
-
I'm not much of a linux system guru, and I am guessing from
the messages above that I have a problem with permissions. 

Can anyone point me to the solution?
Many Thanks
tim

-- 
Tim Johnson [EMAIL PROTECTED]
  http://www.alaska-internet-solutions.com

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



Replication seems ok, but doesn't work

2005-08-21 Thread Neven Luetic
Hello,

I have set up replication between several servers, all using the same
version of mysql (4.0.25, however on different Versions of SuSE-Linux).

Production databases of the master server are replicated on the slave
server using the same database name with an underscore. This works in
all but one case.

I'm connecting through a tunnel, so that's the reason for
Master_Host/Master_Port, and I have defined a user replikation that
has the necessary privileges (identical on all servers). 

show slave status gives:

| Master_Host | Master_User | Master_Port | Connect_retry |
Master_Log_File | Read_Master_Log_Pos | Relay_Log_File |
Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running |
Slave_SQL_Running | Replicate_do_db | Replicate_ignore_db | Last_errno |
Last_error | Skip_counter | Exec_master_log_pos | Relay_log_space |
+-+-+-+---+-+-++---+---+--+---+-+-+++--+-+-+
| 127.0.0.1   | replikation | 13306   | 60|
master-host-bin.7397  | 261948  | slave-host-relay-bin.001 |
2463878   | master-host-bin.7397| Yes  | Yes
| _rtest  |   | 0  || 0| 261948
| 2463878|

So it seems everything is ok. But changes in the original database
rtest on the masterserver aren't replicated to _rtest on the slave.
I tried different slaves, but to no avail.

Any ideas how to track down this error?

Greetings

Neven






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



Re: MySQLD aborts

2005-08-21 Thread Michael Stassen

Tim Johnson wrote:

Hi:
I have version 4.0.20 on slack 10.0.
Mysqld fails on startup.


From mysqld is the following:


50821 11:10:44  mysqld started
050821 11:10:44  Warning: Can't create test file /var/lib/mysql/linus.lower-test
^G/usr/libexec/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
050821 11:10:44  Aborting

050821 11:10:44  /usr/libexec/mysqld: Shutdown Complete

050821 11:10:44  mysqld ended
-
I'm not much of a linux system guru, and I am guessing from
the messages above that I have a problem with permissions. 


Can anyone point me to the solution?
Many Thanks
tim


You can get more info about an error message with perror:

  ~: perror 13
  OS error code  13:  Permission denied

As you guessed, a permissions error.  Apparently, the user running mysqld 
(usually user mysql) does not have access rights to /var/lib/mysql/.  Most 
likely, user mysql is not set as the owner of /var/lib/mysql/, in which case 
you need to


  chown -R mysql:mysql /var/lib/mysql/

as root.

Michael

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



MySQL REGEXP problems...

2005-08-21 Thread John thegimper
SELECT * FROM tbl WHERE item REGEXP 'SEARCHSTRING'

Database holds:
SAMSUNG IDE 40GB 7200RPM

Search for
SAMSUNG IDE 7200RPM = 0 RESULTS
SAMSUNG 40GB 7200RPM = 0 RESULTS
SAMSUNG +40GB +7200RPM = 0 RESULTS
SAMSUNG IDE 40GB = 1 RESULT

How do i need to change the SEARCHSTRING to use AND for each word?
SAMSUNG 40GB should return one result.








-
FREE E-MAIL IN 1 MINUTE!
 - [EMAIL PROTECTED] - http://www.pc.nu

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



Re: MySQL REGEXP problems...

2005-08-21 Thread John thegimper
Here is another user with the same problem
http://forums.pcworld.co.nz/archive/index.php/t-34536.html

Maybe his explanation is better :)

Quoting John thegimper [EMAIL PROTECTED]:

 SELECT * FROM tbl WHERE item REGEXP 'SEARCHSTRING'
 
 Database holds:
 SAMSUNG IDE 40GB 7200RPM
 
 Search for
 SAMSUNG IDE 7200RPM = 0 RESULTS
 SAMSUNG 40GB 7200RPM = 0 RESULTS
 SAMSUNG +40GB +7200RPM = 0 RESULTS
 SAMSUNG IDE 40GB = 1 RESULT
 
 How do i need to change the SEARCHSTRING to use AND for each word?
 SAMSUNG 40GB should return one result.
 
 
 
 
 
 
 
 
 -
 FREE E-MAIL IN 1 MINUTE!
  - [EMAIL PROTECTED] - http://www.pc.nu
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 
 



 

-
FREE E-MAIL IN 1 MINUTE!
 - [EMAIL PROTECTED] - http://www.pc.nu

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



Re: MySQL REGEXP problems...

2005-08-21 Thread John thegimper
ok just figured out that if the database contains one and one is two
and i use regexp to search for one two it will not match.
If i search for one(.*)two it will.
But how can i make it match if i search for two one ?

Quoting John thegimper [EMAIL PROTECTED]:

 Here is another user with the same problem
 http://forums.pcworld.co.nz/archive/index.php/t-34536.html
 
 Maybe his explanation is better :)
 
 Quoting John thegimper [EMAIL PROTECTED]:
 
  SELECT * FROM tbl WHERE item REGEXP 'SEARCHSTRING'
  
  Database holds:
  SAMSUNG IDE 40GB 7200RPM
  
  Search for
  SAMSUNG IDE 7200RPM = 0 RESULTS
  SAMSUNG 40GB 7200RPM = 0 RESULTS
  SAMSUNG +40GB +7200RPM = 0 RESULTS
  SAMSUNG IDE 40GB = 1 RESULT
  
  How do i need to change the SEARCHSTRING to use AND for each word?
  SAMSUNG 40GB should return one result.
  
  
  
  
  
  
  
  
  -
  FREE E-MAIL IN 1 MINUTE!
   - [EMAIL PROTECTED] - http://www.pc.nu
  
  -- 
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
  
  
 
 
 
  
 
 -
 FREE E-MAIL IN 1 MINUTE!
  - [EMAIL PROTECTED] - http://www.pc.nu
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 
 



 

-
FREE E-MAIL IN 1 MINUTE!
 - [EMAIL PROTECTED] - http://www.pc.nu

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



Re: Is there an easy way to copy a table between two mysql servers?

2005-08-21 Thread Enrique Sanchez Vela

Hi,

 I would suggest using --hex-blob and --quote-names
options of the mysqldump command.

regards,
esv.


--- Santino [EMAIL PROTECTED] wrote:

 Try:
 
 mysqldump -h yourhost.com -u username -ppasswd
 mydatabase mytable | mysql -h
 yournewhost.som -u newuser -ppasswd newdatabase
 
 Santino Cusimano
 
 At 17:19 +0200 20-08-2005, John thegimper wrote:
 Thanks, but that copies the whole database 
 right? Can i specify only one table?
 
 Quoting Pooly [EMAIL PROTECTED]:
 
   If you have a mysqlclient an an access to the
 command line, you can
   directly pipe it !
 
   mysqldump -h yourhost.com -u username -ppasswd
 mydatabase | mysql -h
   yournewhost.som -u newuser -ppasswd newdatabase
 
   that's it !
   otherwise, yes dump/export.
 
   2005/8/20, John thegimper [EMAIL PROTECTED]:
Is there an easy way to copy a table between
 two mysql servers? Or do
   i need to
export and then import? I´m using php btw.
   
Thanks,
Johhn
   
   
 -
FREE E-MAIL IN 1 MINUTE!
 - [EMAIL PROTECTED] - http://www.pc.nu
   
--
MySQL General Mailing List
For list archives:
 http://lists.mysql.com/mysql
To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
   
   
 
 
   --
   Pooly
   Webzine Rock : http://www.w-fenec.org/
 
   --
   MySQL General Mailing List
   For list archives: http://lists.mysql.com/mysql
   To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 
 
 
 
 
 -
 FREE E-MAIL IN 1 MINUTE!
   - [EMAIL PROTECTED] - http://www.pc.nu
 
 --
 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]
 
 


Enrique Sanchez Vela
email: [EMAIL PROTECTED]
-
It's often easier to fight for one's||We live in the outer space
   
principles than to live up to them||Rev. Kay Greenleaf
Adlai Stevenson||

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: MySQL REGEXP problems...

2005-08-21 Thread Enrique Sanchez Vela


possible answers to your request are:

select * from tablename where stringname REGEXP
'SAMSUNG[^4]*40GB';

select * from tablename where stringname REGEXP
'SAMSUNG.*40GB'


they both matched your sample string, I personally
like the first one better but it is up to you the one
to use.

regards,
esv.




--- John thegimper [EMAIL PROTECTED] wrote:

 Here is another user with the same problem

http://forums.pcworld.co.nz/archive/index.php/t-34536.html
 
 Maybe his explanation is better :)
 
 Quoting John thegimper [EMAIL PROTECTED]:
 
  SELECT * FROM tbl WHERE item REGEXP 'SEARCHSTRING'
  
  Database holds:
  SAMSUNG IDE 40GB 7200RPM
  
  Search for
  SAMSUNG IDE 7200RPM = 0 RESULTS
  SAMSUNG 40GB 7200RPM = 0 RESULTS
  SAMSUNG +40GB +7200RPM = 0 RESULTS
  SAMSUNG IDE 40GB = 1 RESULT
  
  How do i need to change the SEARCHSTRING to use
 AND for each word?
  SAMSUNG 40GB should return one result.
  
  
  
  
  
  
  
  
  -
  FREE E-MAIL IN 1 MINUTE!
   - [EMAIL PROTECTED] - http://www.pc.nu
  
  -- 
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
  
  
 
 
 
  
 
 -
 FREE E-MAIL IN 1 MINUTE!
  - [EMAIL PROTECTED] - http://www.pc.nu
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 
 


Enrique Sanchez Vela
email: [EMAIL PROTECTED]
-
It's often easier to fight for one's||We live in the outer space
   
principles than to live up to them||Rev. Kay Greenleaf
Adlai Stevenson||

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: MySQL REGEXP problems...

2005-08-21 Thread Enrique Sanchez Vela

John,

using  'one.*two|two.*one' would do it. :)

regards,
esv.


--- John thegimper [EMAIL PROTECTED] wrote:

 ok just figured out that if the database contains
 one and one is two
 and i use regexp to search for one two it will not
 match.
 If i search for one(.*)two it will.
 But how can i make it match if i search for two
 one ?
 
 Quoting John thegimper [EMAIL PROTECTED]:
 
  Here is another user with the same problem
 

http://forums.pcworld.co.nz/archive/index.php/t-34536.html
  
  Maybe his explanation is better :)
  
  Quoting John thegimper [EMAIL PROTECTED]:
  
   SELECT * FROM tbl WHERE item REGEXP
 'SEARCHSTRING'
   
   Database holds:
   SAMSUNG IDE 40GB 7200RPM
   
   Search for
   SAMSUNG IDE 7200RPM = 0 RESULTS
   SAMSUNG 40GB 7200RPM = 0 RESULTS
   SAMSUNG +40GB +7200RPM = 0 RESULTS
   SAMSUNG IDE 40GB = 1 RESULT
   
   How do i need to change the SEARCHSTRING to use
 AND for each word?
   SAMSUNG 40GB should return one result.
   
   
   
   
   
   
   
   
  
 -
   FREE E-MAIL IN 1 MINUTE!
- [EMAIL PROTECTED] - http://www.pc.nu
   
   -- 
   MySQL General Mailing List
   For list archives: http://lists.mysql.com/mysql
   To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
   
   
  
  
  
   
  
  -
  FREE E-MAIL IN 1 MINUTE!
   - [EMAIL PROTECTED] - http://www.pc.nu
  
  -- 
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
  
  
 
 
 
  
 
 -
 FREE E-MAIL IN 1 MINUTE!
  - [EMAIL PROTECTED] - http://www.pc.nu
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 
 


Enrique Sanchez Vela
email: [EMAIL PROTECTED]
-
It's often easier to fight for one's||We live in the outer space
   
principles than to live up to them||Rev. Kay Greenleaf
Adlai Stevenson||




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

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



Re: MySQLD aborts

2005-08-21 Thread Tim Johnson
... 
 You can get more info about an error message with perror:
 
   ~: perror 13
   OS error code  13:  Permission denied
 
 As you guessed, a permissions error.  Apparently, the user running mysqld 
 (usually user mysql) does not have access rights to /var/lib/mysql/.  Most 
 likely, user mysql is not set as the owner of /var/lib/mysql/, in which 
 case you need to
 
   chown -R mysql:mysql /var/lib/mysql/
 
 as root.

  Bingo! That worked and I learned *two* things. :-)
  thanks
  tim

-- 
Tim Johnson [EMAIL PROTECTED]
  http://www.alaska-internet-solutions.com

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