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‘; 更新表的內容

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章