انجمن


‍پیغام MySQL server has gone away در برنامه xampp  (۲ نوشته)

  • Erexsa

    آفلاین
    عضو
    تعداد نوشته‌ها: ۱۵
    # نوشته شده: ۱۶ سال پیش
    ۲۷ آذر ۱۳۸۷ - ۱۰:۱۶

    دیروز با پیغام خطای : error 2006: MySQL server has gone away در xampp زمان درون ریزی پایگاه داده مواجه میشدم
    این پیغام زمانی میاد که حجم Database خیلی زیاد شده
    راه حل :

    Summary: xampp installation on Windows XP, error encountered by a PHP script while uploading large files to a mysql database server.
    
    This is caused by a mysql max_allowed_packet setting, which by default is set to 1M.
    
    You can confirm the setting by
    
        * checking the value in sql by issuing a show variables command, or
        * by checking the system variables in phpmyadmin.
    
    To change the setting, you need to edit the my.cnf file in your c:\...\xampp\sql\bin directory and change the default value of 1M to something larger, for example 16M. NOTE: Change the directory path to its actual value.
    
    You may see the file named simply as "my", and it may also look like a shortcut. In this case, you cannot click on the file icon to open it. Instead, go start --> run and issue the command: notepad.exe c:\...\xampp\mysql\bin\my.cnf. Again, change the directory path to its actual value

    .

  • Erexsa

    آفلاین
    عضو
    تعداد نوشته‌ها: ۱۵
    # نوشته شده: ۱۶ سال پیش
    ۲۷ آذر ۱۳۸۷ - ۱۰:۲۰

    این هم برای زمانی که حجم فایل برای درون ریزی از حجمی که اجازه میده بیشتره

    The default import limit in phpMyAdmin is 2MB. In this post I will show how you can overcome this problem and import your large database backup.
    
    Let’s take for example that you have successfully exported a backup of your website database in sql format -the process is described in the post on joomla security patch where you can read the steps to backup your database - having a size of 15MB.
    
    With apache2 and php5 installed you need to make three changes in the file sudo gedit /etc/php5/apache2/php.ini. If you have XAMPP installed, then probably the php.ini file can be found into .\xampp\apache\bin\php.ini. For WAMP into C:\Program Files\PHP5.
    
    Search first for the entry post_max_size = 2M where you need to enter a larger number than the size of your database (15M in this case) i.e. 25M, then edit the memory_limit and give a larger number than the one given to post_max_size. Finally, edit the entry upload_max_filesize with a value smaller than post_max_size.
    
    Starting from bigger values the order should go like this 1.memory_limit, 2.post_max_size, 3.upload_max_filesize
    
    Restart apache and you are set.

درباره‌ی این موضوع



برچسب‌ها