mysql啟動

link

安裝

一路next 需要注意的是:編碼utf-8 設(shè)置密碼

cmd必須以管理員身份運行

net start mysql
net stop mysql

查看服務(wù)進程

  • services.msc

登陸(sql命令都以分號結(jié)束)

mysql -uroot -pxw

show databases//查看當前目錄下有哪些數(shù)據(jù)庫
;回車
//會顯示系統(tǒng)已有的數(shù)據(jù)庫,默認有4個

create database test_1; //創(chuàng)建數(shù)據(jù)庫

顯示版本號

select version();
其是不用記這么多sql語句,有個工具sqlyod可以幫你解決所有事情

數(shù)據(jù)庫的使用

show databases;
use test_1;//使用數(shù)據(jù)庫
show tables;//
 create table students(id varchar(20),name varchar(50));//創(chuàng)建表,并給它2個字段 id name
show create table students; //查看建表的語句
desc students;// 顯示表
 insert into students values('0001','zhangsan');
 insert into students values('0002','lisi');
 insert into students values('0003','wangwu');
 insert into students values('0004','liwu');
select * from students;//查看表中所有類容
 select * from students where id='0001';
select * from students where id='0002' and name='lisi';//有時候id一樣
那我想查所有姓李的
select * from students where name like '%li%'; 以什么開頭什么結(jié)束
select * from students where name like '%li%' limit 1;
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容