X9183 has asked for the wisdom of the Perl Monks concerning the following question:

My PERL, PHP, MySQL and test environment are all set-up under Windows XP. While Link-Testing I ran into trouble trying to access a MySQL database table. I managed to force the error message "Access denied for user 'ODBC'@'localhost' ('using password: NO')". Researching further I discovered that ANONYMOUS (for Linux) is changed to ODBC (for windows). I found an old thread on the MySQL site which was supposed to overcome this problem, it didn't work I then changed the mysql commands to reflect ODBC (mysql_query to odbc_query etc.) and the system got annoyed because it was expecting MSSQL. Are there any of the same restrictions (Linux/windows) using PERL and MySQL? How do I pass the PHP variables to PERL and then get PERL to pass them back? Many Thanks in advance

Replies are listed 'Best First'.
Re: using PERL, PHP and MYSQL together
by erroneousBollock (Curate) on Sep 30, 2007 at 16:59 UTC
    My PERL, PHP, MySQL and test environment are all set-up under Windows XP. While Link-Testing I ran into trouble trying to access a MySQL database table. I managed to force the error message "Access denied for user 'ODBC'@'localhost' ('using password: NO')". Researching further I discovered that ANONYMOUS (for Linux) is changed to ODBC (for windows). I found an old thread on the MySQL site which was supposed to overcome this problem, it didn't work I then changed the mysql commands to reflect ODBC (mysql_query to odbc_query etc.) and the system got annoyed because it was expecting MSSQL.
    That error message seems to be saying that you're trying to connect as the user called ODBC rather than by some ODBC driver. I doubt that is what you intended.

    I can only gather through inference that you're talking about PHP there... moving on...

    Are there any of the same restrictions (Linux/windows) using PERL and MySQL?
    Please refine your question to be much more clear about these "restrictions".

    perl can connect to MySQL databases with the DBI and DBD::mysql modules, which have nothing at all to do with ODBC.

    How do I pass the PHP variables to PERL and then get PERL to pass them back?
    From where? To where? Do you wish to embed one language in another? Or have two different processes communicate somehow?

    -David

      Hi David, Thanks for the prompt reply. Sorry if I didn't make it clear but up to the "expecting MSSQL" was for background information only, leading up to my two questions and you are correct I was speaking about PHP, by "restrictions" the question was is there one rule for Linux users and another for Windows users in PERL, as there appears to be with PHP. My second question relates to the fact that PHP has the ability to pass information and receive information through PHP SESSIONS variables.I want to pass this info into a PERL script do my database query and return the result back to a variable that I could pickup using my PHP calling Script.

        There is PHP::Session module on CPAN. So you can read PHP session in Perl without problems.

Re: using PERL, PHP and MYSQL together
by CountZero (Bishop) on Oct 01, 2007 at 06:31 UTC
    What username and password (if any) do you specify in the "connect"-statement to the database? MySQL is very "touchy" about using the right username or otherwise it will not let you in and play!

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James