Hi,
I'm new to the toolserver and I'm trying to install a web application[1].
I created a database on sql-s1-user to which I can connect via my PHP code. Also I have a C program that needs to connect as well. If I call the C program from the command line, it works perfectly. However, if it is called from the PHP script using shell_exec() by the web server user, I get the following error message:
Access denied for user 'ant'@'damiana-bge0.esi.toolserver.org' (using password: NO)
Here's part of the C code: ----- const char *_dbhost = "sql-s1-user";
MYSQL *connection, mysql;
mysql_init(&mysql); mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "client"); connection = mysql_real_connect(&mysql, _dbhost, NULL, NULL, NULL, 0, NULL, CLIENT_MULTI_STATEMENTS);
if (!connection) { cout << mysql_error(&mysql) << endl; return 1; } -----
Thank you very much.
ant
Hey,
this here might be the point:
Access denied for user 'ant'@'damiana-bge0.esi.toolserver.org' (using password: NO)
Try to give a password somewhere this might work.
nosy
On Mon, 22 Oct 2012, ant wrote:
Date: Mon, 22 Oct 2012 13:40:55 From: ant antofosm@gmail.com Reply-To: Wikimedia Toolserver toolserver-l@lists.wikimedia.org To: toolserver-l@lists.wikimedia.org Subject: [Toolserver-l] Database connection problem
Hi,
I'm new to the toolserver and I'm trying to install a web application[1].
I created a database on sql-s1-user to which I can connect via my PHP code. Also I have a C program that needs to connect as well. If I call the C program from the command line, it works perfectly. However, if it is called from the PHP script using shell_exec() by the web server user, I get the following error message:
Access denied for user 'ant'@'damiana-bge0.esi.toolserver.org' (using password: NO)
Here's part of the C code:
const char *_dbhost = "sql-s1-user";
MYSQL *connection, mysql;
mysql_init(&mysql); mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "client"); connection = mysql_real_connect(&mysql, _dbhost, NULL, NULL, NULL, 0, NULL, CLIENT_MULTI_STATEMENTS);
if (!connection) { cout << mysql_error(&mysql) << endl; return 1; }
Thank you very much.
ant
[1] https://github.com/antofosm/wp-revision-network
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
Hi,
Am 22.10.2012 13:43, schrieb Marlen Caemmerer:
Hey,
this here might be the point:
Access denied for user 'ant'@'damiana-bge0.esi.toolserver.org' (using password: NO)
Try to give a password somewhere this might work.
Thank you for your replies. Coding the password into the C program indeed makes it work. (I hesitated to do that because it did not seem to be the recommended way of connecting to the database server, but if no one objects....)
cheers ant
nosy
On Mon, 22 Oct 2012, ant wrote:
Date: Mon, 22 Oct 2012 13:40:55 From: ant antofosm@gmail.com Reply-To: Wikimedia Toolserver toolserver-l@lists.wikimedia.org To: toolserver-l@lists.wikimedia.org Subject: [Toolserver-l] Database connection problem
Hi,
I'm new to the toolserver and I'm trying to install a web application[1].
I created a database on sql-s1-user to which I can connect via my PHP code. Also I have a C program that needs to connect as well. If I call the C program from the command line, it works perfectly. However, if it is called from the PHP script using shell_exec() by the web server user, I get the following error message:
Access denied for user 'ant'@'damiana-bge0.esi.toolserver.org' (using password: NO)
Here's part of the C code:
const char *_dbhost = "sql-s1-user";
MYSQL *connection, mysql;
mysql_init(&mysql); mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "client"); connection = mysql_real_connect(&mysql, _dbhost, NULL, NULL, NULL, 0, NULL, CLIENT_MULTI_STATEMENTS);
if (!connection) { cout << mysql_error(&mysql) << endl; return 1; }
Thank you very much.
ant
[1] https://github.com/antofosm/wp-revision-network
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
Toolserver-l mailing list (Toolserver-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/toolserver-l Posting guidelines for this list: https://wiki.toolserver.org/view/Mailing_list_etiquette
On Mon, Oct 22, 2012 at 1:40 PM, ant antofosm@gmail.com wrote:
Hi,
I'm new to the toolserver and I'm trying to install a web application[1].
I created a database on sql-s1-user to which I can connect via my PHP code. Also I have a C program that needs to connect as well. If I call the C program from the command line, it works perfectly. However, if it is called from the PHP script using shell_exec() by the web server user, I get the following error message:
The program is compiled for solaris?
Access denied for user 'ant'@'damiana-bge0.esi.toolserver.org' (using password: NO)
This is clearly wrong, as you have to provide a password in order to connect.
Maybe your program is relying in $HOME being set? I think you need to get it from getpwuid()
toolserver-l@lists.wikimedia.org