mysql命令符
首先登入mysql伺服器(資料夾所在位置),登入mysql命令(1,mysql -uroot -proot,2,mysql -u root -p,3,mysql -uroot -p),實際上都差不多的,大同小異。
選中資料庫:use + 資料庫名;
檢視資料庫中的表: show tables;
然後我們可以建立資料庫: create database + 資料庫名稱;
再建立資料庫中的表: create table + 表名 ( (這裡是括號開頭,注意是圓括號不是尖括號)
欄位名1 + int not null auto_increment;
欄位名2 + varchar(長度) not null;
欄位名3 + varchar(長度) not null;
欄位名4 + date + 型別;
primary key + 欄位名1) engine=myisam default charset=utf8;
(在這裡建立完成圓括號結束)
到這裡咱們的表就建立完成了。 下面是對錶裡面的一些簡單命令符操作。
1,查詢資料 : select * from 表名;
2,向資料庫中的表插入資料:insert into 表名(欄位名1,欄位名2,~~~) values (欄位1,欄位2,~~~);
3,修改資料庫中表的某一條資料:update 表名 set 欄位名=值,欄位名=值,~~~ where id=2;
4, 刪除資料庫中的某一條資料:delete from article where 欄位名=值;
5, 刪除乙個資料庫: drop database 資料庫名;
6, 刪除乙個資料庫中的乙個表:drop table 表名;
7, 向乙個資料庫中的乙個表新增乙個字段: alter table 表名 add 欄位名 型別;
8, 查詢乙個表的表結構: desc 表名;
9, 修改資料庫中表的字段屬性:alter table 表名 alter column 欄位名 型別 not null;
10, 刪除字段: alter table 表名 drop column 欄位名。
以上就是我對mysql 裡面的命令提示符的一些簡單的認識以及介紹。
php 相關知識
1.yii通過phpmailer傳送郵件 max len 80 60 mailer subject subject body preg replace body mailer body body mailer altbody 不支援html顯示.r n body mailer addaddress ...
php相關知識,PHP基礎知識
1.單引號,雙引號 當雙引號中包含變數時,變數會與雙引號中的內容連線在一起 當單引號中包含變數時,變數會被當做字串輸出。world world str1 hello,world hello,world str2 hello,world hello,world echo str1 echo echo ...
PHP配置相關知識集錦
變數名 php.ini development php.ini production error reporting e all e all e deprecated e strict display errors onoff display startup errors onoff track e...