본문 바로가기
반응형

MySQL6

CONVERT_TZ : mysql 타임존 변경 CONVERT_TZ('2008-05-15 12:00:00','+00:00','+10:00'); In MySQL the CONVERT_TZ() returns a resulting value after converting a datetime value from a time zone specified as the second argument to the time zone specified as the third argument. This function returns NULL when the arguments are invalid Name Description dt A datetime. from_tz A time zone which will be converted to to_tz. to_tz A time zo.. 2022. 6. 16.
Mysql 의 Password() 함수로 만든 hash 를 bcrpyt 로 변경해주는 Wordpress plugin 옛날 홈페이지를 워드프레스로 이전하는 도중에, 사용자 암호 역시 이전하기 위해 만들었다이 플러그인은 https://roots.io/plugins/bcrypt-password/ 를 수정해서 만들었다. Github 에서 원본 소스를 fork 한 git 주소이다https://github.com/jjjnlove/wp-password-bcrypt/commits/master 옛 홈페이지에서 사용자 비번을 mysql 의 password() 를 사용하여 저장하고 있었다mysql 개발자 사이트에 가보면 다음과 같은 내용이 있다PASSWORD() is used by the authentication system in MySQL Server; you shouldnot use it in your own applications.. 2017. 5. 30.
우분투에 Apache, mysql, php 설치하기 우분투에 Apache, mysql, php, ftp 설치 Apache 설치 sudo apt-get updatesudo apt-get install apache2apt 는 우분투의 패키지 매니저이다update 는 최신으로 정보를 갱신킨 후에 apache 를 설치한다/etc/init.d/apache2 restart이 명령어가 성공적으로 진행되어 다음 메시지를 볼 수 있다면 설치가 성공했다고 볼 수 있다 [ ok ] Restarting apache2 (via systemctl): apache2.service. Myslq 설치 sudo apt-get install mysql-server mysql-client설치 확인을 위해 다음 명령어를 실행한다/etc/init.d/mysql restart설치된 mysql 의.. 2017. 4. 5.
테이블 복사시 AUTO_INCREMENT 속성 살리기 Maria DB 테이블을 복사하여 사용하면, AUTO_INCREAMENT 속성이 사라졌고, 지정되지 않았다.검색하다가 해결 방법을 발견했다 1. 복사하기 create table 새로만들테이블이름 select * from 기존에있던 테이블 이름예) create table new select * from old 2. 기존 데이터 삭제하기(선택)기존 데이터를 그대로 보존 할 사람은 삭제하지 마시라! delete from 새로만든테이블예) delete from new 3.PRIMARY KEY 지정하기PRIMARY KEY가 지정돼있지 않으면 auto_increment가 되지 않는다!! ALTER TABLE 새로만든테이블 ADD PRIMARY KEY(지정할 컬럼명 )예) ALTER TABLE new ADD PRIM.. 2017. 4. 3.
Language construct echo, print, include, isset, require 등의 함수는 Language construct 이다그렇다면 Language construct 라는 것은 무엇인가? 네이버에서 검색에 나온 전자용어사전의 정의는 다음과 같다언어구성요소 : 프로그램 언어를 기술하기 위해 필요한 구문상의 구성 요소. 예를 들면 식별자, 명령문, 모듈 등 Wikipedia 의 정의는 다음과 같다A language construct is a syntactically allowable part of a program that may be formed from one or more lexical tokens in accordance with the rules of a programming language.The ter.. 2016. 9. 25.
Maria DB Query 사용법 및 기타 주의 사항 SQL 명령어는 대소문자를 구분하지 않으며, 문장의 마지막에는 세미콜론( ; )으로 마쳐야 한다.SQL 에서 NULL 은 값이 없음을 나타낸다 ● Create database member_db; // member_db 라는 db 생성● Show databases; // db 목록 출력● use db_member; // db_member 선택● create table tb_member(member_id int, member_name varchar(64)); // tb_member 생성● show tables; // table 목록 출력● describe tb_member; // tb_member 테이블 구조 출력● insert into tb_member(member_id, member_name) value.. 2016. 9. 12.
반응형