database

warning: Creating default object from empty value in /web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

MySQL Queries

-- list databases
show databases;
 
-- change database
USE mysql;
 
-- show tables in database
show tables;
 
-- list users
SELECT USER FROM mysql.USER;
 
-- select 10 random row from table
SELECT column FROM TABLE
ORDER BY rand()
limit 10
 
-- update table (use join)
UPDATE table1
JOIN table2
ON table1.product = table2.a
SET table1.sku = table2.b
--where table1.product = 2138
 
-- view all databases
show databases;
 
-- view tables from database
show tables FROM mysql;
 
-- timestamp 7 days ago
date_sub(curdate(), INTERVAL 7 DAY);
 
-- format date
SELECT TO_CHAR(TIME,

Databases

DB Clients
http://www.squirrelsql.org - SQuirreL SQL, universal SQL Client, supports MS SQL and other DB

Connect from OpenOffice / LibreOffice to MsSQL Server
http://www.oooforum.org/forum/viewtopic.phtml?t=24036

Export MySQL Database

Login
mysql -u root -p

Links
phpMyAdmin - phpMyAdmin downloads

GUI
apt-get install -y mysql-admin

Allow access from outsice
sed -i 's|bind-address|#bind-address|g' /etc/mysql/my.cnf
/etc/init.d/mysql restart

Allow access to database magento for user dbo_magento from any host
GRANT ALL PRIVILEGES ON magento.* TO dbo_magento@'%' IDENTIFIED BY 'your_pass'

# dont LOCK TABLE on export / import

Syndicate content