ot Peio Popov(14-02-2005)

reiting (32)   [ dobre ]  [ zle ]

Printer Friendly Variant za otpechatvane

Edno ot neshtata, koito me drazniat v podbora na paketite vklyucheni v Fedora Core 3 e starata versiia na predpochitanata ot men baza danni - MySQL. Klonut versii zapochvashti s 3.x.x otdavna e obiaven za ostarial ot ekipa na MySQL, no poradi neizvestni za men prichini razrabotchitsite na Fedora polzvat poslednata stabilna versiia ot nego.

Dosega predpochitah udobstvoto na avtomatichnite obnoviavaniia na stariia klon, no tui kato vse poveche produkti iziskvat versiia 4.x, a i predimstvata na novite versii stavat vse poveche i poveche, reshih da obnovia do poslednata stabilna versiia.

MySQL AB predostaviat i rpm distributiv, koito se polzva za osnova na vklyucheniia v development klona na Fedora Core paket na MySQL versiia 4.1.9. Tova, che e v development klona ne triabva da ni pritesniava, zashtoto MySQL sa dokazali mnogokratno, che ne puskat nestabilni versii, a v momenta 4.1 klona e vodeshtata im stabilna versiia.

Problemut pri obnoviavaneto na MySQL se sustoi v tova, che mnogo drugi paketi razchitat na nego. Takiva sa php-mysql, perl-DBD-MySQL, MySQL-python i drugi. Zatova ako opitame prosto da obnovim versiiata shte poluchim konflikt na zavisimostite, zashtoto shte se opitame da premahnem biblioteki, ot koito gornite paketi imat nuzhda. Na moiata rabotna stantsiia slednite paketi zavisiat ot MySQL:
Primeren kod
# rpm -e –test mysql mysql-server mysql-devel
 error: Failed dependencies:
 libmysqlclient.so.10 is needed by (installed) pam_mysql-0.5-1.i386
 libmysqlclient.so.10 is needed by (installed) perl-DBD-MySQL-2.9003-5.i386
 libmysqlclient.so.10 is needed by (installed) php-mysql-4.3.10-3.2.i386
Vuzmozhen nachin da se spravim s tazi zavisimost e da prekompilirame vsichki zavisimi paketi da polzvat novite biblioteki, no tova shte napravi dosta trudno posledvashtoto im obnoviavane, a plyus tova ima znachitelno po-lesen nachin.

MySQL predostaviat rpm paket MySQL-shared-compat, koito sudurzha bibliotekite ot predishnite versii i sred tiah e i lipsvashtata ni v gorniia sluchai libmysqlclient.so.10:
Primeren kod
rpm -qpl MySQL-shared-compat-4.1.9-0.i386.rpm
 warning: MySQL-shared-compat-4.1.9-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
 /usr/lib/libmysqlclient.so
 /usr/lib/libmysqlclient.so.10
 /usr/lib/libmysqlclient.so.10.0.0
 /usr/lib/libmysqlclient.so.12
 /usr/lib/libmysqlclient.so.12.0.0
 /usr/lib/libmysqlclient.so.14
 /usr/lib/libmysqlclient.so.14.0.0
 /usr/lib/libmysqlclient_r.so
 /usr/lib/libmysqlclient_r.so.10
 /usr/lib/libmysqlclient_r.so.10.0.0
 /usr/lib/libmysqlclient_r.so.12
 /usr/lib/libmysqlclient_r.so.12.0.0
 /usr/lib/libmysqlclient_r.so.14
 /usr/lib/libmysqlclient_r.so.14.0.0

Izpolzvaiki tozi paket, niama da ni se nalaga da prekompilirame zavisimite ot novata versiia paketi, kato te shte mogat da budat obnoviavani avtomatichno.

Razrabotchitsite na Fedora predlagat svoia versiia na tozi paket pod imeto mysqlclient10-3.23.58-4.i386.rpm i tozi paket sudurzha samo bibliotekite ot versiite na MySQL, koito se distributirat v stabilniia klon na Fedora:
Primeren kod
# rpm -qpl mysqlclient10-3.23.58-4.i386.rpm
 /etc/ld.so.conf.d/mysqlclient10-i386.conf
 /usr/lib/mysql/libmysqlclient.so.10
 /usr/lib/mysql/libmysqlclient.so.10.0.0
 /usr/lib/mysql/libmysqlclient_r.so.10
 /usr/lib/mysql/libmysqlclient_r.so.10.0.0

Az predpochitam da polzvam paketa na Fedora, zashtoto niamam nuzhda ot suvmestimost s 4.0 versiiata.

Tui kato opita da obnovim versiiata chrez poznatoto ni rpm -Uvh shte dovede do greshka poradi konflikt na zavisimostite, triabva purvo da premahnem starata versiia i da instalirame na chisto paketa sus starite biblioteki, za udovletvoriavane na zavisimostite, a sled tova i samiia survur za bazi danni. Tova stava sus slednite komandi:
Primeren kod
rpm -e --nodeps mysql mysql-server mysql-devel mysql-bench
 rpm -Uvh mysqlclient10-3.23.58-4.i386.rpm
 rpm -Uvh mysql-4.1.9-1.i386.rpm mysql-devel-4.1.9-1.i386.rpm mysql-server-4.1.9-1.i386.rpm mysql-bench-4.1.9-1.i386.rpm

Sled tova triabva veche da imame funktsionirasht MySQL versiia 4.1.9.

Nakratko, tozi shel skript triabva da svurshi rabotata vmesto vas ili pone da vi dade iasna predstva za posledovatelnostta na nuzhnite deistviia:
fedora-upgrade-mysql.sh
#!/bin/bash
 # A script to update MySQL on Fedora systems
 # Author Peio Popov
 # Use at your own risk!
 
 # Current MySQL version and build
 VER=4.1.9-1
 
 echo “Stop the database server”
 /etc/init.d/mysqld stop
 
 echo “Remove old MySQL version”
 rpm -e –-nodeps mysql mysql-server mysql-devel mysql-bench
 
 echo “Install the compatibility libraries”
 rpm -Uvh http://fedora.lcpe.uni-sofia.bg/fedora/linux/core/development/i386/Fedora/RPMS/mysqlclient10-3.23.58-4.i386.rpm
 
 echo “Install the new MySQL”
 rpm -Uvh http://fedora.lcpe.uni-sofia.bg/fedora/linux/core/development/i386/Fedora/RPMS/mysql-$VER.i386.rpm
 rpm -Uvh http://fedora.lcpe.uni-sofia.bg/fedora/linux/core/development/i386/Fedora/RPMS/mysql-devel-$VER.i386.rpm
 rpm -Uvh http://fedora.lcpe.uni-sofia.bg/fedora/linux/core/development/i386/Fedora/RPMS/mysql-bench-$VER.i386.rpm
 rpm -Uvh http://fedora.lcpe.uni-sofia.bg/fedora/linux/core/development/i386/Fedora/RPMS/mysql-server-$VER.i386.rpm
 
 echo “Start the database server”
 /etc/init.d/mysqld start


<< Kak da "svaliame" Debian s Jigdo ot bulgarskite ogledala. | LiVES i negoviiat suzdatel >>