andkirby/mage-db-helper

Database Helpers (Magento)

v2.0.0 2017-05-12 12:06 UTC

This package is auto-updated.

Last update: 2024-11-20 01:41:58 UTC


README

Overview

There are DB procedures/functions to help work with Magento DB.

Composer installation

$ composer global require andkirby/mage-db-helper

global parater can be ommited if you won't use this installation globally.

Install scripts

$ mage-db-helper install -d dbname -u dbuser -p password1

If parameter --mysql-password (-p) (MySQL password) is ommited you may set it in dialog to make this command secured. Also you may skip asking password with parameter --no-password (-o);

More

To get full help about parameters please use standard --help (-h) parameter.

$ mage-db-helper install -h

Usage Helpers in Database

There are available helpers:

  • DropAllTables,
  • ResetBaseUrl.
  • ResetAdmin.

DropAllTables

Remove all tables from database. It useful to prevent reinstalling exists procedures (like these ones).

CALL dbname.DropAllTables();

ResetBaseUrl

Reset base URLs in core_config table. It useful when you migrate database.

CALL dbname.ResetBaseUrl('old-server.example.com', 'new-one.example.com');

ResetAdmin

Reset password, username (set to admin) and locking of first admin user (ID #1) in admin_user table. It useful to reset admin user quickly.

CALL dbname.ResetAdmin('your-new-password');

Note: dbname could be omitted in examples if you run use dbname; before.