mysql connect ssh
mysql -h 127.0.0.1 -p -u username database_name pass: password
Ver tablas Magento:
show tables;
Ejemplo reparar un tabla vía ssh:
repair table `sales_flat_invoice`;
Mostrar información de las tablas en la base de datos:
show table status;
Ver la información de una tabla determinada:
show table status like 'sales_flat_invoice';
Listar los campos en una tabla:
show columns from `sales_flat_invoice`;
Y nos saldrá algo como esto:
+-------------------------------+----------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------------------+----------------------+------+-----+---------+----------------+ | entity_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | store_id | smallint(5) unsigned | YES | MUL | NULL | | | base_grand_total | decimal(12,4) | YES | | NULL | | | shipping_tax_amount | decimal(12,4) | YES | | NULL | | | tax_amount | decimal(12,4) | YES | | NULL | | | base_tax_amount | decimal(12,4) | YES | | NULL | | | store_to_order_rate | decimal(12,4) | YES | | NULL | | | base_shipping_tax_amount | decimal(12,4) | YES | | NULL | | | base_discount_amount | decimal(12,4) | YES | | NULL | | | base_to_order_rate | decimal(12,4) | YES | | NULL | | | grand_total | decimal(12,4) | YES | MUL | NULL | | | shipping_amount | decimal(12,4) | YES | | NULL | | | subtotal_incl_tax | decimal(12,4) | YES | | NULL | | | base_subtotal_incl_tax | decimal(12,4) | YES | | NULL | | | store_to_base_rate | decimal(12,4) | YES | | NULL | | | base_shipping_amount | decimal(12,4) | YES | | NULL | | | total_qty | decimal(12,4) | YES | | NULL | | | base_to_global_rate | decimal(12,4) | YES | | NULL | | | subtotal | decimal(12,4) | YES | | NULL | | | base_subtotal | decimal(12,4) | YES | | NULL | | | discount_amount | decimal(12,4) | YES | | NULL | | | billing_address_id | int(11) | YES | | NULL | | | is_used_for_refund | smallint(5) unsigned | YES | | NULL | | | order_id | int(10) unsigned | NO | MUL | NULL | | | email_sent | smallint(5) unsigned | YES | | NULL | | | can_void_flag | smallint(5) unsigned | YES | | NULL | | | state | int(11) | YES | MUL | NULL | | | shipping_address_id | int(11) | YES | | NULL | | | cybersource_token | varchar(255) | YES | | NULL | | | store_currency_code | varchar(3) | YES | | NULL | | | transaction_id | varchar(255) | YES | | NULL | | | order_currency_code | varchar(3) | YES | | NULL | | | base_currency_code | varchar(3) | YES | | NULL | | | global_currency_code | varchar(3) | YES | | NULL | | | increment_id | varchar(50) | YES | UNI | NULL | | | created_at | timestamp | YES | MUL | NULL | | | updated_at | timestamp | YES | | NULL | | | hidden_tax_amount | decimal(12,4) | YES | | NULL | | | base_hidden_tax_amount | decimal(12,4) | YES | | NULL | | | shipping_hidden_tax_amount | decimal(12,4) | YES | | NULL | | | base_shipping_hidden_tax_amnt | decimal(12,4) | YES | | NULL | | | shipping_incl_tax | decimal(12,4) | YES | | NULL | | | base_shipping_incl_tax | decimal(12,4) | YES | | NULL | | | base_total_refunded | decimal(12,4) | YES | | NULL | | +-------------------------------+----------------------+------+-----+---------+----------------+ 44 rows in set (0.01 sec)
Optimizar una tabla:
optimize table `sales_flat_invoice`;
Respaldar Base de datos:
mysqldump --add-drop-table -u usuariobasededatos -p nombrebasededatos > basededatos_backup.sql
e ingresar la password.
Respaldar una tabla de la base de datos:
mysqldump -u usuariobasededatos -p nombrebasededatos nombredelatabla > nombredelatabla.sql
e ingresar la password.
Para Grabar una base de datos:
mysql -u usuariobasededatos -p nombrenuevabasededatos < basededatos_backup.sql
e ingresar la password.
Magento Chile Google+