MySQL

    [MySQL] SELECT๋ฌธ ํ˜•์‹ | ์ž‘์„ฑ ์ˆœ์„œ

    SELECT select_expr [FROM table_references] [WHERE where_condition] [GROUP BY {col_name | expr | position}] [HAVING where_condition] [ORDER BY {col_name | expr | position}]

    [MySQL] ์ž๋ฃŒํ˜•

    ์ˆซ์ž INT: ์ •์ˆ˜ํ˜• ์ž๋ฃŒํ˜• FLOAT: ์†Œ์ˆ˜ํ˜• ์ž๋ฃŒํ˜• ๋ฌธ์ž์—ด CHAR(): ๊ณ ์ • ๊ธธ์ด ๋ฌธ์ž์—ด. ์ง€์ •ํ•œ ๊ธธ์ด๋ณด๋‹ค ์งง๊ฒŒ ์ž…๋ ฅํ•˜๋ฉด ๋‚˜๋จธ์ง€ ๊ณต๊ฐ„์€ ๊ณต๋ฐฑ์œผ๋กœ ๋‚จ๋Š”๋‹ค. VARCHAR(): ๊ฐ€๋ณ€ ๊ธธ์ด ๋ฌธ์ž์—ด. ์ง€์ •ํ•œ ๊ธธ์ด๋ณด๋‹ค ์งง๊ฒŒ ์ž…๋ ฅํ•˜๋ฉด ๋‚˜๋จธ์ง€ ๊ณต๊ฐ„์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค. TEXT: ์ฃผ๋กœ URL, ๊ฒŒ์‹œ๊ธ€ ๋“ฑ ๊ธด ๋ฌธ์ž์—ด์„ ์ €์žฅํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค. ๋‚ ์งœ ๋ฐ ์‹œ๊ฐ„ TIMESTAMP: YYYY-MM-DD HH:MM:SS ํ˜•ํƒœ๋กœ ๋‚ ์งœ์™€ ์‹œ๊ฐ„์„ ํ‘œ์‹œํ•œ๋‹ค. DATETIME: TIMESTAMP์™€ ๊ฐ™์ด ๋‚ ์งœ์™€ ์‹œ๊ฐ„์„ ํ‘œ์‹œํ•˜๋ฉฐ 1001๋…„ - 9999๋…„์˜ ๋” ๋„“์€ ๋ฒ”์œ„์˜ ์‹œ๊ฐ„์„ ๋‚˜ํƒ€๋‚ธ๋‹ค.

    [MySQL] ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •ํ•˜๊ธฐ

    alter user 'root'@'localhost' identified with mysql_native_password by '์„ค์ •ํ•˜๊ณ ์‹ถ์€๋น„๋ฐ€๋ฒˆํ˜ธ'; ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ • ํ›„ ๋ณ€๊ฒฝ๋œ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ํ†ตํ•ด root ๊ณ„์ •์œผ๋กœ ์ ‘์†ํ•  ์ˆ˜ ์žˆ๋‹ค. * ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์ƒ๊ธธ ๊ฒฝ์šฐ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์ €์žฅํ•ด์ฃผ์–ด์•ผํ•œ๋‹ค. flush privileges;