2008年5月13日 星期二

mysql command

start mySQL:
sudo /usr/local/mysql/bin mysqld_safe

stop mySQL:
sudo /usr/local/mysql/bin mysqladmin shutdown

create an account for a database:
grant  all on *.*  to 'deeplove'@'localhost'  identified by  '111';
create new user account "deeplove", with password 111, 
connect to database from "localhost", all  means you can do anything( SELECT, INSERT, ...)
*.* means you can connect to every database ( Dog.* means you can only connect to Dog database)

join:
collect information from two or more tables & present it as a single table
left join  ...  on ...  :
return all matching rows from first table, even if there are no matching rows in the second table

group by
combine two tables using the filed both tables have 

select syntax
select columns from table where condition

沒有留言: