본문 바로가기

MySQL24

Specified key was too long (부제: mysql 인덱스 생성 힘드네) mysql에 테이블 생성하는데 에러가 발생 했다. 16:36:12 mysql_13306.sock > create table push_test -> (col1 bigint, -> col2 varchar(256), -> PRIMARY KEY (col1, col2));ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes PK제약인가? 다시 생성 16:36:13 mysql_13306.sock > create table push_test -> (col1 bigint, -> col2 varchar(256), -> KEY push_test_idx01 (col1, col2));ERROR 1071 (42000): Specified key .. 2017. 6. 9.
MySQL 설치 (5.6 or 5.7) 자세한 설명은 생략한다.다운로드는 요기 ↓↓↓ --=========================================================================================================-- 001 OS 지표 확인 및 변경--=========================================================================================================su - [root@mpmykpop01 ~]# df -hTFilesystem Type Size Used Avail Use% Mounted on/dev/sda3 ext4 9.8G 833M 8.5G 9% /tmpfs tmpfs 32G 0 32G 0% .. 2017. 3. 9.
MySQL load data MySQL load data 예제 ---------- aaa.txt -------------100004,3611509,91643,"홍길동"1000123,3,0,"이순신"100022,996705,26469,"장보고"100059,28456594,736957,"김유신"100103,0,1,"최영"100176,30570326,503211,"이성계"100202,53,3,"유재석"1002239,1,0,"박명수"1002275,6,0,"하하"100257,4031,117,"광희"-------------------------------- CREATE TABLE `bbb` ( `col1` int(11) DEFAULT NULL, `col2` bigint(20) DEFAULT NULL, `col3` int(11) DEFAULT .. 2016. 10. 27.
MySQL 사용자 계정 추가, 변경, 자원 제한 1. MySQL에 새로운 사용자 계정 추가하기 GRANT ALL PRIVILEGES ON DB명.테이블명(or *) to '계정이름'@'호스트명' IDENTIFIED BY '암호'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';mysql> GRANT USAGE ON *.* TO 'dummy'.. 2016. 10. 20.