1. 创建hash 密码:
$vi generatePass.php
<?php
// test.php
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
include $mageFilename;
Mage::app();
$pass = 'YOUR_PASS'; // the password which you want to use to login
Zend_Debug::dump(Mage::helper('core')->getHash($pass, 2));
[php] view plaincopy
php test.php
string(35) "1e3960170b81bb14f312f144f992c078:GQ"
2. 新建admin用户
INSERT INTO
admin_user
SET
firstname = "admin",
lastname = 'admin',
email = 'YOUR_EMAIL',
username = 'YOUR_USERNAME',
password = '1e3960170b81bb14f312f144f992c078:GQ', -- or MD5('ADMIN_PASS') on comunity edition
is_active = 1,
extra = 'a:1:{s:11:"configState";a:12:{s:19:"carriers_matrixrate";s:1:"0";s:18:"carriers_tablerate";s:1:"0";s:17:"carriers_flatrate";s:1:"0";s:21:"carriers_freeshipping";s:1:"1";s:12:"carriers_ups";s:1:"1";s:13:"carriers_usps";s:1:"0";s:14:"carriers_fedex";s:1:"0";s:12:"carriers_dhl";s:1:"0";s:17:"amsorting_general";s:1:"1";s:15:"general_country";s:1:"1";s:14:"general_locale";s:1:"0";s:25:"general_store_information";s:1:"0";}}';
3.添加到admin_role 表
INSERT INTO
admin_role
SET
parent_id = 1,
tree_level = 2,
sort_order = 0,
role_type = 'U',
user_id = 'USER_ID', -- created in the previous step
role_name = 'admin';
OK,大功告成
(责任编辑:最模板) |