標籤: PK: primary key (column is part of a pk) 主鍵 NN: not null (column is nullable) 非空 UQ: unique (column is part of a unique key) 唯一 AI: auto increment (the column is auto incremented when rows are inserted) 自增 BIN: binary
標籤:查詢及重複資料刪除記錄的方法(一)1、尋找表中多餘的重複記錄,重複記錄是根據單個欄位(peopleId)來判斷select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)2、刪除表中多餘的重複記錄,重複記錄是根據單個欄位(peopleId)來判斷,只留有一個記錄delete from peoplewhere
標籤:註:預存程序和函數的區別:預存程序沒有傳回值。1、查看預存程序 show procedure status \G2、刪除預存程序drop procedure 預存程序名3、建立預存程序create procedure 預存程序名(n int)beginif j='h' then select * from g where num>n;else select * from g where num<n;end$4、調用預存程序: call 預存程序名();例1:
標籤:0.環境:master:windows7,mysql5.5slave:centos6.5(虛擬機器),mysql5.11.先說下centos6.5安裝mysql以及簡要配置yum install -y mysql-server mysql mysql-devel通過這種方式安裝的是mysql5.1版本然後 cd /usr/share/doc/mysql-server-5.1.73/ cp my-lar
標籤:mysql遠端連線時提示失敗mysql遠端連線時提示失敗 [[email protected] ~]# /usr/local/mysql/bin/mysql -ubackup -p123456 -h 192.168.6.36Warning: Using a password on the command line interface can be insecure.ERROR 1045 (28000): Access denied for user
標籤: 總是在暴漏出bug的時候,才發現自己對知識掌握的不深入。 存在兩張表結構 drop table if EXISTS A;CREATE TABLE A ( ID int(1) NOT NULL, PRIMARY KEY (ID)) ENGINE=MyISAM DEFAULT CHARSET=utf8; insert into A values ( 1 );insert into A
標籤:mysqlMysql 忘記root密碼方法一:在/etc/my.cfg [mysqld]下面添加skip-grant-tables 或是skip-grant重啟MySQLuse mysql;UPDATE user SET Password = password ( ‘new-password‘ ) WHERE User =