Hi there,

I'm having quite a bit of trouble with an application I'm writing on Linux,
using MySQL.

The database connectivity stuff works fine, all my queries return sane
results, etc, but I can't run the application under gdb.

When I try to connect to the database when under gdb, I get:
Access denied for user: 'dparrish@localhost' (Using password: YES)

Without the debugger it runs fine.

I've printed out the host, username, password, database and port beforehand,
so I know they are correct.

I'm now using MySQL-Max 4.0.1, but I had the same problem with 3.23.28. I am
linking with libmysqlclient_r, and I'm calling my_init() at the start of the
program, mysql_thread_init() at the start of the thread and
mysql_thread_end() at the end of the thread.

Any thoughts or solutions?


--------- THREAD CODE SNIPPET --------
        mysql_thread_init();

        if (!(dbhandle = mysql_init(NULL)))
        {
                log(LOG_CRITICAL, "mysql_init returned an error: %s",
mysql_error(dbhandle));
                goto connection_end;
        }

        log(LOG_NOTICE, "Connecting to mysql host %s, %s/%s, database %s,
port %d",
                        mysql_host, mysql_username, mysql_password,
mysql_db, mysql_port);

        if (!(mysql_real_connect(dbhandle, mysql_host, mysql_username,
mysql_password, mysql_db, mysql_port, NULL, 0)))
        {
                log(LOG_CRITICAL, "Can't connect to MYSQL database: %s",
mysql_error(dbhandle));
                goto connection_end;
        }
[...]
connection_end:
        mysql_thread_end();
        return false;

-----------------------------------

Regards,
David Parrish
IT Director, Excido Pty Ltd
http://www.excido.com/
Mobile: 0410 586 121


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 8/02/2002



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to