Error Executing PHP...

General discussions related to php

Moderators: macek, egami, gesf

jgarcia
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Mar 06, 2003 4:02 pm

Error Executing PHP...

Postby jgarcia » Thu Mar 06, 2003 4:14 pm

Hi all,

I have the following situation:

I want to send data from one MySQL Server to another, the main server is here and the other is in another city, this is done via internet. This is very sensitive data.

What I did is a small PHP script that runs in the client (other city) that connects to the main server and sends all the data from his server to the main one.

The script connects to the main one using the parameter MYSQL_CLIENT_SSL, all worked fine when I ran the script from the prompt using #php (script).

Then I went on and made a cron job (as root) to automate this process (this is a daily process). Here's where the problem started. Whenever the script is run using the cron job (as whatever user even root) it gives me the following error in mysql_connect when connecting to the main server:

Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Access denied for user: 'vwpuebla@dup-200-65-52-15.prodigy.net.mx' to database '%T[' in /ServerScripts/SyncronizeDBToMTY.php4 on line 10

The name of the database changes whenever the script is executed. Seems like its getting corrupted somewhere. I tried running the script with the -n param without any luck.

Im desperate, can anyone help me.

Best Regards,

Jose.

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: Error Executing PHP...

Postby WiZARD » Fri Mar 07, 2003 1:40 am

Hi jgarcia!
Can you manage like admin youre remote MySQL database?
If may try check password....
or try connect to base from command line:

Code: Select all

mysql -h host -u user -p
Enter password: ********

If thats ok whan you have mistake in code

jgarcia
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Mar 06, 2003 4:02 pm

Postby jgarcia » Fri Mar 07, 2003 7:39 am

Hi Wizard,


Thanks for the info. I can manage as admin my remote SQL, etc. I can connect using command line mysql. I can even connect running the PHP script from command line but when I run the same script from the cron job it gives me that error.

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Fri Mar 07, 2003 8:42 am

Hi jgarcia!
I think what you have a error in script of youre cron job :^(


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 1 guest