How To Enable/ Disable Auto Reconnect in MySQL كيفية تمكين او تعطيل السيارات في اعادة الخلية

What is auto reconnect in MySQL? ما هو اعادة للسيارات في الخلية؟
The MySQL client library can perform an automatic reconnect to the server if it finds that the connection is down when you attempt to send a statement to the server to be executed. فان الخلية العملاء مكتبة يمكن أن تؤدي تلقائيا الى اعادة الخادم اذا تبين لها ان تعطل الصدد عند محاولة بيان ارسل الى الخادم الذي سينفذ. In this case, the library tries once to reconnect to the server and send the statement again. وفي هذه الحاله ، فان المكتبه يحاول مرة واحدة لاعادة وصل الى الخادم وارسل البيان مرة اخرى.
Automatic reconnection can be convenient because you need not implement your own reconnect code, but if a reconnection does occur, several aspects of the connection state are reset and your application will not know about it. اعادة الربط التلقائي يمكن ان تكون سهلة ومريحه لأنك لا يلزم تنفيذ قانون اعادة الاتصال الخاصة بك ، ولكن اذا كان اعادة يحدث بالفعل ، عدة جوانب من الدولة الصدد هي اعادة طلبك وسوف لا يعرف عن ذلك. This is extremely useful if you long running persistent connections to the database. وهذا امر مفيد للغاية اذا كنت طويلة لاستمرار تشغيل وصلات الى قاعدة البيانات. Also if you have too many sql queries / use connection pool etc. auto reconnect is a handy feature. ايضا اذا كان لديك عدد كبير جدا من لغة الاستعلامات البنيويه الاستفسارات / استخدام الصدد اعادة تجميع السيارات وما هو مفيد الميزه. Let’s look at how to enable / disable auto reconnect in MySQL and what are the side-effects of enabling auto reconnect. دعنا ننظر في كيفية تمكين او تعطيل السيارات في الخلية واعادة وصل ما هي الاثار الجانبية للتمكن من اعادة السيارات.
How to enable MySQL client auto reconnect كيفية تمكين العملاء الخلية اعادة السيارات
my_bool reconnect = 1; my_bool اعادة = 1 ؛
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect); mysql_options (& الخلية ، mysql_opt_reconnect ، اعادة &) ؛
What are the side-effects of MySQL auto reconnect? ما هي الآثار الجانبية لاعادة الخلية السيارات؟
- Any active transactions are rolled back and autocommit mode is reset. اي معاملات نشطة وتوالت العودة autocommit اعادة ضبط الوضع.
- All table locks are released. جميع اقفال الجدول يتم الافراج.
- All TEMPORARY tables are closed (and dropped). جميع الجداول المؤقتة مغلقة (واسقطت).
- Session variables are reinitialized to the values of the corresponding variables. اعادة شغلت الدورة المتغيرات الى قيم المتغيرات المقابلة. This also affects variables that are set implicitly by statements such as SET NAMES. وهذا يؤثر ايضا على مجموعة من المتغيرات التي هي ضمنا من قبل مثل هذه البيانات كما وردت اسماء.
- User variable settings are lost. اعدادات المستخدم متغير تضيع.
- Prepared statements are released. اعداد البيانات الافراج عنهم.
- HANDLER variables are closed. المعالج المتغيرات مغلقة.
- The value of LAST_INSERT_ID() is reset to 0. قيمة last_insert_id () هو إعادة ل0.
- Locks acquired with GET_LOCK() are released. مع اقفال get_lock المكتسبه () يتم الافراج.
- mysql_ping() does not attempt a reconnection if the connection is down. mysql_ping () ليست محاولة اعادة الاتصال اذا انخفضت. It returns an error instead. وتعود خطأ بدلا من ذلك.
How to disable MySQL client auto reconnect كيفية تعطيل الخلية عميل إعادة السيارات
In view of the side-effects you may want to disable auto reconnect. ونظرا للآثار جانبية قد ترغب في تعطيل اعادة السيارات. In MySQL version 5.1 and above auto reconnect is disabled by default. الإصدار 5،1 في الخلية واعادة السيارات اعلاه هو تقصير من جانب المعوقين. In any version you can disable auto reconnect with the following PHP code: في اي صيغة يمكنك تعطيل اعادة السيارات مع بي. اتش. بى المدونه التالية :
my_bool reconnect = 0; my_bool اعادة = 0 ؛
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect); mysql_options (& الخلية ، mysql_opt_reconnect ، اعادة &) ؛
Filed under المقدم بمقتضى Database قاعدة بيانات , ، Enterprise Software المشاريع والبرامج , ، Headline News أهم الانباء , ، How To كيف , ، Java Software برنامج جافا , ، MySQL الخلية , ، Open Source Software برامج المصدر المفتوح , ، PHP بي. اتش. بى , ، Programming البرمجه , ، RDBMS RDBMS تجربة , ، Tech Note ملاحظه تقنيه | |
| |
RSS 2.0 ار اس اس 2،0 | |
Trackback this Article | هذه المادة |
Email this Article ارسل هذه المادة
You may also like to read ويمكنك ايضا ان تقرأ |




October 17th, 2007 at 1:25 pm تشرين الاول / اكتوبر 17th ، 2007 في الساعة 6:05
That’s not PHP code بي. اتش. بى تلك ليست مدونة
C/C++ perhaps. ج / ج + + ربما.
October 18th, 2007 at 1:08 pm تشرين الاول / اكتوبر 18th ، 2007 في الساعة 1:08
It is PHP code. ومن المدونه بي. اتش. بى. Check the fine manual غرامة التحقق من دليل
May 23rd, 2008 at 4:15 pm ايار / مايو 23rd ، 2008 في 4:15 بعد الظهر
There’s no mysql_options() command listed anywhere in PHP documentation that I can find (trying to use it gives an ‘undefined function’ error). لا يوجد mysql_options () الواردة في اي مكان في قيادة بي. اتش. بى الوثائق التي ما وجدت) وتحاول استخدامها يعطي 'غير مسمى وظيفة' خطأ). my_bool is definitely not a PHP variable type. my_bool هو بالتأكيد ليس نوع بي. اتش. بى متغير. PHP variables also need $’s, of which you have none. بي. اتش. بى المتغيرات ايضا الحاجة دولار بالمجلس ، من تلك التي كنت قد لا شيء. I’m sorry, but this is NOT php code. انا آسف ، لكن هذه ليست مدونة بي. اتش. بى.
You provide useful explanation of auto-reconnection functionality, but please don’t mislead people by claiming it’s useful code for PHP developers. هل من المفيد تقديم تفسير للسيارات - اعادة الوظيفيه ، ولكن الرجاء عدم تضليل الناس بادعاء انها مفيدة للقانون مطوري بي. اتش. بى.