النتائج 1 إلى 6 من 6

الموضوع: ترقية بشكل سليم Upgrade guide to MySQL 4.1

  1. #1
    عضو نشيط جدا
    تاريخ التسجيل
    Feb 2003
    المشاركات
    456

    ترقية بشكل سليم Upgrade guide to MySQL 4.1



    وجدت هذا الشرح لترقيه قواعد البيانات
    من يشرح لنا ويترجم هذا
    http://www.gentoo.org/doc/en/mysql-upgrading.xml
    على هذا الرابط

    النص
    ================
    1. Upgrading from old versions of MySQL

    Users upgrading from an old version (<4.0.24) of MySQL will first have to install MySQL 4.0.25. If you are already running a current version, you can skip this section and continue with the next one.

    Code Listing 1.1: Simple upgrade

    # emerge -av --buildpkg "<mysql-4.1"


    2. Creating a backup of your current data

    One of the most important tasks that every database administrator has to perfom is backing up data. Here we go:

    Code Listing 2.1: Dump of all databases

    # mysqldump \
    -uroot \
    --password='your_password' \
    -hlocalhost \
    --all-databases \
    --opt \
    --allow-keywords \
    --flush-logs \
    --hex-blob \
    --master-data \
    --max_allowed_packet=16M \
    --quote-names \
    --result-file=BACKUP_MYSQL_4.0.SQL


    Now a file named BACKUP_MYSQL_4.0.SQL should exist, which later can be used to recreate your data. The data is described in the MySQL dialect of SQL, the Structured Query Language.

    Now would also be a good time to see if the backup you have created is working.

    3. Upgrading from recent versions of MySQL

    If you have skipped step #1, you now have to create a backup package (of the database server, not the data) of the currently installed version:

    Code Listing 3.1: Binary package backup

    # quickpkg dev-db/mysql


    Now it's time to clean out the current version and all of its data:

    Code Listing 3.2: Uninstall MySQL

    # /etc/init.d/mysql stop
    # emerge -C mysql
    # tar cjpvf ~/mysql.$(date +%F_%H-%M).tar.bz2 /etc/mysql/my.cnf /var/lib/mysql/
    # ls -l ~/mysql.*
    # rm -rf /var/lib/mysql/ /var/log/mysql

    Note: Now two different backups should exist: The SQL one, which is portable between various versions of MySQL, and the other one that will allow you to quickly restore your database. This will be covered later in this doc in more detail.


    After you got rid of your old MySQL installation, you can now install the new version. Note that revdep-rebuild is necessary for rebuilding packages linking against MySQL.

    Code Listing 3.3: Upgrading the binaries

    # emerge -av ">mysql-4.1"
    # dispatch-conf
    # revdep-rebuild


    Now configure the newly installed version of MySQL and restart the daemon:

    Code Listing 3.4: Configure MySQL 4.1 base setup

    # emerge --config =mysql-4.1.<micro_version>
    # /etc/init.d/mysql start


    Finally you can import the backup you have created during step #2:

    Code Listing 3.5: Importing the SQL backup

    # cat BACKUP_MYSQL_4.0.SQL \
    | mysql \
    -uroot \
    --password='your_password' \
    -hlocalhost \
    --max_allowed_packet=16M

    # mysql_fix_privilege_tables \
    --defaults-file=/etc/mysql/my.cnf \
    --user=root \
    --password='your_password'


    If you now restart your MySQL daemon and everything went as expected, you will have a fully working version of 4.1.x! :-)

    Code Listing 3.6: Restart the MySQL instance

    # /etc/init.d/mysql restart


    If you encountered any problems during the upgrade process, please report them at our Bugzilla.

    4. Recover the old installation of MySQL 4.0

    If you are not happy with MySQL 4.1, it's possible to go back to MySQL 4.0.

    Code Listing 4.1: Back to the past

    # /etc/init.d/mysql stop
    # emerge -C mysql
    # rm -rf /var/lib/mysql/ /var/log/mysql
    # emerge --usepkgonly "<mysql-4.1"
    # tar -xjpvf mysql.[tag] -C /
    # /etc/init.d/mysql start


    5. Straight upgrade, not supported, dangerous

    Under certain conditions it's possible to directly upgrade to the next major version of MySQL. If you know what you're doing and think that applies to your case, here's a little trick that makes it possible to directly upgrade to MySQl 4.1.

    Code Listing 5.1: Straight upgrade

    # quickpkg dev-db/mysql
    # /etc/init.d/mysql stop
    # tar -cjpvf ~/mysql.$(date +%F_%H-%M).tar.bz2 /etc/mysql/my.cnf /var/lib/mysql/
    # ls -l ~/mysql.*
    # export MYSQL_STRAIGHT_UPGRADE=1
    # emerge -av ">mysql-4.1"
    # unset MYSQL_STRAIGHT_UPGRADE
    # dispatch-conf
    # revdep-rebuild
    # /etc/init.d/mysql start
    # mysql_fix_privilege_tables --defaults-file=/etc/mysql/my.cnf \
    -uroot --password='your_password'
    # mysql --database=mysql -uroot --password='your_password' < /tmp/new_pieces.sql
    # /etc/init.d/mysql restart # just to be sure


    Good luck and if something fails, don't say we didn't warn you! ;-)

    ======================







  2. #2


    اظن الشرح هنا جيد ووافى هذا والله اعلم

    اقتباس المشاركة الأصلية كتبت بواسطة Ali Hamad
    اخوي Explorer جميل جدا ، واحييك على طرحك الموضوع ، وبعد اذنك لي تعليق على نقطتين :
    1/ طريقة الترقية الصحيحه والاظمن كالتالي :
    ====
    ايقاف قواعد البيانات :
    /etc/init.d/mysql stop
    killall -9 mysql
    عمل مجلد مؤقت لكل قواعد البيانات ،
    mkdir /home/mysqlbackup
    نسخ مجلد قواعد البيانات الى المجلد المؤقت :
    cp –af /var/lib/mysql /home/mysqlbackup

    تاشر على الخيار في السي بنل ،
    بعدين :
    تحديث سكربتات السي بنل ،
    /scripts/updatenow
    ترقية قواعد البيانات بالشل ، حتى وان تم ترقيتها بالخيار اعلاه .
    /scripts/mysqlup
    اعادة تنصيب البيرل للماسيقول ،
    /scripts/perlinstaller --force Bundle:BD::mysql
    عمل ريلود للمايسقول ،
    mysqladmin reload
    اخذ بيانات الدخول الى المايسقول :
    cat /root/.my.cnf
    تجربة الدخول الى المايسقول :
    mysqladmin uroot –p
    mysql -uroot -p
    وادخل بالباسورد ، لو ماطلع عندك أي مشكلة ، الترقية تمام .

    اعادة تشغيل المايسقول :
    /etc/init.d/mysql restart


    2/


    كذا راح تحذف اختصار ال mysql.sock وماراح تشتغل المايسقول ، اذن لو تبي تحذف شيء في التمب ، تشوف وش اكبر ملف الي سبب المشكلة وتحذفه هو واي ملفات ثانية ، ماعدا الاختصار الي ذكرته فوق ، كما ان
    rm -rf *

    افضل انك ماتستخدمه الا في حالات نادره لانه بمجرد ضغط انتر ، راح ينحذف كل شيء ، وتخيل انك في ال /home او في ال /var/lib/mysql وسويت الامر هذا ؟! لازم تكون حذر جدا وانت تستخدمه .

    خالص التحية ، وعذرا على المداخله ،
    علي حمد ،






    __________________
    GNU/Linux system EngineerVps & Dedicated servers & ManagementContact Me On : 00201003338749 or ceo@murabba.comwww.murabba.com

  3. #3
    عضو نشيط جدا
    تاريخ التسجيل
    Feb 2003
    المشاركات
    456


    اقتباس المشاركة الأصلية كتبت بواسطة NoOoOoR
    اظن الشرح هنا جيد ووافى هذا والله اعلم
    طبقت هذا الشرح ولكن للاسف لم تتم الترقيه وبقى الاصدار كما هو






  4. #4


    لو محتاج اى مساعدة اضفنى اخى انا متواجد على الماسنجر





    __________________
    GNU/Linux system EngineerVps & Dedicated servers & ManagementContact Me On : 00201003338749 or ceo@murabba.comwww.murabba.com

  5. #5
    عضو نشيط جدا
    تاريخ التسجيل
    Feb 2003
    المشاركات
    456


    عملت كل خطوات الترقيه ولكن الغريبه الاصدار لم يترقى وبقيت القواعد على اصدارها القديمmysql (4.0.25-standard)






  6. #6
    عضو نشيط جدا
    تاريخ التسجيل
    Feb 2003
    المشاركات
    456


    انحلت المشكله والحمد لله
    This occurred because your RPM database files were marked as immutable. Therefore, the installer could not install the new MySQL RPMs. I have corrected this issue and your MySQL upgrade was able to successfully completed










ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض