(1)cd c:/ //进入c:->
(2)mysql -h 127.0.0.1 -u root -p //进入数据库
SHOW DATABASES; //显示所有数据库
CREATE DATABASE aaa; //新建数据库
DROP DATABASE aaa; //删除数据库
USE aaa; //选择数据库
CREATE TABLE example(id INT,
name VARCHAR(20),
sex BOOLEAN); //创建数据表
DESCRIBE example; //查看数据表的定义
DESC example; //查看数据表的定义
SHOW CREATE TABLE example; //查看数据表详细的格式
DELETE FROM example;//删除表中所有字段
INSERT INTO example VALUES('字符串',19);//插入字段
SELECT * FROM example;//查看表中字段
(3)SELECT * INTO OUTFILE ‘./test.xls‘ FROM tb1;//将数据表导出到excel中
//C:ProgramDataMySQLMySQL Server 5.1data ext
//ProgramData文件是隐藏的
C#(4)MySqlCommand comm = new MySqlCommand
("INSERT INTO receive VALUES('" + tbbuf + "')",conn);
//在数据表中插入变量tbbuf;并将comm实例化
//MySqlCommand对象是用来管理SQL语句的
C#(5)MySqlConnection conn = new MySqlConnection
("Data Source = localhost; Initial Catalog = com;
User ID = root;Password = root");
//创建MySqlConnection对象,并实例化,com数据库的名称
//再通过conn.Open();连接数据库