Esi edozi ndozi MySQL: Ọtụtụ njikọ

Okwu Mmalite nke MySQL njehie: Ọtụtụ njikọ

Mgbe ị nwere ngwa weebụ (saịtị, blog, forum, wdg) nke dị na nnukwu ọchịchọ, ya bụ, ọnụ ọgụgụ dị ukwuu nke ndị ọrụ na-eleta, nke a sụgharịrị ịbụ ụba oriri na sava ahụ. Ọ bụrụ na ekwuru na ngwa weebụ na-eji nchekwa data MySQL na ajụjụ dị ọtụtụ (n'ihi mmemme ọjọọ nke weebụ ma ọ bụ ọtụtụ ndị ọrụ na-eji weebụ), enwere ike na MySQL ga-egosi njehie a:

mysqli_connect(): (HY000/1040): Too many connections

Gịnị ka MySQL: Oke Ọtụtụ Njikọ njehie pụtara?

Ọ pụtara na ọtụtụ arịrịọ na-abịa MySQL, karịa ka ọ nwere ike ịnabata, karịa ka ọ nwere ike kwụ n'ahịrị ma ọ bụ chere.

Kedu otu esi edozi ya?

Dị Mfe, anyị ga-abawanye oke ịgba nke arịrịọ (njikọ) nke MySQL na-akwado.

Aga m enye gị nhọrọ abụọ iji dozie nsogbu a:

1. Anyị na-edezi faịlụ /etc/mysql/my.cfg:

nano /etc/mysql/my.cfg

N'ime ya anyị tinyere ihe ndị a n'okpuru ebe ọ na-ekwu [mysql]:

max_connections = 500 max_user_connections = 500

Nke a ga - eme ka ọnụ ọgụgụ njikọ kachasị site na 100 (nke bụ ndabara) na 500.

Anyị na-echekwa ma pụọ, mgbe ahụ, anyị malitegharị ọrụ MySQL na ọ bụ ya. Mgbanwe a na-adịgide adịgide.

2. Zọ ọzọ iji dozie nsogbu a bụ ịgbanwe oke ịgba nha anya, mana site na ajụjụ MySQL.

Ka anyi buru uzo gosiputa ugbua:

mysql --user="root" --password="PASSWORD" --execute='SHOW VARIABLES LIKE "max_connections";'

Nke a ga-egosi anyị ihe dịka nke a:

+ --------------------- + ----- + | Aha Ngbanwe | Uru | + --------------------- + ----- + | max_connections | 151 | + --------------------- + ------- +

N'ikwu ya n'ụzọ ọzọ, njedebe dị ugbu a bụ njikọ 151, nke ọma, ka anyị welite ya na 500 site na ajụjụ:

mysql --user="root" --password="PASSWORD" --execute='SET GLOBAL max_connections = 500;'

Njikere!

Nsogbu dị n'ụzọ a bụ na mgbe a malitegharịrị ọrụ ahụ, nhazi a efuola.

Iji na-enye a zuru ezu, ị pụrụ ime ka a bash akwukwọ na bụla X oge verifies, ma ọ bụ ọbụna tinye akara ka mmalite ma ọ bụ Malitegharịa ekwentị ngọngọ nke daemon 😉

Mana kedụ ihe kpatara m jiri chọọ ịmata nhọrọ nke abụọ a? ... ọma, nke ahụ bụ ihe m na-ekwu. Mana otu ọnwa gara aga Ubuntu Server leghaara usoro No.2 anya, yabụ ... na oke ikpe nzuzu OS, anyị nwere nhọrọ 1 a nke na - arụkwa ọrụ nke ọma 😉


Ọdịnaya nke isiokwu agbaso ụkpụrụ anyị nke ụkpụrụ nduzi. Kpesa mmejọ pịa ebe a.

Ihe 6 kwuru, hapụ nke gị

Hapu okwu gi

Adreesị email gị agaghị bipụtara. Chọrọ ubi na-akara na *

*

*

  1. Rụ ọrụ maka data: Miguel Ángel Gatón
  2. Nzube nke data: Nchịkwa SPAM, njikwa okwu.
  3. Ikike: Nkwenye gị
  4. Nkwurịta okwu nke data: Agaghị agwa ndị ọzọ data ahụ ma ọ bụghị site na iwu.
  5. Nchekwa data: Ebe nchekwa data nke Occentus Networks (EU) kwadoro
  6. Ikike: Oge obula inwere ike igbachi, weghachite ma hichapụ ihe omuma gi.

  1.   nex dijo

    Ezi post, MySQL… ha na-eji ọtụtụ ihe na FreeBSD, K. site na Weebụ), SFTP (SSH-File Transfer Protocol), Apache - PHP- MySql, PHP5 na PhpSysInfo Extensions.

    1.    KZKG ^ Gaara dijo

      Iji mee nke a, m ga-etinye FreeBSD, echeghị m na m nwere oge ugbu a, naanị m gbanwere ọrụ ma enwere m ọtụtụ ibu ọrụ 🙁

  2.   Saul dijo

    Emechara m mee ihe yiri nke ahụ maka ọrụ na nodejs. N'okwu m ọ mụbara ruo 250 ma nke ahụ ezuru, n'ihi na ugbu a, m na-eme nke ọma. Daalụ maka ozi ahụ

  3.   Francisco dijo

    Ndewo, ị nwere ike inyere m aka ka esi abanye /etc/mysql/my.cfg?

    Enwere m VPS, mana enweghị m ike ịbanye na PUTTY.

    Ekele.

  4.   sịga dijo

    Iji dozie nsogbu nke Nhọrọ 1.- Kwadoro nhọrọ, ma debe mgbanwe ndị ahụ mgbe ịmalitegharị ihe nkesa ahụ, faịlụ ahụ ga-edezi dịka mbipute:

    /________________________________________________________________________________________________________/ //// /////////, // //
    // Gbanwee ndekọ na Ubuntu 16.04 / // // //
    /________________________________________________________________________________________________________/ //// /////////, // //
    vi /etc/mysql/mysql.conf.d/mysqld.cnf

    /________________________________________________________________________________________________________/ //// /////////, // //
    // Gbanwee ndekọ na Ubuntu 15.04 / // // //
    /________________________________________________________________________________________________________/ //// /////////, // //
    vi /etc/mysql/mariadb.conf.d/mysqld.cnf

    /________________________________________________________________________________________________________/ //// /////////, // //
    // M gbanwere ndekọ na Ubuntu ochie / // // //, // //
    /________________________________________________________________________________________________________/ //// /////////, // //

    vi /etc/mysql/my.cnf

    /________________________________________________________________________________________________________/ //// /////////, // //
    // tinye akara a n’okpuru mkpado [mysqld] ma ọ bụ [mysql] //
    // Mgbe ahụ Malitegharịa ekwentị ihe nkesa //
    /________________________________________________________________________________________________________/ //// /////////, // //
    max_njikọ = 500

  5.   were iwe dijo

    Nkuzi site na ncha na-enweghị agwa gị otu esi agbanwe ya