mysql win10安装及简单操作

MySQL Community Server
5.6.47版本

https://downloads.mysql.com/archives/community/

下载下来为一个压缩包,解压。
bin目录添加进path中,命令窗口进入bin目录

mysqld -install
mysqld –initialize

net start mysql
mysql -u root -p (默认没有密码)
show databases; (测试)
net stop mysql

常用命令:
show databases; 显示所有数据库
CREATE DATABASE my_first; 创建一个数据库
use my_first; 选择其中一个数据库

CREATE TABLE my_first(name VARCHAR(20), sex CHAR(1), birth DATE, birthaddr VARCHAR(20)); 创建一个表my_first,有四个属性
show tables; 显示所有的表
DESCRIBE my_first; 显示表my_first的属性
alter table my_first add column single char(1); 增加一列属性
insert into first_table values (‘sunyee’, ‘B’ ,‘1997-08-17’,‘China’,‘N’); 增加一项数据
select * from first_table 选择表first_table的所有内容
update first_table set single=‘y‘ where name=‘abccs‘; 更新表的内容

猜你喜欢

转载自blog.csdn.net/huanghaihui_123/article/details/104600794