MySQL常用命令
原文出处: MySQL常用命令
作者: Jet Mah from Java堂
声明: 可以非商业性任意转载, 转载时请务必以超链接形式标明文章原始出处、作者信息及此声明!
- -- Create Users
- -- MySQL下创建并授权用户
- -- ------------------------------------
- grant All on dbname.* to username@localhost identified by "yourpassword";
- -- 下面这条命令是MySQL5为了兼容低版本的PHP而创建的
- set password for username@localhost =old_password('yourPassword');
- flush privileges;
- -- Import/Export
- -- MySQL数据导入导出
- -- ------------------------------------
- use dbname;
- source 'filename';
- -- 导入数据,mysqldump为bin目录下面的一个命令工具
- mysqldump -u username -p dbname > "filename"
- -- Ip 授权IP访问
- -- ------------------------------------
- -- 授权
- grant all on *.* to root@'192.168.1.88' identified by 'yourpassword';
- -- 取消
- drop user root@'192.168.1.88';