dbTalk Databases Forums  

Re: Not able to install the rpm - not able to connect to Mysql now

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Re: Not able to install the rpm - not able to connect to Mysql now in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
chandra shekar
 
Posts: n/a

Default Re: Not able to install the rpm - not able to connect to Mysql now - 04-18-2005 , 05:07 AM






Hi thanx for the reply,
You are the best. It worked....!!!
I quit installing using rpm. I installed from
the source using ->

$ ./configure --with-mysql=/usr/local/mysql
$make
$make install

Also I successfully ran "./resetdb localhost root
<paswd>" which gave the below response: "Created
sample database succesfully". I reconfirmed it by
logining into mysql database and was able to see
"mysql_cpp_data" beeing created.

Then I ran "./simple1 localhost root <passwd> " it
succefully displayed the contents of the
"mysql_cpp_data" database from the table "stocks". )

Next I compiled a program but with errors:
" gcc -I/usr/local/mysql/include prog.c "


------------------------------------------------------
#include <time.h>
#include <stdio.h>
#include <mysql.h>

int main () {
MYSQL_RES *mTabelle;
MYSQL_ROW mRecord;
MYSQL *mConnection, mDB;
int mError;
mysql_init(&mDB);
mConnection =
mysql_real_connect(&mDB,"localhost","root","king12 3","test",0,0,0);

if (mConnection == NULL) {
printf("Error connecting to Database:
%s",mysql_error(&mDB));
return 1;
} else {
printf("Successfully connected to Database");
}
mysql_close(mConnection);
return 0;
}

----------------------------------------------------
Compilation error was as given below:
error:undefined reference to mysq_init ,
mysql_real_connect,mysql_error.

You have asked me to look in to Makefile.simple to
know how to build c++ programs.I could not understand
much from it. Sorry for my ignorance. Where can I get
sample c++ codes which uses Mysql++.

What could be the reason for the above errors..?
How can I over come it..?

Thanx a lot again
Shekar


------------------------------------------------------
Warren Young <mysqlpp (AT) etr-usa (DOT) com> wrote:
Quote:
chandra shekar wrote:

It threw the error :" Failed dependecies :
MySQL - Shared is needed by mysql++-1.7.30-1"

Yes, on purpose. A MySQL++ binary RPM is
necessarily dependent on the
MySQL version it was built against. My RPMs are
built against the
official RPMs you get from mysql.com, not against
the version of MySQL
that comes with the OS.

So, either get the official RPMs, or build the
library from source.

This is explained on the MySQL++ web page. From
whence, by the way, you
can get a much more recent version of MySQL++:

http://tangentsoft.net/mysql++/

Before running the above command I installed
mysql++-1.7.30.tar.gz as below:

Don't install both from RPM and from source. Pick
one.

./configure --includedir=/usr/local/include/mysql

That flag tells configure where you want the MySQL++
header files to go,
not where to find the MySQL headers. Try:

$ ./configure --with-mysql=/usr/local/mysql

instead. If that doesn't work, try separate
--with-mysql-lib and
--with-mysql-include flags. Notice that you don't
necessarily give the
full path: the configure script will take a base
directory name and try
to guess which subdirectories underneath contain the
files.

I also tried running a simple program that
connects
to Mysql but got the error as " mysql_init"
unidentified".

See examples/Makefile.simple for the correct way to
build a program
using MySQL++.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:

http://lists.mysql.com/plusplus?unsu...ahoo (DOT) com




__________________________________
Do you Yahoo!?
Plan great trips with Yahoo! Travel: Now over 17,000 guides!
http://travel.yahoo.com/p-travelguide

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: Not able to install the rpm - not able to connect to Mysql now - 04-18-2005 , 11:07 AM






chandra shekar wrote:

Quote:
You have asked me to look in to Makefile.simple to
know how to build c++ programs.I could not understand
much from it.
If you refuse to learn Makefile syntax, you will not go very far as a
programmer.

Quote:
Sorry for my ignorance.
Since it is your choice to hold onto that ignorance, I do not accept
your apology.

I learned the basics of using make(1) using free documentation, before
the web as we know it even existed. The resources freely available to
you today are vastly greater than what I had access to when I started.
You have no excuse. Learn make.

Quote:
Where can I get
sample c++ codes which uses Mysql++.
You mean besides the twelve example programs that came with MySQL++?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.