{"id":545,"date":"2012-06-14T00:25:32","date_gmt":"2012-06-14T00:25:32","guid":{"rendered":"http:\/\/www.plugged.in\/?p=545"},"modified":"2012-06-14T00:25:32","modified_gmt":"2012-06-14T00:25:32","slug":"update-mysql-user-passwords-in-h-sphere-database","status":"publish","type":"post","link":"https:\/\/www.veriteknik.net.tr\/en\/update-mysql-user-passwords-in-h-sphere-database\/","title":{"rendered":"Update MySQL user passwords from H-Sphere DataBase"},"content":{"rendered":"<p>This article is only applicable to H-Sphere control panel where old mysql passwords are stored as clear text.<\/p>\n<p>With the latest update, php 53 comes with mysqlnd module which doesn&#8217;t allow old_passwords to be used.<\/p>\n<p>In \/etc\/my.cnf comment old_passwords if any,<\/p>\n<p>Backup your MySQL database and restart mysql server and execute the following code:<\/p>\n<p>Create a php file and copy\/paste below code:<\/p>\n<pre class=\"brush: php; gutter: true; first-line: 1\">&lt;?php\n\nini_set(\"display_errors\",1);\n\n\/\/Postgres login on CP server\n$dbuser = \"wwwuser\";\n$dbpass = \"dbpass\";\n$dbhost = \"cp_pgsql_ip\";\n$dbname = \"hsphere\";\n\n\/\/MySQL login on MySQL server\n$myroot = \"root\";\n$mypass = \"mysql_root_pass\";\n$myhost = \"mysql_server_ip\";\n$mylid = 25;\n\n$mycon = mysql_connect($myhost, $myroot, $mypass);\nif (!$mycon) {\n    die('Could not connect: ' . mysql_error());\n}\nmysql_select_db('mysql', $mycon);\n\n\t$dbconn = pg_connect(\"host=$dbhost dbname=$dbname user=$dbuser password=$dbpass\")\n    or die('Could not connect: ' . pg_last_error());\n\n\t$users = pg_query(\"select mu.login,mu.password from mysql_users as mu ,mysqlres as mr where mu.parent_id=mr.id and mr.mysql_host_id=$mylid order by mu.login asc; ;\")\n\tor die('Query failed: ' . pg_last_error());\n\twhile ($line = pg_fetch_array($users, null, PGSQL_ASSOC))\n\t{\n\t\t\techo \"Setting \".$line[\"login\"].\": \";\n\t\t\t$login = $line[\"login\"];\n\t\t\t$pass = $line[\"password\"];\n\n\t\t\tmysql_query(\"set password for '\".$login.\"'@'localhost' = password('\".$pass.\"');\");\n\t\t\tmysql_query(\"set password for '\".$login.\"'@'%' = password('\".$pass.\"');\");\n\t\t\techo \"&lt;br\/&gt;\";\n\t}\n\n?&gt;<\/pre>\n<p>Good luck!.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is only applicable to H-Sphere control panel where old mysql passwords are stored as clear text. With the latest update, php 53 comes with mysqlnd module which doesn&#8217;t allow old_passwords to be used. In \/etc\/my.cnf comment old_passwords if any, Backup your MySQL database and restart mysql server and execute the following code: Create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[364],"tags":[],"yst_prominent_words":[1190,665,1971,936],"class_list":["post-545","post","type-post","status-publish","format-standard","hentry","category-mysql-databases"],"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"ckaraca","author_link":"https:\/\/www.veriteknik.net.tr\/en\/author\/ckaraca\/"},"uagb_comment_info":0,"uagb_excerpt":"This article is only applicable to H-Sphere control panel where old mysql passwords are stored as clear text. With the latest update, php 53 comes with mysqlnd module which doesn&#8217;t allow old_passwords to be used. In \/etc\/my.cnf comment old_passwords if any, Backup your MySQL database and restart mysql server and execute the following code: Create&hellip;","_links":{"self":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/comments?post=545"}],"version-history":[{"count":0,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/545\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/media?parent=545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/categories?post=545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/tags?post=545"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}