Re: Access Rights ?
Hi Sachin, MySQL is capable of logging all queries to a log file, see http://dev.mysql.com/doc/refman/5.0/en/query-log.html. This includes connections, disconnections and executed SQL statements - no coding needed! If you want this information imported into a database table, a couple of hours and a few cups of coffee will allow you to write a simple PHP script (or C program for the hard-core developers) to read this file and write the details of each record to a database table. Regards, Andy Sachin Gaikwad wrote: Hi all, I am newbie using MySQL. I want to log each client request to database server. I thought when server checks access rights of user(client) will be good place to log all access/read/update requests. If somebody knows where exactly this is done in source code, I will get a real kick start. Right now I am browsing through the source code through cscope to find out this. Any help in this regard is appreciated. Thanks, Sachin -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Access Rights ?
This problem is Chapter 16.6 of The MYSQL Cookbook, (second edition) that has made my(sql) life much easier. You might want to look around at http://artfulsoftware.com/ which has lots of examples and a great e-book resource. Both of these are fantastic resources for me, and they are probably my most used books in my mysql library. Good luck, Craig This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. -Original Message- From: Sachin Gaikwad [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 2:07 PM To: mysql@lists.mysql.com Subject: Access Rights ? Hi all, I am newbie using MySQL. I want to log each client request to database server. I thought when server checks access rights of user(client) will be good place to log all access/read/update requests. If somebody knows where exactly this is done in source code, I will get a real kick start. Right now I am browsing through the source code through cscope to find out this. Any help in this regard is appreciated. Thanks, Sachin -- 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: Access Rights ?
Thanks a bunch for the quick reply. I will surely write a C program to read this logfile of general queries. But before that I am not able to find this logfile for general queries. I started my server like this: $/etc/init.d/mysqld start --log=logfile --log-output=/tmp Meaning log file will be in = /tmp/logfile $mysql mysql select * from whowhatwhen; xx xxx x mysql So this query should exist in logfile. But I am not able to see this logfile in /tmp itself. What am I missing ? Thanks, Sachin On Mon, Oct 6, 2008 at 2:29 PM, Weston, Craig (OFT) [EMAIL PROTECTED] wrote: This problem is Chapter 16.6 of The MYSQL Cookbook, (second edition) that has made my(sql) life much easier. You might want to look around at http://artfulsoftware.com/ which has lots of examples and a great e-book resource. Both of these are fantastic resources for me, and they are probably my most used books in my mysql library. Good luck, Craig This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. -Original Message- From: Sachin Gaikwad [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 2:07 PM To: mysql@lists.mysql.com Subject: Access Rights ? Hi all, I am newbie using MySQL. I want to log each client request to database server. I thought when server checks access rights of user(client) will be good place to log all access/read/update requests. If somebody knows where exactly this is done in source code, I will get a real kick start. Right now I am browsing through the source code through cscope to find out this. Any help in this regard is appreciated. Thanks, Sachin -- 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: Access Rights ?
More on this: I set following in /etc/my.cnf: log = FILE, TABLE after this I am not able to start my mysqld, it fails with timeout error message Timeout error occurred trying to start MySQL Daemon. Thanks, Sachin On Mon, Oct 6, 2008 at 3:01 PM, Sachin Gaikwad [EMAIL PROTECTED] wrote: Thanks a bunch for the quick reply. I will surely write a C program to read this logfile of general queries. But before that I am not able to find this logfile for general queries. I started my server like this: $/etc/init.d/mysqld start --log=logfile --log-output=/tmp Meaning log file will be in = /tmp/logfile $mysql mysql select * from whowhatwhen; xx xxx x mysql So this query should exist in logfile. But I am not able to see this logfile in /tmp itself. What am I missing ? Thanks, Sachin On Mon, Oct 6, 2008 at 2:29 PM, Weston, Craig (OFT) [EMAIL PROTECTED] wrote: This problem is Chapter 16.6 of The MYSQL Cookbook, (second edition) that has made my(sql) life much easier. You might want to look around at http://artfulsoftware.com/ which has lots of examples and a great e-book resource. Both of these are fantastic resources for me, and they are probably my most used books in my mysql library. Good luck, Craig This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. -Original Message- From: Sachin Gaikwad [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 2:07 PM To: mysql@lists.mysql.com Subject: Access Rights ? Hi all, I am newbie using MySQL. I want to log each client request to database server. I thought when server checks access rights of user(client) will be good place to log all access/read/update requests. If somebody knows where exactly this is done in source code, I will get a real kick start. Right now I am browsing through the source code through cscope to find out this. Any help in this regard is appreciated. Thanks, Sachin -- 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: Access Rights ?
Alrite guys. I added log=/tmp/logfile in /etc/my.cnf and removed log = FILE, TABLE. Now it is logging each query. Thanks for the support. Sachin On Mon, Oct 6, 2008 at 3:13 PM, Sachin Gaikwad [EMAIL PROTECTED] wrote: More on this: I set following in /etc/my.cnf: log = FILE, TABLE after this I am not able to start my mysqld, it fails with timeout error message Timeout error occurred trying to start MySQL Daemon. Thanks, Sachin On Mon, Oct 6, 2008 at 3:01 PM, Sachin Gaikwad [EMAIL PROTECTED] wrote: Thanks a bunch for the quick reply. I will surely write a C program to read this logfile of general queries. But before that I am not able to find this logfile for general queries. I started my server like this: $/etc/init.d/mysqld start --log=logfile --log-output=/tmp Meaning log file will be in = /tmp/logfile $mysql mysql select * from whowhatwhen; xx xxx x mysql So this query should exist in logfile. But I am not able to see this logfile in /tmp itself. What am I missing ? Thanks, Sachin On Mon, Oct 6, 2008 at 2:29 PM, Weston, Craig (OFT) [EMAIL PROTECTED] wrote: This problem is Chapter 16.6 of The MYSQL Cookbook, (second edition) that has made my(sql) life much easier. You might want to look around at http://artfulsoftware.com/ which has lots of examples and a great e-book resource. Both of these are fantastic resources for me, and they are probably my most used books in my mysql library. Good luck, Craig This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. -Original Message- From: Sachin Gaikwad [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 2:07 PM To: mysql@lists.mysql.com Subject: Access Rights ? Hi all, I am newbie using MySQL. I want to log each client request to database server. I thought when server checks access rights of user(client) will be good place to log all access/read/update requests. If somebody knows where exactly this is done in source code, I will get a real kick start. Right now I am browsing through the source code through cscope to find out this. Any help in this regard is appreciated. Thanks, Sachin -- 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: Access Rights ?
Hi Sachin, What version of MySQL are you running? I believe --log-output was only added in 5.1 which is why a 5.0 server would fail to start with this option set. I think the relevant option should also be log-output in my.cnf / my.ini (e.g. log-output = FILE, TABLE.) It looks like 5.1 greatly improves on the functionality you're looking for, including the native ability to write the logs to a database table, however it's currently more efficient to write to a file than it is to a table. See http://dev.mysql.com/doc/refman/5.1/en/log-tables.html for more information. Andy Sachin Gaikwad wrote: Alrite guys. I added log=/tmp/logfile in /etc/my.cnf and removed log = FILE, TABLE. Now it is logging each query. Thanks for the support. Sachin On Mon, Oct 6, 2008 at 3:13 PM, Sachin Gaikwad [EMAIL PROTECTED] wrote: More on this: I set following in /etc/my.cnf: log = FILE, TABLE after this I am not able to start my mysqld, it fails with timeout error message Timeout error occurred trying to start MySQL Daemon. Thanks, Sachin On Mon, Oct 6, 2008 at 3:01 PM, Sachin Gaikwad [EMAIL PROTECTED] wrote: Thanks a bunch for the quick reply. I will surely write a C program to read this logfile of general queries. But before that I am not able to find this logfile for general queries. I started my server like this: $/etc/init.d/mysqld start --log=logfile --log-output=/tmp Meaning log file will be in = /tmp/logfile $mysql mysql select * from whowhatwhen; xx xxx x mysql So this query should exist in logfile. But I am not able to see this logfile in /tmp itself. What am I missing ? Thanks, Sachin On Mon, Oct 6, 2008 at 2:29 PM, Weston, Craig (OFT) [EMAIL PROTECTED] wrote: This problem is Chapter 16.6 of The MYSQL Cookbook, (second edition) that has made my(sql) life much easier. You might want to look around at http://artfulsoftware.com/ which has lots of examples and a great e-book resource. Both of these are fantastic resources for me, and they are probably my most used books in my mysql library. Good luck, Craig This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. -Original Message- From: Sachin Gaikwad [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 2:07 PM To: mysql@lists.mysql.com Subject: Access Rights ? Hi all, I am newbie using MySQL. I want to log each client request to database server. I thought when server checks access rights of user(client) will be good place to log all access/read/update requests. If somebody knows where exactly this is done in source code, I will get a real kick start. Right now I am browsing through the source code through cscope to find out this. Any help in this regard is appreciated. Thanks, Sachin -- 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: Access rights
Check the manual for the GRANT command. It holds the secret that you are searching for. :) You can use it to grant specific rights to databases or tables within databases. Once you have granted rights for a user, then use mysql -u username -p the -p is only necessary if the user you are trying to login in as needs a password. HTH, Cal http://www.calevans.com -Original Message- From: Jerry Davis [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 17, 2001 9:15 AM To: MYSQL Subject: Access rights 1) How do I give access to other users in MySQL? 2) How do I give access to tables to other users? 3) How do I create another database and then give access to that database to other users? I can get into the test database as user x but I can't get even get an access error when trying mysql with user root. ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO) Jerry -- Boycott the outlaw Microsoft - and use Linux - the Software that gives you Freedom to choose! - 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