Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL

Status
Not open for further replies.

khue

Programmer
Joined
Mar 6, 2001
Messages
112
Location
US
I am installing mod_auth_mysql which is a http-Basic Authentication Module. It allows to maintain your user comfortable in a MySQL-Database.

I've downloaded the source from ftp://ftp.kciLink.com/pub/mod_auth_mysql.c.gz

I've tried to follow the steps detailed by:


section: 3.7.3. Building and installing. These are the actual steps:

gunzip mod_auth_mysql.c.gz

/usr/local/apache/bin/apxs -c -I/usr/local/mysql/include -L/usr/local/mysql/lib/mysql -lmysqlclient -lm mod_auth_mysql.c

cp mod_auth_mysql.so /usr/local/apache/libexec

And these are the errors I got:

cannot find -lmysqlclient
ld returned 1 exit status
command faild with rc=1

when I execute this command:

/usr/local/apache/bin/apxs -c -I/usr/local/mysql/include -L/usr/local/mysql/lib/mysql -lmysqlclient -lm mod_auth_mysql.c

I'm stuck and is there a solution to this?
 
Is /usr/local/mysql/lib in /etc/ld.so.conf? If not, try putting that directory in there, and run '/sbin/ldconfig' Bruce Garlock
bruceg@tiac.net
 
where is /sbin/ldconfig located?
 
That is the full pathname to 'ldconfig' if you 'su -' to root, you don't have to specify the full path. I am in the habit of always specifying the full path to commands.

If you are logged in as root, simply type 'ldconfig'

Bruce Garlock
bruceg@tiac.net
 
Okay. I did that. It did something but what did it actually do? Now, if I re-execute those commands to build and install the mod_auth_mysql, will this solve my previous problem?
 
I still get the same error. I can't launch MySQL anymore.

the error is:

cannot find -lmysqlclient
ld returned 1 exit status
command faild with rc=1

What is: cannot find -lmysqlclient? Is it looking for the MySQL Client tool? I have the MySql Client version 3.23.49a rpm installed. What is this error really looking for?
 
It may, is there a configure script that you run? If so, you may need to supply something like: './configure --with-mysql=/usr/local'

Do a 'man ldconfig' for more information on ldconfig and /etc/ld.so.conf

Bruce Garlock
bruceg@tiac.net
 
Well, according to the step at:


section: 3.7.3. Building and installing

This is the command to execute:
/usr/local/apache/bin/apxs -c -I/usr/local/mysql/include -L/usr/local/mysql/lib/mysql -lmysqlclient -lm mod_auth_mysql.c

It doesn't have a configure script to run. The file: mod_auth_mysql.c is a C file.

This is too complicated to setup Apache with MySQL and PHP.
 
What distribution / version?
Do you have the mysqlclient package installed?

On my Redhat box:
[root@mybox /root]# rpm -qa | grep mysql
mysql-devel-3.23.36-1
mysqlclient9-3.23.22-4
mysql-3.23.36-1
mysql-server-3.23.36-1
php-mysql-4.0.4pl1-9
[root@mybox /root]#


mysqlclient provides:
[root@mybox /root]# rpm -ql mysqlclient9-3.23.22-4
/usr/lib/mysql/libmysqlclient.so.9
/usr/lib/mysql/libmysqlclient.so.9.0.0
[root@mybox /root]#


 
the mysql-client rpm package version that I installed is mysql-client-3.23.49a-1
 
Are you sure your mysql include files are under /usr/local ?

As root: locate libmysqlcient ; locate mysql.h

I'd also reconfirm the path for apxs, ( which apxs )

Verify the location of the files needed and change the install script accordingly.

Example:
<original>
/usr/local/apache/bin/apxs -c -I/usr/local/mysql/include -L/usr/local/mysql/lib/mysql -lmysqlclient -lm mod_auth_mysql.c

<changed>
/usr/sbin/apxs -c -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lm mod_auth_mysql.c
 
When I executed the following at the command prompt:

locate libmysqlcient
locate mysql.h

I got nothing returned back.

According to the changed installed script above, in my directory: /usr/sbin, there is no apxs file (or executable file).

There is a apxs executable file in the /usr/local/apache/bin directory.

The MySQL files (program) itself (the mysql that I compiled and installed) is in the directory: /usr/local/mysql. The directory for the mysql-client rpm package that I installed, I do not know where it is. Because when I executed: rpm -iv mysql-client-3.23.49a-1.i386.rpm, it did not display the directory that it was installing into. When I executed: rpm -q mysql-client-3.23.49a-1, it also did not tell me where the directory is located. Is there a mysql-client-3.23.4a-1.i386 source which is not a rpm package that I can download, configure, compile and install? Or is there a unix command that I can find the directory of the mysql-client program?
 
In the command that I executed:

/usr/local/apache/bin/apxs -c -I/usr/local/mysql/include -L/usr/local/mysql/lib/mysql -lmysqlclient -lm mod_auth_mysql.c

in the line: -L/usr/local/mysql/lib/mysql
the last word ../lib/mysql, is mysql refering to a file, executable file, or a directory?

next, according the to on-line documentation at is it assuming that the mysql-client is already installed or not?
 
/usr/local/mysql/lib/mysql is referring to a directory.

rpm -ql mysql-client-3.23.49a-1 will show you the files installed with their associated paths.
 
Okay, I've got it to work. Don't know why but all of a sudden it work!

Now, I've got an error when I try to execute ./bin/mysql which is to start up MySQL. The error is:

ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

How do I fix this to make it connect? I've created a user called: mysql and given permission to this user by issueing a chown -R command. Is there something else that I'm missing. I've tried reboot but it doesn't seem to make a difference.
 

&quot; The error (2002) Can't connect to ... normally means that there isn't a MySQL server running on the system or that you are using a wrong socket file or TCP/IP port when trying to connect to the mysqld server. &quot;

Is the file mysql.sock located in /tmp ?
locate mysql.sock

Is the mysqld server running at all?
ps | ax | grep sql
 
mysql.sock is not found in the /tmp directory and when it execut ps ax | grep sql, it displays that it is running. The question is, do I know for sure that it is mysql that is running?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top