{"id":2730,"date":"2015-10-06T02:01:34","date_gmt":"2015-10-06T02:01:34","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=2730"},"modified":"2015-10-06T02:01:34","modified_gmt":"2015-10-06T02:01:34","slug":"reset-maria-db-password-on-plesk","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2015\/10\/06\/reset-maria-db-password-on-plesk\/","title":{"rendered":"Reset maria DB password on Plesk"},"content":{"rendered":"<p>Is it mysql or maria?<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# service mysqld status\nRedirecting to \/bin\/systemctl status  mysqld.service\nmysqld.service\n   Loaded: not-found (Reason: No such file or directory)\n   Active: inactive (dead)\n\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n]# systemctl status mariadb.service\nmariadb.service - MariaDB database server\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled)\n   Active: active (running) since Mon 2015-10-05 21:03:57 EST; 3min 30s ago\n  Process: 26953 ExecStartPost=\/usr\/libexec\/mariadb-wait-ready $MAINPID (code=exited, status=0\/SUCCESS)\n  Process: 26922 ExecStartPre=\/usr\/libexec\/mariadb-prepare-db-dir %n (code=exited, status=0\/SUCCESS)\n Main PID: 26952 (mysqld_safe)\n   CGroup: \/system.slice\/mariadb.service\n           \u251c\u250026952 \/bin\/sh \/usr\/bin\/mysqld_safe --basedir=\/usr\n           \u2514\u250027120 \/usr\/libexec\/mysqld --basedir=\/usr --datadir=\/var\/lib\/mysql --plugin-dir=\/usr\/lib64\/mysql\/plugin --log-error=\/var\/log\/mariadb\/mariadb.log --pid-file=\/var\/run\/mariadb\/mariadb.pid --socket=\/var\/lib\/mysql\/mysql.sock\n\nOct 05 21:03:55 domain.com mysqld_safe&#x5B;26952]: 151005 21:03:55 mysqld_safe Logging to &#039;\/var\/log\/mariadb\/mariadb.log&#039;.\nOct 05 21:03:55 domain.com mysqld_safe&#x5B;26952]: 151005 21:03:55 mysqld_safe Starting mysqld daemon with databases from \/var\/lib\/mysql\nOct 05 21:03:57 domain.com systemd&#x5B;1]: Started MariaDB database server.\n\n<\/pre>\n<p>Find the existing password<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# cat \/etc\/psa\/.psa.shadow\n$AES-128-CBC$MnglmyKq3wJbZVgmb4YKTQ==$p\/zX+xpnhJ20kIrrZiFsq7VLE3kI+86JwVdPYJtWdEE=&#x5B;root@69-64-92-195 ~]#\n<\/pre>\n<p>Stop the database<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n]# systemctl stop mariadb.service\n<\/pre>\n<p>Edit my.cnf and add skip-grant-tables<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;mysqld]\nlocal-infile=0\ndatadir=\/var\/lib\/mysql\nsocket=\/var\/lib\/mysql\/mysql.sock\n# Disabling symbolic-links is recommended to prevent assorted security risks\nsymbolic-links=0\n# Settings user and group are ignored when systemd is used.\n# If you need to run mysqld under a different user or group,\n# customize your systemd unit file for mariadb according to the\n# instructions in http:\/\/fedoraproject.org\/wiki\/Systemd\nskip-grant-tables\n&#x5B;mysqld_safe]\nlog-error=\/var\/log\/mariadb\/mariadb.log\npid-file=\/var\/run\/mariadb\/mariadb.pid\n\n#\n# include all files from the config directory\n#\n!includedir \/etc\/my.cnf.d\n\n<\/pre>\n<p>Restart mysql<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# systemctl restart mariadb.service\n<\/pre>\n<p>Reset the mysql password no<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# mysql -uadmin -p`cat \/etc\/psa\/.psa.shadow` psa\nmysql&gt; UPDATE mysql.user SET Password=PASSWORD(&#039;# mysql -uadmin -p`cat \/etc\/psa\/.psa.shadow` psa\nmysql&gt; UPDATE mysql.user SET Password=PASSWORD(&#039;$AES-128-CBC......&#039;) WHERE User=&#039;admin&#039;;&#039;) WHERE User=&#039;admin&#039;;\n<\/pre>\n<p>Edit my.cnf and remove skip-grant-tables<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;mysqld]\nlocal-infile=0\ndatadir=\/var\/lib\/mysql\nsocket=\/var\/lib\/mysql\/mysql.sock\n# Disabling symbolic-links is recommended to prevent assorted security risks\nsymbolic-links=0\n# Settings user and group are ignored when systemd is used.\n# If you need to run mysqld under a different user or group,\n# customize your systemd unit file for mariadb according to the\n# instructions in http:\/\/fedoraproject.org\/wiki\/Systemd\n# skip-grant-tables\n&#x5B;mysqld_safe]\nlog-error=\/var\/log\/mariadb\/mariadb.log\npid-file=\/var\/run\/mariadb\/mariadb.pid\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Is it mysql or maria? # service mysqld status Redirecting to \/bin\/systemctl status mysqld.service mysqld.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead) ]# systemctl status mariadb.service mariadb.service &#8211; MariaDB database server Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled) Active: active (running) since Mon 2015-10-05 21:03:57 EST; 3min 30s ago Process: 26953 ExecStartPost=\/usr\/libexec\/mariadb-wait-ready $MAINPID (code=exited, &#8230; <a title=\"Reset maria DB password on Plesk\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2015\/10\/06\/reset-maria-db-password-on-plesk\/\" aria-label=\"Read more about Reset maria DB password on Plesk\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70,86],"tags":[],"class_list":["post-2730","post","type-post","status-publish","format-standard","hentry","category-mysql","category-plesk"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=2730"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2730\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=2730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=2730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=2730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}