十年網站開發(fā)經驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網站問題一站解決
在phpmyadmin里面點開一張表然后看哪個字段下面有下劃線那個就是主鍵,或者看下面的索引這一欄沒有沒有一個字段類型是PRIMARY那就是主鍵
專業(yè)領域包括成都網站設計、網站建設、商城建設、微信營銷、系統(tǒng)平臺開發(fā), 與其他網站設計及系統(tǒng)開發(fā)公司不同,成都創(chuàng)新互聯的整合解決方案結合了幫做網絡品牌建設經驗和互聯網整合營銷的理念,并將策略和執(zhí)行緊密結合,為客戶提供全網互聯網整合方案。
MySQL中所有使用者的權限是記錄在mysql這個數據庫的users資料表中
所以你只要先use mysql
再SELECT * FROM users 你可以看到所有的使用者權限
有關db的數據是記錄在Db(大小寫要注意)這個數據表中
所以只要呼叫出Db的資料 SELECT * FROM Db 就可以看到你要的答案
或者你可以用 SELECT * FROM Db WHERE Db='phplampDB'找出你要的答案
--books表中有字段有bId,pId等字段。
--another有bId,pId等字段(create table another select bId,pid,bAuthor from books;--相關字段以及內容來自books表)。
--books和publising建立外鍵,參照publishing中的id字段。
alter table books add constraint FK_books_publishing foreign key (pid) references publishing (id) on update cascade;
--another和publishing之間創(chuàng)建外鍵,參照publishing中的id字段。
alter table another add constraint FK_another_publishing foreign key (pId) references publishing (id) on update cascade;
--舉個簡單的更新列子:
update publishing set id = 17,pname = '愛好者' where id='14';
--當執(zhí)行這條語句時(更新publishing表),books表和another表同時進行更新。
--主表更新字段數據等,副表也隨之更新,從上面可以看出,主表是publishing,副表是books和another。
--希望能幫到你
MySQL 查看表結構簡單命令。
一、簡單描述表結構,字段類型desc tabl_name;
顯示表結構,字段類型,主鍵,是否為空等屬性,但不顯示外鍵。
二、查詢表中列的注釋信息
select * from information_schema.columns where table_schema = 'db' #表所在數據庫
and table_name = 'tablename' ; #你要查的表
三、只查詢列名和注釋
select column_name,
column_comment from information_schema.columns where table_schema ='db' and
table_name = 'tablename' ;
四、#查看表的注釋
select table_name,table_comment from information_schema.tables where table_schema = 'db' and table_name ='tablename'
ps:二~四是在元數據表中查看,我在實際操作中,常常不靈光,不知為什么,有了解的大俠請留印。
五、查看表生成的DDL show create table table_name;