본문 바로가기

develop/sql

mysql centos7 release 버전보다 낮은 버전 설치하기 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm# rpm -ivh mysql-community-release-el7-5.noarch.rpm yum repolist all | grep mysql-> 현재 릴리즈 버전이 enable로 나올거임. sudo yum-config-manager --disable mysql57-community sudo yum-config-manager --enable mysql56-community-> 사용하려는 버전을 enable 해줌.-> yum-config-manager 없을 시 yum install yum-utils 설치하여 사용 yum repolist enabled | grep mysql-> 확인 후.. 더보기
mysql 제약조건 확인하기 Use the information_schema.table_constraints table to get the names of the constraints defined on each table:select * from information_schema.table_constraints where constraint_schema = 'YOUR_DB'Use the information_schema.key_column_usage table to get the fields in each one of those constraints:select * from information_schema.key_column_usage where constraint_schema = 'YOUR_DB'If instead you ar.. 더보기
Oracle등의 check 제약조건 mysql에서 쓰기 mysql에서는 check 제약조건이 있지만 무시해버린다. 고로 trigger를 이용해서 비슷하게 만들 수 있다. mysql> drop table mytable; Query OK, 0 rows affected (0.03 sec) mysql> create table mytable ( -> id smallint unsigned AUTO_INCREMENT, -> age tinyint not null, -> primary key(id) -> ); Query OK, 0 rows affected (0.06 sec) mysql> DELIMITER $$ mysql> CREATE TRIGGER checkage_bi BEFORE INSERT ON mytable FOR EACH ROW -> BEGIN -> DECLARE d.. 더보기
[펌] CentOS 6.4 + Oracle 11gR2 설치 CentOS 6.4 64bit (X-Window)Java 1.6 (SUN)Oracle 11gR2설치전 작업X-Window 설치Oracle 설치시에는 X-Window 환경에서 설치를 진행하여 합니다. 만약 X-Windows 설치가 되어있지 않을 경우에는 아래의 명령을 이용하여 X-Window 설치하시면 됩니다.Shell1yum -y groupinstall "X Window System"의존 라이브러리 설치아래의 명령을 이용하여 오라클 설치시 필요한 의존 라이브러를 설치합니다.Shell1234yum -y install compat-libstdc++-33.x86_64 binutils elfutils-libelf elfutils-libelf-develyum -y install glibc glibc-common .. 더보기