日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
MySQL數(shù)據(jù)庫的基本知識(shí)大全

以下的文章主要介紹的是MySQL數(shù)據(jù)庫的基本知識(shí),其中包括對(duì)MySQL數(shù)據(jù)庫的創(chuàng)建,以及對(duì)一些相關(guān)的數(shù)據(jù)類型描述,其中還涉及到表的創(chuàng)建,以下就是文章的詳細(xì)內(nèi)容描述,望你會(huì)有所收獲。

站在用戶的角度思考問題,與客戶深入溝通,找到云巖網(wǎng)站設(shè)計(jì)與云巖網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶體驗(yàn)好的作品,建站類型包括:成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名申請(qǐng)網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋云巖地區(qū)。

MySQL數(shù)據(jù)庫安裝 ***改變字符集UTF8

創(chuàng)建數(shù)據(jù)庫

 
 
 
  1. create database mydata;  
  2. use mydata; 

數(shù)據(jù)類型 int double char varchar datetime longtext

創(chuàng)建表 create table dept

 
 
 
  1. (  
  2. deptno int primary key,  
  3. dname varchar(14),  
  4. loc varchar(13)  
  5. );  
  6. create table emp  
  7. (  
  8. empno int primary key,  
  9. ename varchar(10),  
  10. job varchar(15),  
  11. mgr int,  
  12. hiredate datetime,  
  13. sal double,  
  14. deptno int,  
  15. foreign key (deptno) references dept(deptno)  
  16. );  

MySQL數(shù)據(jù)庫執(zhí)行腳本文件.sql \. 文件路徑 或 source 文件路徑

?

sql文件中 -- 注釋

MySQL管理軟件 MySQL administrator,toad for MySQL

查看數(shù)據(jù)庫 show databases;

查看表 show tables;

查看表結(jié)構(gòu) desc dept;

插入數(shù)據(jù)

 
 
 
  1. intsert into dept values(1,'a','a');  
  2. commit; 

分頁 select * from dept order by deptno desc limit 3,2; (從第三條往后數(shù)兩條)

自增 create table article

 
 
 
  1. (  
  2. id int primary key auto_increment,  
  3. title vachar(255)  
  4. );  
  5. insert into article values(null,'a');  
  6. insert into article(title) values('c'); 

日期處理

獲取當(dāng)前日期 select now();

轉(zhuǎn)化字符串 select date_format(now(),'%Y-%m-%d %H:%i:%s');

 
 
 
  1. jdbc連接MySQL  
  2. Connection conn=null;  
  3. Statement stmt=null;   
  4. ResultSet rs=null;   
  5. try{   
  6. Class.forName("com.MySQL.jdbc.Driver").newInstance();  
  7. conn=DriverManager.getConnection("jdbc:MySQL://localhost/test? user=root&password=root");  
  8. stmt=conn.createStatement();  
  9. rs = stamt.executeQuery(sql);  
  10. }  
  11. catch(Exception e){}  
  12. finally{  
  13. try{  
  14. if(rs!=null){rs.close; rs=null;}  
  15. if(stat!=null){stat.close; stat=null;}  
  16. if(conn!=null){conn.close; conn=null;}  
  17. }  
  18. catch(SQLException e){  
  19. e.printStackTrace();  
  20. }  
  21. }   

以上的相關(guān)內(nèi)容就是對(duì)MySQL數(shù)據(jù)庫知識(shí)的介紹,望你能有所收獲。


當(dāng)前標(biāo)題:MySQL數(shù)據(jù)庫的基本知識(shí)大全
路徑分享:http://www.5511xx.com/article/cddpcps.html