목록IT/Web & DB (4)
Endless Motivation
1. use mysql 2. insert into user(Host, User, Password) values(''%', 'root', password('[비번]'); 3. grant all privileges on busapp.* to 'root'@'%' identified by '[비번]'; 4. flush privileges; * CentOS에서 3306포트 접근권한 풀기 1. sudo firewall-cmd -add-port=3306/tcp 2. sudo firewall-cnml --permanent -add-port=3306/tcp
1. Windows에서 MariaDB가 설치된 폴더 주소 확인 (e.g. ..../MariaDB10.1/bin) 2. 주소 복사 후 관리자 모드로 cmd 실행 3. 1에서 확인한 주소로 이동 4. mysqldump -u [유저이름] -p [DB이름] > [백업파일 이름]; 입력, 백업파일 생성 5. 리눅스 머신으로 백업파일 이동 6. sudo mysql -u [유저이름] -p [DB이름] > [백업파일 이름] 입력 *** 6번 실행 후 DB가 없다고 나올 경우 = 백업 파일을 열어보면 DB를 생성하는 쿼리문이 빠져있는 상태일 것이다. 이런 경우 1. 빈 DB를 생성 2. DB를 선택한 다음 'source 백업파일' 쿼리로 수동 입력
1. Apache 다운로드 : http://www.apachelounge.com/download/ 2. 적당한 위치로 이동 (e.g. C:\Apache24) 3. \conf\httpd.conf 파일 열기 4-1. ServerRoot를 Apache24가 설치된 경로로 변경 4-2. ServerName과 ServerAdmin 변경 4-3. 포트번호 변경(필요에 따라) 5. 시스템 변수 Path에 경로 추가(...\Apache24\bin) 5. 명령 프롬프트 관리자 권한 실행 6. httpd.exe -k install 7. httpd.exe -k start * ..\bin\ApacheMonitor.exe로도 구동 가능(GUI)
- DB directory 생성Create database ; - Directory 사용use ; - 테이블 생성create table ( [not null], [not null], ......constraint primary key(),constraint foreign key() references () ); - select를 사용한 테이블 생성(기존 테이블에서 컬럼별로 가져오기) create table as select from ; - 테이블 이름 변경rename table to ; - 테이블 구조 확인 desc ; - 테이블 내 전체 컬럼(Attribute) 검색 show full columns from ; - 테이블 내 컬럼 추가alter table add ; - 테이블 내 컬럼 삭제alter t..