MySQL入门

1.常用的MySQL界面工具

Navicat,MySQL-Front,MySQL Workbench(官方),mysql(命令行),phpmyadmin(web版,需要XAMPP)

2.启动/关闭MySQL服务命令

net start mysql56

net stop mysql56

3.MySQL实现远程连接(改表法)

use mysql;

update user set host = '%' where user = 'root';

flush privileges;­(mysql 新设置用户或更改密码后需用flush privileges刷新MySQL的系统权限相关表,否则会出现拒绝访问)

4.连接到MySQL

mysql -h 127.0.0.1 -u root -p root

5.C#连接MySQL

using System.Data;

using MySql.Data.MySqlClient;

 

MySqlConnection conn = new MySqlConnection("server=localhost;user id=root;password=root;database=world");
conn.Open();
MySqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "select * from city";

 

posted @ 2014-04-06 18:28  talentzemin  阅读(115)  评论(0编辑  收藏  举报