
{"id":937,"date":"2019-12-02T16:34:49","date_gmt":"2019-12-02T19:34:49","guid":{"rendered":"http:\/\/rodrigosilvaesilva.com.br\/?p=937"},"modified":"2019-12-02T16:34:49","modified_gmt":"2019-12-02T19:34:49","slug":"reset-password-mysql-5-5-mariadb-5-5","status":"publish","type":"post","link":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/2019\/12\/02\/reset-password-mysql-5-5-mariadb-5-5\/","title":{"rendered":"Reset password Mysql 5.5 | MariaDB 5.5"},"content":{"rendered":"<p><strong>Verificando vers\u00e3o<\/strong><\/p>\n<pre class=\"lang:sh decode:true\">[root@srvweb ~]# mysql --version\nmysql  Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1<\/pre>\n<p>Verificando processos em execu\u00e7\u00e3o<\/p>\n<pre class=\"lang:sh decode:true\">[root@srvweb ~]# ps -ef |grep mysql\nroot      2102  3048  0 17:14 pts\/0    00:00:00 grep --color=auto mysql\nmysql     3683     1  0 Oct12 ?        00:00:00 \/bin\/sh \/usr\/bin\/mysqld_safe --basedir=\/usr\nmysql     3894  3683  0 Oct12 ?        07:39:57 \/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\n<\/pre>\n<p>Parando Mysql \/ MariaDB<\/p>\n<pre class=\"lang:sh decode:true\">[root@srvweb ~]# systemctl stop mariadb\n<\/pre>\n<p>Resetando o password<\/p>\n<pre class=\"lang:sh decode:true\">[root@srvweb ~]# mysqld_safe --skip-grant-tables --skip-networking &amp;\n[1] 3190\n[root@srvweb ~]# 191202 17:14:45 mysqld_safe Logging to '\/var\/log\/mariadb\/mariadb.log'.\n191202 17:14:45 mysqld_safe Starting mysqld daemon with databases from \/var\/lib\/mysql<\/pre>\n<p>Logando Mysql \/ MariaDB<\/p>\n<pre class=\"lang:plsql decode:true \">[root@srvweb ~]# mysql -u root\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 2\nServer version: 5.5.60-MariaDB MariaDB Server\n\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true\">MariaDB [(none)]&gt; FLUSH PRIVILEGES;\nQuery OK, 0 rows affected (0.02 sec)<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"lang:plsql decode:true\">MariaDB [(none)]&gt; SET PASSWORD FOR 'root'@'localhost' = PASSWORD('PASSWORD');\nQuery OK, 0 rows affected (0.00 sec)<\/pre>\n<pre class=\"lang:plsql decode:true\">MariaDB [(none)]&gt; UPDATE mysql.user SET authentication_string = PASSWORD('PASSWORD') WHERE User = 'root' AND Host = 'localhost';\nQuery OK, 1 row affected (0.00 sec)\nRows matched: 1  Changed: 1  Warnings: 0<\/pre>\n<p>Necess\u00e1rio parar o MariaDB para desativar o <strong><span class=\"crayon-c\">mysqld_safe<\/span> <\/strong><\/p>\n<pre class=\"lang:sh decode:true\">MariaDB [(none)]&gt; CREATE USER 'teste'@'localhost' IDENTIFIED BY 'password';\n\nERROR 1290 (HY000): The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Pare o Mysql \/ MariaDB com o mysqladmin<\/p>\n<pre class=\"lang:sh decode:true\">[root@srvweb ~]# mysqladmin shutdown\n[1]+  Done                    mysqld_safe --skip-grant-tables --skip-networking<\/pre>\n<p>Pare e inicie o MariaDB<\/p>\n<pre class=\"lang:sh decode:true\">systemctl start mariadb\n\nsystemctl start mysql\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Verificando vers\u00e3o [root@srvweb ~]# mysql &#8211;version mysql Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1 Verificando processos em execu\u00e7\u00e3o [root@srvweb ~]# ps -ef |grep mysql root 2102 3048 0 17:14 pts\/0 00:00:00 grep &#8211;color=auto mysql mysql 3683 1 0 Oct12 ? 00:00:00 \/bin\/sh \/usr\/bin\/mysqld_safe &#8211;basedir=\/usr mysql 3894 3683 0 Oct12 ? 07:39:57 \/usr\/libexec\/mysqld&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[127,142,303,333,348,372],"class_list":["post-937","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-error-1290-hy000","tag-flush-privileges","tag-reset-password-mysql-5-5-mariadb-5-5","tag-set-password-for-rootlocalhost","tag-systemctl-stop-mariadb","tag-update-mysql-user-set-authentication_string"],"_links":{"self":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts\/937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=937"}],"version-history":[{"count":0,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/posts\/937\/revisions"}],"wp:attachment":[{"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rodrigosilvaesilva.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}