Re: memory usage
Hi Joerg, Thanks a lot for the info. regards anandkl On 7/23/08, Joerg Bruehe [EMAIL PROTECTED] wrote: Hi ! Ananda Kumar wrote: Hi All, I have setup slave db. The machine configuration details of this slave is same as master. OS=redhat 8 cpu 16GB RAM key_buffer_size=3000M innodb_buffer_pool_size=1M. But when i do top, in the master db Cpu(s): 0.5%us, 0.3%sy, 0.0%ni, 87.2%id, 11.9%wa, 0.0%hi, 0.1%si, 0.0%st Mem: 16436956k total, 16350252k used,86704k free, 9188k buffers Swap: 16386292k total,37232k used, 16349060k free, 2358944k cached PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 28706 mysql 15 0 14.3g 13g 4688 S6 84.1 540:21.55 mysqld On slave db Cpu(s): 0.7%us, 0.2%sy, 0.0%ni, 87.3%id, 11.8%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 16436956k total, 16351536k used,85420k free,16400k buffers Swap: 16386292k total, 164k used, 16386128k free, 4289520k cached PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 14042 mysql 18 0 14.0g 11g 4652 S7 72.5 265:08.62 mysqld 435 root 10 -5 000 S0 0.0 3:29.07 kswapd0 As you can see the RES in master is 13g, but on slave its 11G any specific reason for this. This is causing some of the sql's on the slave to be slower than master for the same select statement on both master and slave. RES is the amount of RAM used by the process, as controlled by the memory allocation (Linux kernel). It depends not only on the address space requested by the process, but also on those by other processes and on the paging / swapping policy (which AFAIK depends on the which process accesses memory how frequent). The MySQL process on the slave has a smaller RES if and only if there is reason for the Linux kernel to allocate less RAM, this typically means there are other processes requiring it more urgently. *If* the database load on the master is higher, or accesses more data, or there is less competition about the RAM, it is only natural that RES for the slave is less. Database performance strongly depends on caching: If the cache on the master already contains the needed pages, and on the slave it doesn't, it is normal that the first statement needing them has to wait for disk I/O and so is slower. Jörg -- Joerg Bruehe, MySQL Build Team, [EMAIL PROTECTED] Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer Vorsitzender des Aufsichtsrates: Martin Haering Muenchen: HRB161028
mysql shell with utf8 databa
I'm still using win2k mysql 5.1 With default databas encoding, I can do querys with bh English and Chinese GB. But when database encoding is uft8, all the Chinese become question maks. Any idea about how to mysql work unicode databa? Thanks a lot.
Re: PHP, MySQL questions
Hi Chaim Contents are going to be dynamic... I will go with Apache 2.2.9 and also PHP with ACP (accelator) Any suggestions? Regards VJ On Tue, Jul 22, 2008 at 10:18 PM, Chaim Rieger [EMAIL PROTECTED] wrote: VeeJay wrote: Hi there I am going to make 2 Webserver at my work going to handle 50 mil hits per month... They are using Linux already. But being a FreeBSD fan, I have proposed MySQL and FreeBSD to my Boss convincing him that MySQL and FreeBSD is more Fast and Secure solution for his needs... And now I want to show the snip... static or dynamic pages ? apache or lighttp ? -- -- Chaim Rieger -- Thanks! BR / vj
WHERE .... IN
Hi all, I have a problem as below: A text field -Lets call it 'field1'- contains datas seperated by commas(,) like this (123,5764,8795,9364,11,232,. and go on) And so my lines like these: id title filed1 - 1 title1 123,576412 2 title2 123 3 title3 576412,8795,123 4 title4 123 5 title5 576412,1164,12,232 .. ... ... .. ... ... I am looking for lines which includes the matched value within the field1 seperated case. For example: SELECT id, title, field1 FROM mesaj WHERE 123 IN (field1) result is. 1 title1 123,576412 2 title2 123 4 title4 123 But I want it to match with third one. 3 title3 576412,8795,123 Because it have a 123 at the end. But It does not! :( Is there another way to do this. LIKE doesn't work because SELECT id, title, field1 FROM mesaj WHERE field1 LIKE 12 returns many result which is not my intention. Thank you. -- Ali Deniz EREN [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: WHERE .... IN
A text field -Lets call it 'field1'- contains datas seperated by commas(,) like this (123,5764,8795,9364,11,232,. The solution is to normalise the data. PB Ali Deniz EREN wrote: Hi all, I have a problem as below: A text field -Lets call it 'field1'- contains datas seperated by commas(,) like this (123,5764,8795,9364,11,232,. and go on) And so my lines like these: id title filed1 - 1 title1 123,576412 2 title2 123 3 title3 576412,8795,123 4 title4 123 5 title5 576412,1164,12,232 .. ... ... .. ... ... I am looking for lines which includes the matched value within the field1 seperated case. For example: SELECT id, title, field1 FROM mesaj WHERE 123 IN (field1) result is. 1 title1 123,576412 2 title2 123 4 title4 123 But I want it to match with third one. 3 title3 576412,8795,123 Because it have a 123 at the end. But It does not! :( Is there another way to do this. LIKE doesn't work because SELECT id, title, field1 FROM mesaj WHERE field1 LIKE 12 returns many result which is not my intention. Thank you. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: WHERE .... IN
On Wed, 2008-07-23 at 17:05 +0300, Ali Deniz EREN wrote: Hi all, I have a problem as below: A text field -Lets call it 'field1'- contains datas seperated by commas(,) like this (123,5764,8795,9364,11,232,. and go on) And so my lines like these: id title filed1 - 1 title1 123,576412 2 title2 123 3 title3 576412,8795,123 4 title4 123 5 title5 576412,1164,12,232 .. ... ... .. ... ... I am looking for lines which includes the matched value within the field1 seperated case. For example: SELECT id, title, field1 FROM mesaj WHERE 123 IN (field1) result is. 1 title1 123,576412 2 title2 123 4 title4 123 But I want it to match with third one. 3 title3 576412,8795,123 Because it have a 123 at the end. But It does not! :( Is there another way to do this. LIKE doesn't work because SELECT id, title, field1 FROM mesaj WHERE field1 LIKE 12 returns many result which is not my intention. Thank you. -- Ali Deniz EREN [EMAIL PROTECTED] How about: WHERE ( field1 LIKE '123,%' OR field1 LIKE '*,123,%' OR field1 LIKE '%,123' OR field1 = '123' ) Note that this could that a long time on large tables. You'd be better off to normalize your tables ;) -- Just my 0.0002 million dollars worth, Shawn Where there's duct tape, there's hope. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: PHP, MySQL questions
VeeJay wrote: Hi there I am going to make 2 Webserver at my work going to handle 50 mil hits per month... They are using Linux already. But being a FreeBSD fan, I have proposed MySQL and FreeBSD to my Boss convincing him that MySQL and FreeBSD is more Fast and Secure solution for his needs... And now I want to show the results... *Hardware: *Dell PowerEdge 2950 III having 2 x CPU 3,0 GHz Intel Xeon L5450 Quad-Core 2x6MB cache WITH 16 GB RAM. *Tools:* 1. FreeBSD 7 Production Release 2. Apache 2.2.9 3. MySQL 5.1.26 4. PHP 5.2.6 My question is, *To get the speed, performance and security*: Should I use Ports or Packages to install all these tools One by One? *OR * Should I use TAR files and compile them manually. For example giving command line arguments and commands like ./configure --prefix=/www --enable-module=so make make install cd ../php-xxx ./configure --with-mysql --with-apxs=/www/bin/apxs make make install etc I have googled but still haven't reached to solution...personally I would prefer comiling them with command line arguments but then I seek some help from you guys i.e. How should I write this ./configure..stuff in FreeBSD and what would be the best options combination, I must choose to get the speed, performane and security in Apache, MySQL and PHP? Any suggestion is very welcomed! This may provide some advice for MySQL of freebsd, looks like you just install it from ports. http://people.freebsd.org/~kris/scaling/mysql.html http://wiki.freebsd.org/MySQL Hope this provides some confidence, Ken -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
a question...
Guys, I have been fighting with mysql trying to get it to only show every after the last dot(.) on a ip. for example instead geting 10.0.0.0 only get 10.0.0 But what every I try doesn't work. Can someone pls point to a web page where I can learn how to do it, of explain it here. Thanks. Payne -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: a question...
On Wed, Jul 23, 2008 at 11:45 AM, [EMAIL PROTECTED] wrote: Guys, I have been fighting with mysql trying to get it to only show every after the last dot(.) on a ip. for example instead geting 10.0.0.0 only get 10.0.0 As pulled from a database row? Sorry, I didn't quite understand your email. -- /Daniel P. Brown Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: a question...
Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10; +-+---+ | ip | count(ip) | +-+---+ | 83.117.196.206 | 1 | | 85.17.109.28| 1 | | 125.138.96.19 | 1 | | 89.110.148.253 | 1 | | 192.168.105.10 | 1 | | 200.170.124.72 | 1 | | 201.116.98.214 | 1 | | 202.168.255.226 | 1 | | 203.89.243.158 | 1 | | 210.245.207.217 | 1 | +-+---+ 10 rows in set (0.00 sec) On Wed, Jul 23, 2008 at 11:45 AM, [EMAIL PROTECTED] wrote: Guys, I have been fighting with mysql trying to get it to only show every after the last dot(.) on a ip. for example instead geting 10.0.0.0 only get 10.0.0 As pulled from a database row? Sorry, I didn't quite understand your email. -- /Daniel P. Brown Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: a question...
I think you're after the SUBSTRING_INDEX(str,delim,count) function, so (I've not tried this): select substring_index(ip,'.',3) from ipslimit 10; --- On Wed, 23/7/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: a question... To: Daniel Brown [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], mysql@lists.mysql.com Date: Wednesday, 23 July, 2008, 5:10 PM Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10; +-+---+ | ip | count(ip) | +-+---+ | 83.117.196.206 | 1 | | 85.17.109.28| 1 | | 125.138.96.19 | 1 | | 89.110.148.253 | 1 | | 192.168.105.10 | 1 | | 200.170.124.72 | 1 | | 201.116.98.214 | 1 | | 202.168.255.226 | 1 | | 203.89.243.158 | 1 | | 210.245.207.217 | 1 | +-+---+ 10 rows in set (0.00 sec) On Wed, Jul 23, 2008 at 11:45 AM, [EMAIL PROTECTED] wrote: Guys, I have been fighting with mysql trying to get it to only show every after the last dot(.) on a ip. for example instead geting 10.0.0.0 only get 10.0.0 As pulled from a database row? Sorry, I didn't quite understand your email. -- /Daniel P. Brown Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] __ Not happy with your email address?. Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: a question...
On Wed, Jul 23, 2008 at 12:10 PM, [EMAIL PROTECTED] wrote: Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10; +-+---+ | ip | count(ip) | +-+---+ | 83.117.196.206 | 1 | | 85.17.109.28| 1 | | 125.138.96.19 | 1 | | 89.110.148.253 | 1 | | 192.168.105.10 | 1 | | 200.170.124.72 | 1 | | 201.116.98.214 | 1 | | 202.168.255.226 | 1 | | 203.89.243.158 | 1 | | 210.245.207.217 | 1 | +-+---+ 10 rows in set (0.00 sec) Okay, this would have to be done in code, and isn't a MySQL issue. Presuming you're using PHP, I'm going to also copy this message to the PHP General mailing list, Payne, so that others can benefit from it in the archives as well. If you're not already subscribed and would like to follow along with the thread, please send a blank message to [EMAIL PROTECTED] To get the Class C on that, here's a simple function you can use: ?php function get_subnet($ip) { return substr($ip,0,strrpos($ip,'.')); } ? As a quick illustration of how it works, here's an example script (to use MySQL, just replace the $ips array with your ?php $row = mysql_fetch_array($result); ? or similar line): ?php $ips = array('192.168.0.0','10.0.0.1','127.0.0.1','216.37.159.240','99.99.99.99','127.0.0.2','192.168.1.1','10.0.0.0','192.168.0.1','192.168.0.150'); function get_subnet($ip) { return substr($ip,0,strrpos($ip,'.')); } foreach($ips as $ip) { echo $ip.'s Class C is .get_subnet($ip).\n; } ? -- /Daniel P. Brown Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: a question...
On Wed, 2008-07-23 at 12:10 -0400, [EMAIL PROTECTED] wrote: Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10; +-+---+ | ip | count(ip) | +-+---+ | 83.117.196.206 | 1 | | 85.17.109.28| 1 | | 125.138.96.19 | 1 | | 89.110.148.253 | 1 | | 192.168.105.10 | 1 | | 200.170.124.72 | 1 | | 201.116.98.214 | 1 | | 202.168.255.226 | 1 | | 203.89.243.158 | 1 | | 210.245.207.217 | 1 | +-+---+ 10 rows in set (0.00 sec) select substring( '83.117.196.206', 1, length( '83.117.196.206' ) - locate( '.', reverse( '83.117.196.206') ) ); Of course, replace '83.117.196.206' with the column name. -- Just my 0.0002 million dollars worth, Shawn Where there's duct tape, there's hope. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: a question..
Thanks Glyn, What you have given me works. I have taken it so now I get anything greater that one select substring_index(ip,'.',3), count(*) from ips group by 1 having count(*) 1 order by 2 desc limit 10; +---+--+ | substring_index(ip,'.',3) | count(*) | +---+--+ | 216.235.158 | 3 | | 218.1.65| 2 | | 202.222.30 | 2 | | 66.232.140 | 2 | | 203.172.244 | 2 | | 61.146.178 | 2 | | 66.221.68 | 2 | | 200.62.177 | 2 | | 89.41.196 | 2 | | 193.221.125 | 2 | +---+--+ 10 rows in set (0.01 sec) Again, thanks everyone... I think you're after the SUBSTRING_INDEX(str,delim,count) function, so (I've not tried this): select substring_index(ip,'.',3) from ipslimit 10; --- On Wed, 23/7/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: a question... To: Daniel Brown [EMAIL PROTECTED] Cc: [EMAIL PROTECTED], mysql@lists.mysql.com Date: Wednesday, 23 July, 2008, 5:10 PM Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10; +-+---+ | ip | count(ip) | +-+---+ | 83.117.196.206 | 1 | | 85.17.109.28| 1 | | 125.138.96.19 | 1 | | 89.110.148.253 | 1 | | 192.168.105.10 | 1 | | 200.170.124.72 | 1 | | 201.116.98.214 | 1 | | 202.168.255.226 | 1 | | 203.89.243.158 | 1 | | 210.245.207.217 | 1 | +-+---+ 10 rows in set (0.00 sec) On Wed, Jul 23, 2008 at 11:45 AM, [EMAIL PROTECTED] wrote: Guys, I have been fighting with mysql trying to get it to only show every after the last dot(.) on a ip. for example instead geting 10.0.0.0 only get 10.0.0 As pulled from a database row? Sorry, I didn't quite understand your email. -- /Daniel P. Brown Better prices on dedicated servers: Intel 2.4GHz/60GB/512MB/2TB $49.99/mo. Intel 3.06GHz/80GB/1GB/2TB $59.99/mo. Dedicated servers, VPS, and hosting from $2.50/mo. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] __ Not happy with your email address?. Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html -- 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: [PHP] Re: a question...
I just want to point out that public IPs are no longer given out as Class A, B, and C networks, but based on CIDR. You can use rwhois to figure out who has use of a certain subnet and what the range of it is. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Daniel Brown wrote: On Wed, Jul 23, 2008 at 12:10 PM, [EMAIL PROTECTED] wrote: Yes, sorry. I have a database that records ip of attacks on a customer server, what I like to do get a count so that I can see what subnet is doing the major of the attacks. select ip from ipslimit 10; +-+---+ | ip | count(ip) | +-+---+ | 83.117.196.206 | 1 | | 85.17.109.28| 1 | | 125.138.96.19 | 1 | | 89.110.148.253 | 1 | | 192.168.105.10 | 1 | | 200.170.124.72 | 1 | | 201.116.98.214 | 1 | | 202.168.255.226 | 1 | | 203.89.243.158 | 1 | | 210.245.207.217 | 1 | +-+---+ 10 rows in set (0.00 sec) Okay, this would have to be done in code, and isn't a MySQL issue. Presuming you're using PHP, I'm going to also copy this message to the PHP General mailing list, Payne, so that others can benefit from it in the archives as well. If you're not already subscribed and would like to follow along with the thread, please send a blank message to [EMAIL PROTECTED] To get the Class C on that, here's a simple function you can use: ?php function get_subnet($ip) { return substr($ip,0,strrpos($ip,'.')); } ? As a quick illustration of how it works, here's an example script (to use MySQL, just replace the $ips array with your ?php $row = mysql_fetch_array($result); ? or similar line): ?php $ips = array('192.168.0.0','10.0.0.1','127.0.0.1','216.37.159.240','99.99.99.99','127.0.0.2','192.168.1.1','10.0.0.0','192.168.0.1','192.168.0.150'); function get_subnet($ip) { return substr($ip,0,strrpos($ip,'.')); } foreach($ips as $ip) { echo $ip.'s Class C is .get_subnet($ip).\n; } ? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Log
I do a system log of their log everything that is done(INSERTS, UPDADES and DELETES). Okay, can be done with trigger. But I need to know who performed the operation. How can I get get it inside the trigger? Thank you, Att, -- 'É um orgulho ter você como nosso cliente' Pedro Belmino Desenvolvedor ArgoHost.net Hospedagem Web com Facilidade http://www.argohost.net Suporte Telefônico: (85) 3264 9944 / (11) 4063 4844 Contato direto: Ramal 107 E-mail: [EMAIL PROTECTED] begin:vcard fn:Pedro Belmino n:;Pedro Belmino org:Argohost.net;TI adr:;;;Fortaleza;CE;;Brasil email;internet:[EMAIL PROTECTED] title:Desenvolvedor tel;home:(85)32575556 tel;cell:(85)99559295 url:www.argohost.net version:2.1 end:vcard signature.asc Description: OpenPGP digital signature
Re: Log
In the last episode (Jul 23), Pedro Belmino said: I do a system log of their log everything that is done(INSERTS, UPDADES and DELETES). Okay, can be done with trigger. But I need to know who performed the operation. How can I get get it inside the trigger? Try the USER() or CURRENT_USER() functions: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_user http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_current-user -- Dan Nelson [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Master-to-Master replication on same server
You should be able to do this fine. It would help if you specified what the error you were getting was. Atle On Tue, 22 Jul 2008, Jim Lyons wrote: I recently installed 2 instances of mysql on the same server, using port 3307 for the second server, the normal 3306 for the first server. I found that while logged onto that box I could communicate to the 3307 instances using the socket parameter. Using the port parameter (--port=3307) didn't work. I am now trying to set up master-to-master replication on that machine, where the 2 masters are the 2 instances running on that machine (sounds a little flaky, but it's for a dev box and it ought to work). It's not working and I'm wondering if it's because I can't specify the socket the 3306 master needs to connect to on the 3307 master. In the change master to command I can only specify the port. I did specify it as 3307 but the slave still can't connect. Has anyone done this? -- Jim Lyons Web developer / Database administrator http://www.weblyons.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Log
Sorry, not specified what I wanted to get inside the trigger. I would pick who is running the operation. Pedro Belmino escreveu: I do a system log of their log everything that is done(INSERTS, UPDADES and DELETES). Okay, can be done with trigger. But I need to know who performed the operation. How can I get get it inside the trigger? Thank you, Att, -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Log
I need to pass the user of my application pro bank. I want to log the user's application and value of new fields or fields updated. To then have audit of who did what. It is really necessary to create a trigger and a table of log for each table that want to monitor? What do you suggest me? Dan Nelson escreveu: In the last episode (Jul 23), Pedro Belmino said: I do a system log of their log everything that is done(INSERTS, UPDADES and DELETES). Okay, can be done with trigger. But I need to know who performed the operation. How can I get get it inside the trigger? Try the USER() or CURRENT_USER() functions: http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_user http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_current-user -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
nested function does not work
Is there are a reason why this wouldn't work? select upper( monarch.group_decode(lower(hg.alias)) ) from nagios.nagios_hostgroups hg; ++ | upper( monarch.group_decode(lower(hg.alias)) ) | ++ | database servers | mysql select lower( monarch.group_decode(hg.alias) ) from mysql nagios.nagios_hostgroups hg; +-+ | lower( monarch.group_decode(hg.alias) ) | +-+ | Database servers | -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: WHERE .... IN
How about: WHERE ( field1 LIKE '123,%' OR field1 LIKE '*,123,%' OR field1 LIKE '%,123' OR field1 = '123' ) Note that this could that a long time on large tables. You'd be better off to normalize your tables ;) How can we normalize the tables? could you explain bit more? Thanks, Siva -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Log
In the last episode (Jul 23), Pedro said: I need to pass the user of my application pro bank. I want to log the user's application and value of new fields or fields updated. To then have audit of who did what. It is really necessary to create a trigger and a table of log for each table that want to monitor? If you can trust the software connecting to mysql, then you can do your logging in the application as a separate INSERT statement just before (or after) each query. If you can not trust it (perhaps it is running on a server you do not control) then you can't trust it to send the logging queries. Logging within a trigger is the safest way to ensure that every query is logged when it is made. Another alternative is to enable query logging and post-process that log to determine what queries were run, and by whom. -- Dan Nelson [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]