{"id":91,"date":"2023-01-22T18:00:13","date_gmt":"2023-01-22T17:00:13","guid":{"rendered":"https:\/\/www.aleskrejci.cz\/blog\/?p=91"},"modified":"2023-01-22T18:00:13","modified_gmt":"2023-01-22T17:00:13","slug":"nova-cista-instalace-phpmyadmin","status":"publish","type":"post","link":"https:\/\/www.aleskrejci.cz\/blog\/2023\/01\/22\/nova-cista-instalace-phpmyadmin\/","title":{"rendered":"Nov\u00e1 &#8211; \u010dist\u00e1 instalace phpmyadmin"},"content":{"rendered":"<p>Jeliko\u017e jsem posledn\u00ed dobou na v\u00edce stanic musel n\u011bkolikr\u00e1t instalovat <strong>phpmyadmin<\/strong>a, tak jsem si pro sebe napsal mal\u00fd skript\u00edk:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nfunction install_new_phpmyadmin() {\n    cd \/tmp\n    # ----------------------------\n    # -&gt; Get phpmyadmin version\n    VERSION=&quot;${1}&quot; # read first argument\n    if &#x5B; -z &quot;${VERSION}&quot; ]; then\n      TXT_DATA=&quot;$(wget https:\/\/www.phpmyadmin.net\/home_page\/version.txt -q -O-)&quot;\n      VERSION=&quot;$(echo ${TXT_DATA} | cut -d &#039; &#039; -f 1)&quot;\n      echo &quot;Detecting last version: ${VERSION}&quot;\n    else\n      echo &quot;Using manual version: ${VERSION}&quot;\n    fi\n    # ----------------------------\n    # Init values\n    DIRNAME=&quot;phpMyAdmin-${VERSION}-all-languages&quot;\n    FILENAME=&quot;${DIRNAME}.tar.gz&quot;\n    PHPMYADMIN=&quot;\/usr\/share\/phpmyadmin&quot;\n    # ----------------------------\n    # Download file and extract\n    sudo wget &quot;https:\/\/files.phpmyadmin.net\/phpMyAdmin\/${VERSION}\/${FILENAME}&quot;\n    sudo tar xzf &quot;${FILENAME}&quot;\n    sudo mkdir ${PHPMYADMIN}\n    sudo mv ${DIRNAME}\/* ${PHPMYADMIN}\n    rm -rf &quot;${DIRNAME}&quot; &quot;${FILENAME}&quot; # clean\n    # ----------------------------\n    # Copy config and replace values\n    sudo cp ${PHPMYADMIN}\/config.sample.inc.php  ${PHPMYADMIN}\/config.inc.php\n    sudo mkdir ${PHPMYADMIN}\/tmp &amp;&amp; sudo chmod 777 ${PHPMYADMIN}\/tmp\n    RANDOM_SECRET=$(tr -dc &#039;a-zA-Z0-9~!@#$%^&amp;*_-&#039; &lt;\/dev\/urandom | head -c32 2&gt;\/dev\/null)\n    sed -i &quot;s\/\\$cfg\\&#x5B;&#039;blowfish_secret&#039;\\] = &#039;&#039;;\/\\$cfg&#x5B;&#039;blowfish_secret&#039;] = &#039;${RANDOM_SECRET}&#039;;\/&quot; ${PHPMYADMIN}\/config.inc.php\n}\n# PhpMyadmin 4.9.10 -&gt; ( PHP 5.5 to 7.4 and MySQL\/MariaDB 5.5)\ninstall_new_phpmyadmin &quot;4.9.10&quot;;\n\nln -s \/usr\/share\/phpmyadmin \/var\/www\/html\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Jeliko\u017e jsem posledn\u00ed dobou na v\u00edce stanic musel n\u011bkolikr\u00e1t instalovat phpmyadmina, tak jsem si pro sebe napsal mal\u00fd skript\u00edk: function install_new_phpmyadmin() { cd \/tmp # &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- # -&gt; Get phpmyadmin version VERSION=&quot;${1}&quot; # read first argument if &#x5B; -z &quot;${VERSION}&quot; ]; then TXT_DATA=&quot;$(wget https:\/\/www.phpmyadmin.net\/home_page\/version.txt -q -O-)&quot; VERSION=&quot;$(echo ${TXT_DATA} | cut -d &#039; &#039; -f 1)&quot; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,5],"tags":[48,49],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-linux","category-bash","tag-phpmyadmin","tag-cleaninstall"],"_links":{"self":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/comments?post=91"}],"version-history":[{"count":0,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aleskrejci.cz\/blog\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}