Posted on 2009-03-06 14:02
kongkongzi 阅读(157)
评论(0) 编辑 收藏 引用 所属分类:
mysql
1,开放所有权限的话请执行:
mysql>update user set select_priv='Y' , Insert_priv='Y', Update_priv='Y', delete_priv='Y', Create_priv='Y', Drop_priv='Y',Reload_priv='Y', shutdown_priv='Y', Process_priv='Y', File_priv='Y', Grant_priv='Y', references_priv='Y',Index_priv='Y', Alter_priv='Y', Show_db_priv='Y', Super_priv='Y',Create_tmp_table_priv='Y',Lock_tables_priv='Y', Execute_priv='Y',Repl_slave_priv='Y',Repl_client_priv='Y' where user='用户名';
2,show processlist, 查看mysql当前正在处理的sql语句。
3,事务
START TRANSACTION;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summary=@A WHERE type=1;
COMMIT;