linux怎樣建立乙個簡單的mysql資料庫

2021-08-27 18:27:03 字數 1355 閱讀 9143

看到乙份比較好的文件,儲存下來,以便日後檢視.

一.建立資料庫

注:已經安裝好mysql。

windows下執行cmd進入命令視窗,

本人用的是win7系統,先輸入f:進入f盤,然後輸入「cd f:\mysql\mysql-5.7.18-winx64\bin」(注:不要引號,路徑為自己解壓mysql的路徑)。

輸入net start mysql 啟動服務,輸入net stop mysql 停止服務,

輸入mysql -u root -p後會提示輸入密碼,輸入密碼後進入mysql控制台。

二.建立資料庫

輸入create database student ;建立資料庫(student為資料庫名)

使用 show databases;檢視有哪些資料庫

輸入use student命令出現這個即可以建立乙個資料庫表,

輸入create table tb_stu1 (

`id` int(11) not null auto_increment,

`name` varchar(30) default null,

`***` varchar(2) default null,

`birthday` date default null,

primary key (`id`)

) engine=innodb auto_increment=11 default charset=utf8;

注:tb_stu1位表名

使用show tables檢視test下的表名,

建好之後使用describe tb_stu1;檢視(注:一定要使用use student進入資料庫之後才能使用這個命令)

使用insert into tb_stu1(id,name,***,birthday) values ( 1,'小明', '男', '2015-11-02');加入資料,

使用select * from tb_stu1;檢視資料

使用truncate table tb_stu1;清空資料

JavaScript怎樣建立乙個物件?

最常用的最方便的建立方法,如下所示 var foo 其實字面量是使用object.create的快捷方式,下面 與上面等價 var foo object.create object.prototype,var person function myname var me new person joe ...

建立乙個簡單的執行緒

handle createthread in opt lpsecurity attributes lpthreadattributes,security attributes 結構指定了這個執行緒的安全屬性,如果填 null 則就以預設的安全描述子建立,並且返回的控制代碼不會被繼承。in size ...

建立乙個簡單的畫板

1.cv.createtrackbar 有5個引數 滑動條的名字 視窗的名字 數值的最小值 數值的最大值 函式2.cv.gettrackbarpos 有2個引數 滑動條的名字 視窗的名字 函式的返回值是滑動條的數值。import cv2 as cv import numpy as np def no...