{"id":61,"date":"2020-01-21T05:42:00","date_gmt":"2020-01-21T05:42:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=61"},"modified":"2024-02-06T08:11:14","modified_gmt":"2024-02-06T13:11:14","slug":"what-to-do-when-you-locked-yourself-out-of-drupal","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/what-to-do-when-you-locked-yourself-out-of-drupal\/","title":{"rendered":"What to do when you locked yourself out of drupal"},"content":{"rendered":"\n<p>When you set site maintenance to offline, you lose the link to you login form as well. To get the login form, you need to do the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;www.mysite.com\/q=user\n or\nhttp:\/\/www.mysite.com\/user<\/code><\/pre>\n\n\n\n<p>Do not replace the word user with your username.<\/p>\n\n\n\n<p>If this doesn&#8217;t work, log into you database and type the following SQL commands.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UPDATE variable SET value = 's:1:\"0\";' WHERE name= 'site_offline';\nDELETE FROM cache WHERE cid = 'variables';<\/code><\/pre>\n\n\n\n<p>If you lost your mysql password, go to your drupal installation directory. Then navigate to sites\/default. You should see a file by the name of settings.php. Open this file and look for a line which looks like the following.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql:\/\/username:password@localhost\/databasename<\/code><\/pre>\n\n\n\n<p>Then type the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u username -p databasename<\/code><\/pre>\n\n\n\n<p>You will be prompted for you password. Once logged in type the SQL commands listed above.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you set site maintenance to offline, you lose the link to you login form as well. To get the login form, you need to do the following: Do not replace the word user with your username. If this doesn&#8217;t work, log into you database and type the following SQL commands. If you lost your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[21],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-drupal","tag-drupal"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":62,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/61\/revisions\/62"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}