MySQL problem

MySQL problem

Post by ujay » Fri, 28 Jun 2002 12:49:14



I'm setting up a web site that requires dynamic services.  Step one is
to enable a toggle of the FTP service.  The php scripts are in place and
functioning, but I'm having a little difficulty with the automated MySQL
commands.

The intention is to run the following script from a cron job:
#! /bin/sh

   case $1 in
     up)
       service proftpd start
       mysql -u ftpToggle -ptoggle HostServices -e "update Services set
Status='up' where Service='FTP'"
     ;;
     down)
       mysql -u ftpToggle -ptoggle HostServices -e "update Services set
       Status='down' where Service='FTP'"
       service proftpd stop
     ;;
   esac

( the host only wants ftp access at specified times )

As mysql root I entered:

identified by "toggle";
# this creates a user with access only to the specific table
# to toggle the Status field;

flush privileges;

When I run the script, I get:
$ ./setFTP down
ERROR 1143 at line 1: select command denied to user:

 From command line I entered:

$ mysql -u ftpToggle -p HostServices
Enter password:

mysql> select * from Services;

table 'Services'
mysql>

I see that the daemon is accepting the logon, and giving access to the
right tablespace, but cannot determine why it is not granting select
privilege on the specified table.

I have deleted and re-entered the user privileges several times, as well
as restarted the mysql daemon

Any tips would be appreciated.

BTW: if the topic police are listening, I searched for s MySQL specific
newsgroup, but only saw one German location.

 
 
 

MySQL problem

Post by ujay » Fri, 28 Jun 2002 12:59:47



> I'm setting up a web site that requires dynamic services.  Step one is
> to enable a toggle of the FTP service.  The php scripts are in place and
> functioning, but I'm having a little difficulty with the automated MySQL
> commands.

> The intention is to run the following script from a cron job:
> #! /bin/sh

>   case $1 in
>     up)
>       service proftpd start
>       mysql -u ftpToggle -ptoggle HostServices -e "update Services set
> Status='up' where Service='FTP'"
>     ;;
>     down)
>       mysql -u ftpToggle -ptoggle HostServices -e "update Services set
>       Status='down' where Service='FTP'"
>       service proftpd stop
>     ;;
>   esac

> ( the host only wants ftp access at specified times )

> As mysql root I entered:

> identified by "toggle";
> # this creates a user with access only to the specific table
> # to toggle the Status field;

> flush privileges;

> When I run the script, I get:
> $ ./setFTP down
> ERROR 1143 at line 1: select command denied to user:

>  From command line I entered:

> $ mysql -u ftpToggle -p HostServices
> Enter password:

> mysql> select * from Services;

> table 'Services'
> mysql>

> I see that the daemon is accepting the logon, and giving access to the
> right tablespace, but cannot determine why it is not granting select
> privilege on the specified table.

> I have deleted and re-entered the user privileges several times, as well
> as restarted the mysql daemon

> Any tips would be appreciated.

> BTW: if the topic police are listening, I searched for s MySQL specific
> newsgroup, but only saw one German location.

it seems that MySQL does not allow setting privileges on unique tables
within a tablespace.  resetting the definition to


by "toggle";

  allowed the permnissions from the scripts.

Guess I'll have to wait for an updated MySQL to get specific table
permissions.

 
 
 

1. PHP + MySQL problem

I just installed MySQL 3.22 and PHP 3.05 on a Redhat 5.2 system running
Apache 1.3. Both PHP and MySQL are working (I can create and update
databases from the mysql prompt, and web pages with simple PHP scripts
such as echo etc. are served correctly). Problem is, PHP does not seem
to be able to access MySQL - any mysql-related PHP function gets in
result an error message ("function unsupported or undefined"). I read
the FAQs, but was not able to solve the problem.

Do I need to compile PHP in order to enable its MySQL support? Does it
mean that I also have to compile Apache? I haven't done that, I just
installed the binaries from the rpm packages. Or could the problem be
due to errors in the configuration scripts? When installing PHP, rpm
didn't find the correct location of Apache so I had to tweak some
parameters by hand. Any help or info about similar experience will be
greatly appreciated.

Andrian

2. IP-Forwarding

3. mysql problem

4. no numeric keypad in scoterm under Xvision

5. MySQL problems

6. modem lights redhat 8.0

7. MySQL Problem

8. (none)

9. Apache/PHP/MySQL Problem

10. mySQL problems

11. apache+php3+mysql-problem

12. mysql problem

13. MySql problem