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

-- view hostname
SELECT @@hostname;
 
-- list databases
show databases;
 
-- change database
USE mysql;
 
-- show tables in database
show tables;
 
-- show table informations
show TABLE status;
 
-- list users
SELECT USER, host FROM mysql.USER;
 
-- create DB
CREATE database db1;
grant ALL ON db1.* TO user1@localhost identified BY 'pass';
 
-- 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
 
-- vi

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

Optimize all databases
mysqlcheck --optimize --all-databases --host=localhost --user=${DB_USER} --password=${DB_PASS}

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

Syndicate content