MYSQL常用命令 MyISAM to InnoDB, max connections , GRANT ALL PRIVILEGES , mysqldump 等等
Date_add
SELECT OrderId,DATE_ADD(OrderDate,INTERVAL 2 DAY)
AS OrderPayDate FROM Orders
MyISAM to InnoDB
ALTER TABLE boblog_blogs ENGINE=InnoDB;
ALTER TABLE boblog_calendar ENGINE=InnoDB;
max connections
show global variables like "%max_con%";
set global max_connections xxx;
GRANT ALL PRIVILEGES
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'sa123' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
flush privileges;
mysqldump
mysqldump -uroot -pabc123 qida_prd_20151122_1753 >qida_prd_20151124_0013.sql
mysql -uroot -p qida2_t001<F:\asp db backup\mysql\sql script\1511qd_shop.sql
查询死锁等
show processlist;
给表加索引
ALTER TABLE `income` ADD INDEX uid ( `uid` ) ;
update from
update `log` a inner join `logs` b on a.`accountuin` = b.`accountuin`
set a.`uin` = b.`uin` where a.`accountuin` = b.`accountuin`