If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > C API Logon problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-02-04, 02:43
kabir kabir is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
C API Logon problem

hi,

Problem is when i try to connect to the data base using the CAPI functions it always get connected even if password and user name are incorrect.

I have restricted the access by deleting the NULL user (delete from user where host ='localhost' and user ='') and added the password to the root. it works fine on the command line under windows XP and access is denied to null user and to the root user if password is incorrect.

but it always connected with database if i try to connect it from my code

The code is as follows

mysql_server_init(0,NULL, (char **)server_groups);
MYSQL *mysql=NULL;
mysql =mysql_init(NULL);
if(mysql == NULL)
return false;
mysql_options(mysql, MYSQL_READ_DEFAULT_GROUP, "mydb_libmysqld_CLIENT");
if (!mysql_real_connect(mysql,"localhost","anyuser"," wrongpass","mydb",0,NULL,0))
return false;
return true;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On