2016-12-10 29 views
0

由於一連串的事件,我以爲我的託管公司丟失了一臺服務器,所以我完全失去了一個站點。無論如何,我試圖回到一個網站坐在服務器上,我無法與cPanel和一個WHM我不能去。我只能通過ftp訪問根目錄。我能在這裏使用的方法https://www.drupal.org/node/1556488Drupal 7創建洪水錶PHP

我的意思也很清楚洪水錶重置我的管理員密碼,但db_drop_table('flood');

所以刪除它,而不是,現在我得到一個MySQL錯誤,當我嘗試登錄。所以,鑑於我只能訪問運行php腳本與SQL數據庫進行交互,誰能幫我弄清楚如何通過drupal db_create_table()方法重建泛洪表?

非常感謝!這是一場噩夢。

+0

不確定你在說什麼。我寫了代碼,我只是在尋找關於如何使用PHP重建洪泛表的drupal指南。不知道你爲什麼認爲屬於serverfault社區。 – rankind

+0

http://stackoverflow.com/help/how-to-ask –

+0

這不是我第一次在這裏尋求幫助。任何知道drupal和PHP的人都會對我所要求的內容有非常清楚的理解。 – rankind

回答

0

我能夠用drupal安裝目錄中運行的php文件重建我的泛洪表,並在其中輸入:只需輸入url mysite.com/myphpfile.php即可運行它。

<?php 
define('DRUPAL_ROOT', getcwd()); 
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; 
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); 
require_once DRUPAL_ROOT . '/includes/password.inc'; 

    $schema = array(); 
    $schema['flood'] = array(
    'fields' => array(
     'fid' => array(
     'type' => 'int', 
     'length' => 11, 
     'not null' => TRUE, 
    ), 
     'event' => array(
     'type' => 'varchar', 
     'length' => 64, 
     'not null' => TRUE, 
     'default' => '', 
    ), 
     'identifier' => array(
     'type' => 'varchar', 
     'length' => 128, 
     'not null' => TRUE, 
     'default' => '', 
    ), 
     'timestamp' => array(
     'type' => 'int', 
     'length' => 11, 
     'not null' => TRUE, 
    ), 
     'expiration' => array(
     'type' => 'int', 
     'length' => 11, 
     'not null' => TRUE, 
    ), 
    ), 
    'primary key' => array('fid'), 
); 

db_create_table('flood', $schema['flood']); 

print "Done. Please delete this file immediately!"; 
drupal_exit(); 


?>