Re: [MDTech.us_MAN] Need help writing a script that interacts with a MySQL DB
[In reply to]

Can't Post

Did you try connecting from the command line using the same params as in the script? If that fails, then there is no reason to expect it to work in the Perl script. Once you're able to connect from the command line, then we can work on using those params in the script.

Re: [FishMonger] Need help writing a script that interacts with a MySQL DB
[In reply to]

Can't Post

In Reply To

Did you try connecting from the command line using the same params as in the script? If that fails, then there is no reason to expect it to work in the Perl script. Once you're able to connect from the command line, then we can work on using those params in the script.

I guess the connection is successful. Here is what is I get in Debian:

<!-- warning: DBI connect('bcpadb:instance28854.db.xeround.com:18847','maxwell175',...) failed: Can't connect to MySQL server on 'instance28854.db.xeround.com' (111) at /home/www/mdtech.us.ms/BCPA/BCPA_form/PROC/index.cgi line 17 --> <h1>Software error:</h1> <pre>Could not connect to the database Can't connect to MySQL server on 'instance28854.db.xeround.com' (111) at /home/www/mdtech.us.ms/BCPA/BCPA_form/PROC/index.cgi line 17.</pre> <p> For help, please send mail to the webmaster (<a href="mailto:[no address given]">[no address given]</a>), giving this error message and the time and date of the error.

The root of your problem is that you didn't properly setup the user rights in my mysql database. Your db table is empty. It should have entries in it specifying who can access the database and from where. You need to use the mysql grant function to setup those rights.

Sorry for not being specific. I meant that I get the same thing as I described in my previous post:

Quote

Ok, I got the warning:

Code

<!-- warning: DBI connect('bcpadb:instance28854.db.xeround.com:18847','maxwell175',...) failed: Can't connect to MySQL server on 'instance28854.db.xeround.com' (111) at /home/www/mdtech.us.ms/BCPA/BCPA_form/PROC/index.cgi line 17 --> <h1>Software error:</h1> <pre>Could not connect to the database Can't connect to MySQL server on 'instance28854.db.xeround.com' (111) at /home/www/mdtech.us.ms/BCPA/BCPA_form/PROC/index.cgi line 17.</pre> <p> For help, please send mail to the webmaster (<a href="mailto:[no address given]">[no address given]</a>), giving this error message and the time and date of the error.

Re: [MDTech.us_MAN] Need help writing a script that interacts with a MySQL DB
[In reply to]

Can't Post

In Reply To

Hello:

I used your code in my script and everything works fine, but, when I tried running that same script using my hosting service, it doesn't work!!!

Please clarify. Does that mean that you tested it on 2 different systems, your test system and your hosting service provider's system? Or, on the same system under 2 separate environments, command line and web page?

Re: [FishMonger] Need help writing a script that interacts with a MySQL DB
[In reply to]

Can't Post

Ok, here is the set up: My Computer: Strawberry Perl (Windows x64) Hosting service: Apache with Perl and (I think) Linux NOTE: I do not have physical or console access to the above server!

Maxwell.

In Reply To

In Reply To

Hello:

I used your code in my script and everything works fine, but, when I tried running that same script using my hosting service, it doesn't work!!!

Please clarify. Does that mean that you tested it on 2 different systems, your test system and your hosting service provider's system? Or, on the same system under 2 separate environments, command line and web page?

Re: [MDTech.us_MAN] Need help writing a script that interacts with a MySQL DB
[In reply to]

Can't Post

Quote

NOTE: I do not have physical or console access to the above server!

The problem you're experiencing is a perfect example why I always make sure I have shell (ssh) access to the server.

Since I'm able to gain direct remote access to your database on your web host but you can't access it through your web site on that server, shows that the database access rights aren't setup correctly. I don't know if that's due to a mistake on your end or your web host, but at this point you should contact your web host.

If you haven't reset the access rights, I might be able to login and fix it for you, but that would not be appropriate.

Re: [FishMonger] Need help writing a script that interacts with a MySQL DB
[In reply to]

Can't Post

In Reply To

Quote

NOTE: I do not have physical or console access to the above server!

The problem you're experiencing is a perfect example why I always make sure I have shell (ssh) access to the server.

Since I'm able to gain direct remote access to your database on your web host but you can't access it through your web site on that server, shows that the database access rights aren't setup correctly. I don't know if that's due to a mistake on your end or your web host, but at this point you should contact your web host.

If you haven't reset the access rights, I might be able to login and fix it for you, but that would not be appropriate.

Re: [FishMonger] Need help writing a script that interacts with a MySQL DB
[In reply to]

Can't Post

In Reply To

Quote

NOTE: I do not have physical or console access to the above server!

The problem you're experiencing is a perfect example why I always make sure I have shell (ssh) access to the server.

Since I'm able to gain direct remote access to your database on your web host but you can't access it through your web site on that server, shows that the database access rights aren't setup correctly. I don't know if that's due to a mistake on your end or your web host, but at this point you should contact your web host.

If you haven't reset the access rights, I might be able to login and fix it for you, but that would not be appropriate.

Also, tomorrow I will try setting up the server on my Windows server that I have at my house.