Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 121164 - MySQL 5.0.18-r30 and PHP 5.1.1 issues
Summary: MySQL 5.0.18-r30 and PHP 5.1.1 issues
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Highest major
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-01 05:06 UTC by Narada Sage
Modified: 2006-02-09 05:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
equery -C f mysql (mysql.files,72.35 KB, text/plain)
2006-02-01 06:42 UTC, Narada Sage
Details
Files deleted by provided snippet of bash (deleted_files.txt,5.35 KB, text/plain)
2006-02-01 09:36 UTC, Narada Sage
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Narada Sage 2006-02-01 05:06:52 UTC
Hi,

I'd just like to point out a few issues that I've had with the stated packages after upgrading mysql.  Kindly address or reject as you feel appropriate with explanation so I can understand.

(1)

mysql init script restart does not work.

sepoy ~ # /etc/init.d/mysql restart
 * Stopping mysql (pid=) ...
 * Stopping mysqld (500)                                                            [ ok ]
 *  ...
"/var/run/mysqld/mysqld-500.pid" and/or "/var/run/mysqld/mysqld-500.sock" are still present.
Please check that no server is running and remove them.                             [ !! ]

However, start and stop with a longer gap works:

sepoy ~ # /etc/init.d/mysql stop
 * Stopping mysql (pid=) ...
 * Stopping mysqld (500)                                                            [ ok ]
sepoy ~ # /etc/init.d/mysql start
 *  ...
 * Starting mysql (/etc/mysql-500/my.cnf)                                           [ ok ]

Doing manual stop and start very quickly however doesn't work so there might be a greater time interval necessary between them in the init script.

(2)  Although I got mysqld running with command line connectivity through client  my dev-lang/php 5.1.1 was still looking for mysqld.sock in the old location of:

/var/run/mysqld/mysqld.sock

instead of the new location of:

/var/run/mysqld/mysqld-500.sock

and was therefore failing to connect.  So I had to do:

ln -s /var/run/mysqld/mysqld-500.sock /var/run/mysqld/mysqld.sock

which finally allowed the php apps to connect to mysql.

In the php.ini however it says:

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

So my question is how should PHP be made to be realise the new location of the sock file without hardcoding it in php.ini?  Restarting apache2 and mysql didn't refresh php's knowledge of the sock location.  And I didn't want to hardcode it in there because it wasn't there to begin with.  I tried recompiling but that failed too because of this:

configure: error: Cannot find MySQL header files under /usr/lib/mysql.
Note that the MySQL client library is not bundled anymore!

So eventually I had to symlink the two sock files but I still have the problem of php failing to compile although my currently installed version works for now.

Here is a listing of what's in /usr/lib/mysql*.

sepoy ~ # ls -l /usr/lib/mysql*
lrwxrwxrwx  1 root root   9 Feb  1 11:57 /usr/lib/mysql -> mysql-500

/usr/lib/mysql-500:
total 16446
-rw-r--r--  1 root root   10662 Feb  1 11:56 libdbug.a
-rw-r--r--  1 root root   45384 Feb  1 11:56 libheap.a
-rw-r--r--  1 root root  341924 Feb  1 11:56 libmyisam.a
-rw-r--r--  1 root root   27298 Feb  1 11:56 libmyisammrg.a
-rw-r--r--  1 root root 1514968 Feb  1 11:56 libmysqlclient.a
-rwxr-xr-x  1 root root     897 Feb  1 11:56 libmysqlclient.la
lrwxrwxrwx  1 root root      24 Feb  1 11:56 libmysqlclient.so -> libmysqlclient.so.15.0.0
lrwxrwxrwx  1 root root      24 Feb  1 11:56 libmysqlclient.so.15 -> libmysqlclient.so.15.0.0
-rwxr-xr-x  1 root root 1291144 Feb  1 11:56 libmysqlclient.so.15.0.0
-rw-r--r--  1 root root 1523222 Feb  1 11:56 libmysqlclient_r.a
-rwxr-xr-x  1 root root     921 Feb  1 11:56 libmysqlclient_r.la
lrwxrwxrwx  1 root root      26 Feb  1 11:56 libmysqlclient_r.so -> libmysqlclient_r.so.15.0.0
lrwxrwxrwx  1 root root      26 Feb  1 11:56 libmysqlclient_r.so.15 -> libmysqlclient_r.so.15.0.0
-rwxr-xr-x  1 root root 1297032 Feb  1 11:56 libmysqlclient_r.so.15.0.0
-rw-r--r--  1 root root 9226938 Feb  1 11:56 libmysqld.a
-rw-r--r--  1 root root 1213448 Feb  1 11:56 libmystrings.a
-rw-r--r--  1 root root  288250 Feb  1 11:56 libmysys.a
-rw-r--r--  1 root root   15342 Feb  1 11:56 libvio.a


I would be most grateful if you could throw some light on these issues.  Thanks.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-02-01 05:24:34 UTC
Ad 2/ Default php location is /var/run/mysqld/mysqld.sock, which is hardcoded in php when compiling; creating symlinks is eselect-mysql job - and if you are running multiple mysql versions, then it's users' tasks to configure the socket location in php.ini as needed.

Ad 3/ Uhm, we really need to know mysql location when compiling php (set to /usr/lib/mysql currently), and for mysqli extensions we also need to know mysql_config location (currently /usr/bin/mysql_config). 

So - attaching (don't post inline!) the output of 'equery f mysql' for mysql-4.1 and mysql-5.0 slotted versions would be really helpful.
Comment 2 Narada Sage 2006-02-01 06:42:31 UTC
Created attachment 78651 [details]
equery -C f mysql
Comment 3 Narada Sage 2006-02-01 06:50:45 UTC
Jakub: Thanks for your help.  I've supplied the data you requested.

`which mysql_config` gives /usr/bin/mysql_config

I only have mysql-5.0.18-r30 installed.  That's it.  There are no other versions on my system.  I used to have 5.0.18 but I unmerged it which is perhaps where some of these problems stem from.  I'll add some further observations later on.
Comment 4 Narada Sage 2006-02-01 06:55:41 UTC
sepoy ~ # eselect mysql show
Current default MySQL version:
  (unset)                   
sepoy ~ # eselect mysql list
Available MySQL versions:
  [1]   5.0.x
sepoy ~ # eselect mysql set 1
!!! Error: File "/usr/bin/mysql_explain_log-500" is not suitable for symlink (2)
exiting.
Comment 5 Narada Sage 2006-02-01 07:02:03 UTC
To reply to Ad 2/ I am not running multiple mysql versions so eselect should work for me right?  However, I don't think it is even working for me.
Comment 6 Francesco R. (RETIRED) gentoo-dev 2006-02-01 08:27:43 UTC
(In reply to comment #4)
> sepoy ~ # eselect mysql show
> Current default MySQL version:
>   (unset)                   
> sepoy ~ # eselect mysql list
> Available MySQL versions:
>   [1]   5.0.x
> sepoy ~ # eselect mysql set 1
> !!! Error: File "/usr/bin/mysql_explain_log-500" is not suitable for symlink
> (2)
> exiting.
> 

You need the new app-admin/eselect-mysql-r1 , the previous one is broken .

Have you unmerged the previous version of mysql ?
emerge -Cp mysql
emerge -C dev-db/mysql-[old version]

Now it's safe tu run again "eselect mysql set 1"

if it fails, please report "ls -l /var/lib/eselect/mysql/"
and "ls -ld /usr/lib/*my*"

thanks
Comment 7 Narada Sage 2006-02-01 08:47:11 UTC
Hi.  I only have one mysql on my system as shown below.  My previous version was 5.0.18 which I removed after installing 5.0.18-r30.

sepoy ~ # emerge mysql -Cvp

>>> These are the packages that I would unmerge:

 dev-db/mysql
    selected: 5.0.18-r30
   protected: none
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

I resynced and upgraded eselect-mysql to r1.  Here are the results.

sepoy ~ # eselect mysql list 
Available MySQL versions:
  [1]   5.0.x
sepoy ~ # eselect mysql set 1
!!! Error: File "/usr/bin/mysql_explain_log-500" is not suitable for symlink (2)
exiting.
sepoy ~ # eselect mysql show 
Current default MySQL version:
  (unset)                   

And here is the debug output you asked for.

sepoy ~ # ls -l /var/lib/eselect/mysql/
total 4
-rw-r--r--  1 root root 2297 Feb  1 11:56 mysql-500.filelist
sepoy ~ # ls -ld /usr/lib/*my*
lrwxrwxrwx  1 root root     39 Feb  1 14:59 /usr/lib/libmysqlclient.so -> /usr/lib/mysql/libmysqlclient.so.15.0.0
lrwxrwxrwx  1 root root     39 Feb  1 14:59 /usr/lib/libmysqlclient.so.15 -> /usr/lib/mysql/libmysqlclient.so.15.0.0
lrwxrwxrwx  1 root root     39 Feb  1 14:59 /usr/lib/libmysqlclient.so.15.0 -> /usr/lib/mysql/libmysqlclient.so.15.0.0
lrwxrwxrwx  1 root root     39 Feb  1 14:59 /usr/lib/libmysqlclient.so.15.0.0 -> /usr/lib/mysql/libmysqlclient.so.15.0.0
lrwxrwxrwx  1 root root     41 Feb  1 14:59 /usr/lib/libmysqlclient_r.so -> /usr/lib/mysql/libmysqlclient_r.so.15.0.0
lrwxrwxrwx  1 root root     41 Feb  1 14:59 /usr/lib/libmysqlclient_r.so.15 -> /usr/lib/mysql/libmysqlclient_r.so.15.0.0
lrwxrwxrwx  1 root root     41 Feb  1 14:59 /usr/lib/libmysqlclient_r.so.15.0 -> /usr/lib/mysql/libmysqlclient_r.so.15.0.0
lrwxrwxrwx  1 root root     41 Feb  1 14:59 /usr/lib/libmysqlclient_r.so.15.0.0 -> /usr/lib/mysql/libmysqlclient_r.so.15.0.0
-rwxr-xr-x  1 root root 240216 Dec 21 14:20 /usr/lib/libsmpeg-0.4.so.0.dummy
lrwxrwxrwx  1 root root      9 Feb  1 11:57 /usr/lib/mysql -> mysql-500
drwxr-xr-x  2 root root    696 Feb  1 14:59 /usr/lib/mysql-500

Thanks.
Comment 8 Francesco R. (RETIRED) gentoo-dev 2006-02-01 09:22:18 UTC
For somewhat reason there are still old files in the tree, files that emerge should have removed.
Or still worst the file that we need to symlink is not there.

to achieve a list of files that you need to remove do the following:

cd /
TMPLIST=$( cat /var/lib/eselect/mysql/mysql-500.filelist | sed -e 's!-500!!' )
ls -l $TMPLIST
[the list should be only symlinks]
tar -jcpvf ~/my-backup.tar.bz2 $TMPLIST
rm -rf $TMPLIST

The followin is the code that check for the possibility to create the symlink

<Code>
check_symlink() {
  local filename=${1}
  local version=${2}
  local linkname=${filename/"-${version}"/}
  local ret=0

  [[ -z ${filename} ]] || [[ -z ${version} ]] && return 1

  # check link source
  [[ -f ${filename} ]] || [[ -d ${filename} ]] || ret=$(( ${ret} + 1 ))

  # check link targe
  # not checking for directory (want to keep "/etc/mysql")
  [[ -a ${linkname} ]] && [[ ! -L ${linkname} ]] && [[ ! -d ${linkname} ]] \
    && ret=$(( ${ret} +2 ))

  return ${ret}
}
</Code>
Comment 9 Francesco R. (RETIRED) gentoo-dev 2006-02-01 09:23:51 UTC
read this "to achieve a list of files that you need to remove do the following:" as:
"to manually fixing the situation:" .... then run eselect again
Comment 10 Narada Sage 2006-02-01 09:34:13 UTC
Okay I ran the first bit of bash which deleted a huge list of files which I will attach in a little while.  Now eselect works as shown below so thanks.

sepoy ~ # eselect mysql list
Available MySQL versions:
  [1]   5.0.x *
sepoy ~ # eselect mysql set 1
sepoy ~ # eselect mysql show
Current default MySQL version:
  5.0.x
Comment 11 Narada Sage 2006-02-01 09:36:59 UTC
Created attachment 78662 [details]
Files deleted by provided snippet of bash
Comment 12 Michael Hampicke 2006-02-06 08:10:07 UTC
I deleted the symlinks as discribed and re-run eselct mysql, but emerge dev-lang/php still fails

checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... /var/run/mysqld/mysqld.sock
checking for MySQL UNIX socket location... /var/run/mysqld/mysqld.sock
configure: error: Cannot find MySQL header files under /usr/lib/mysql.
Note that the MySQL client library is not bundled anymore!

!!! ERROR: dev-lang/php-5.1.1 failed.
Call stack:
  ebuild.sh, line 1894:   Called dyn_compile
  ebuild.sh, line 941:   Called src_compile
  php-5.1.1.ebuild, line 128:   Called src_compile_normal
  php-5.1.1.ebuild, line 232:   Called php5_1-sapi_src_compile

!!! configure failed
!!! If you need support, post the topmost build error, and the call stack if relevant.

are there any other solutions?
Comment 13 Francesco R. (RETIRED) gentoo-dev 2006-02-06 09:08:00 UTC
(In reply to comment #12)
> I deleted the symlinks as discribed and re-run eselct mysql, but emerge
> dev-lang/php still fails

hem no, the problem described there was that the symlink where _not_ created because the old installation of mysql left his files there.

So you need the symlinks created by "eselect mysql set 1" .

There are three location that are worked differently, /usr/lib/mysql, /usr/include/mysql and /usr/bin/mysql_config (the first two are directory the last an executable) . these three are always linked to the latest mysql version avaiable and are all that it needed to build almost all the packages in the portage tree that link against mysql.

in the case you installed mysql 5.0.18-r30 and run eselect you should see:

# ls -ld /usr/bin/mysql_config /usr/lib/mysql /usr/include/mysql
lrwxrwxrwx  1 root root 16 Feb  3 10:46 /usr/bin/mysql_config -> mysql_config-500
lrwxrwxrwx  1 root root  9 Feb  1 00:10 /usr/include/mysql -> mysql-500
lrwxrwxrwx  1 root root  9 Feb  1 00:12 /usr/lib/mysql -> mysql-500

check these ones and then try again to compile php.

Comment 14 Michael Hampicke 2006-02-06 09:15:22 UTC
now i have re-emerged mysql and did the "eselect mysql set 1"
php is compiling at the moment.
Comment 15 Peter Ansell 2006-02-08 23:33:13 UTC
(In reply to comment #8)
> <Code>
> check_symlink() {
>   local filename=${1}
>   local version=${2}
>   local linkname=${filename/"-${version}"/}
>   local ret=0
> 
>   [[ -z ${filename} ]] || [[ -z ${version} ]] && return 1
> 
>   # check link source
>   [[ -f ${filename} ]] || [[ -d ${filename} ]] || ret=$(( ${ret} + 1 ))
> 
>   # check link targe
>   # not checking for directory (want to keep "/etc/mysql")
>   [[ -a ${linkname} ]] && [[ ! -L ${linkname} ]] && [[ ! -d ${linkname} ]] \
>     && ret=$(( ${ret} +2 ))
> 
>   return ${ret}
> }
> </Code>
> 


This check_symlink() method still does not provide for slotted files in the man database with the following structure /usr/share/man/man1/perror-500.1.gz to be linked to /usr/share/man/man1/perror.1.gz

This seems to be a fatal assumption on the part of the eselect script, namely that the -500 will always be on the end of files, not to mention the difficulty with the .gz part.
Comment 16 Francesco R. (RETIRED) gentoo-dev 2006-02-09 05:31:19 UTC
> 
> This check_symlink() method still does not provide for slotted files in the man
> database with the following structure /usr/share/man/man1/perror-500.1.gz to be
> linked to /usr/share/man/man1/perror.1.gz
> 
> This seems to be a fatal assumption on the part of the eselect script, namely
> that the -500 will always be on the end of files, not to mention the difficulty
> with the .gz part.
> 

Bug 122205, has been introduced at the same time 4.1.18-r30 hitted the tree.