---
title: "MySQL常用命令"
author: "JetMah"
date: "2010-11-11T15:21:35Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2010-11-11T15:22:48Z"
id: 808777
url: "https://jetma.iteye.com/blog/808777"
---

原文出处: [MySQL常用命令](http://www.javatang.com/archives/2010/11/11/2207480.html)  
作者: Jet Mah from [Java堂](http://www.javatang.com/)  
声明: **可以非商业性任意转载, 转载时请务必以超链接形式标明文章原始出处、作者信息及此声明！**

01. -- Create Users
02. -- MySQL下创建并授权用户
03. \-- ------------------------------------
04. grant All on dbname.* to username@localhost identified by "yourpassword";
05. -- 下面这条命令是MySQL5为了兼容低版本的PHP而创建的
06. set password for username@localhost =old\_password('yourPassword');
07. flush privileges;
08. -- Import/Export
09. -- MySQL数据导入导出
10. \-- ------------------------------------
11. use dbname;
12. source 'filename';
13. -- 导入数据，mysqldump为bin目录下面的一个命令工具
14. mysqldump -u username -p dbname &gt; "filename"
15. -- Ip 授权IP访问
16. \-- ------------------------------------
17. -- 授权
18. grant all on \*.* to root@'192.168.1.88' identified by 'yourpassword';
19. -- 取消
20. drop user root@'192.168.1.88';