본문 바로가기
[Mysql] 데이터 합계, 내림차순, 오름차순 정렬 등 mysql> select * from pay order by p_cost desc; +------+--------------+---------------+---------------------+----------+----------+--------+------+ | p_no | p_store | p_number | p_time | p_card | p_months | p_cost | p_re | +------+--------------+---------------+---------------------+----------+----------+--------+------+ | 4 | 현대백화점 | 3611264692414 | 2022-05-08 17:12:55 | 신한카드 | 일시불 | 248000 | Y .. 2022. 7. 5.
[Mysql] 데이터 backup Musql + Mariadb [백업] mysqldump -u 사용자명 -p 데이터베이스명 > 경로/데이터베이스명.sql [복구] musql -u 사용자명 -p 데이터베이스명 Program Files>cd MySQL 액세스가 거부되었습니다. C:\>cd "Program Files" C:\Program Files>cd MySQL C:\Program Files\MySQL>cd "MySQL Server 8.0" C:\Program Files\MySQL\MySQL Server 8.0>cd bin C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqldump -u apink -p shop > shop.sql 액세스가 거부되었습니다. C:\Pro.. 2022. 7. 4.
[Mysql] 테이블 생성하기 / select count(*) table 생성 mysql> create table event( -> e_no int(8)not null auto_increment, -> e_id char(200)not null, -> e_pw varchar(250)not null, -> e_hp char(11)not null, -> e_mail char(100) null, -> e_vip char(10) null, -> e_sw enum('window','office','xbox')not null default 'window', -> e_date timestamp not null default current_timestamp, -> e_del datetime null default '0001-01-01 01:00:00', -> primary key(.. 2022. 7. 4.
[MySql] alter table 테이블명 modify 추가할 필드명 text not null; alter table h_member modify h_addr varchar(200); 필드 추가 h_addr 추가했는데, NULL 로 잡혀있다. mysql> update h_member set h_addr=''; mysql> alter table h_member modify h_addr text not null; mysql> alter table h_member modify h_addr text null; 상기 3과정을 통해 아래와 같이 바꾸었다. 2022. 7. 4.
[Mysql] 데이터 수정하기 update [update]-수정date 테이블명 set 필드명 = ‘변경할 값’ where 필드명=’중복되지 않는 값’; update h_member set hcity='03' where hid='hong'; 여러필드를 변경하고 싶을 때 , 로 추가해주기 2022. 7. 4.