插入数据:insert into tb_name (col1,clo2...) values|value ('string',num...);
replace into 替换
修改数据:update tb_name set com='value' where col1='';
删除数据:delete from tb_name where
选择
select 字段 from tb_name where 条件;
*:表示所有字段
where:没有where表示所有行
创建用户:create user 'username'@'host' identified by 'password';
删除用户:drop user 'username'@'host';
用户授权:grant 权限 on db_name.tb_name to 'username'@'host' [identified by 'password'];
查看用户权限:show grant for 'username'@'';
为用户设定密码
1、set password for 'username'@'host'=PASSWORD('password');
flush privileges;刷新
2、#mysqladmin -uusername -hhost -p PASSWORD'password';
3、update user set password=PASSWORD('password') where user='username'