๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ปTech/๐ŸฌMySQL6

MySQL, MariaDB ํ•œ๊ธ€ ๊นจ์ง ํ˜„์ƒ ํ•ด๊ฒฐ(Hive Metastore) Hive์—์„œ desc๋กœ ํ…Œ์ด๋ธ” ์กฐํšŒ ์‹œ ํ•œ๊ธ€ comment๊ฐ€ ๊นจ์ง€๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š”๋ฐ, metastore DB ํ•œ๊ธ€ ์„ค์ •์ด ์•ˆ ๋ผ์„œ ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค. ์•„๋ž˜ ์กฐ์น˜ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. MySQL 1. my.cnf ์ˆ˜์ • my.cnf ํŒŒ์ผ ์—ด์–ด์„œ ์•„๋ž˜๋‚ด์šฉ์—์„œ ์—†๋Š”๊ฒƒ๋“ค์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์„ธ์š”. [root@localhost]$ vi /etc/my.cnf ---------------------------------------------------------- [client] character-sets-dir = utf8 [mysqld] init_connect=SET collation_connection = utf8_general_ci init_connect=SET NAMES utf8 character-set-server = utf8 col.. 2023. 8. 21.
์„œ๋ฒ„ reboot ์ดํ›„ MariaDB ์‹คํ–‰ ์•ˆ๋˜๋Š” ๋ฌธ์ œ ๐Ÿšซ ๋ฌธ์ œ ์›์ธ MariaDB ์„œ๋ฒ„๋ฅผ ์žฌ๊ธฐ๋™ํ•  ๊ฒฝ์šฐ pid ๋””๋ ‰ํ† ๋ฆฌ(/var/run/mariadb/)๋ฅผ ์ƒ์„ฑํ•˜์ง€ ๋ชปํ•ด ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒ $ cat /etc/my.cnf.d/server.cnf -------------------------------------- [server] pid-file=/var/run/mariadb/mariadb.pid -------------------------------------- ๐Ÿ’ก ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• (2๊ฐ€์ง€ ๋ฐฉ๋ฒ•) 1. pid-file ๊ฒฝ๋กœ๋ฅผ ๋ณ„๋„์˜ ๊ฒฝ๋กœ๋กœ (์‚ญ์ œ๋˜์ง€ ์•Š๋Š”) ์ง€์ •ํ•ด ์คŒ $ vi /etc/my.cnf.d/server.cnf ---------------------------------- [server] pid-file=/var/lib/mysql/mariadb.pid ---.. 2021. 9. 3.
[MariaDB] Replication ๊ธฐ๋Šฅ ์ ์šฉ ๋ฐฉ๋ฒ• MariaDB Replication ๊ธฐ๋Šฅ์€ DB ๋ฐ์ดํ„ฐ ๋ฐฑ์—… ์šฉ๋„๋กœ ์‚ฌ์šฉ (์ด์ค‘ํ™”๊ฐ€ ์•„๋‹˜) 1. Master ์„œ๋ฒ„ 1) mariaDB stop & DB ๋ฐฑ์—… $ systemctl stop mariadb $ mysqldump -uroot -p hue > hue.sql 2) server.cnf ์„ค์ • ์ถ”๊ฐ€ vi /etc/my.conf.d/server.cnf ----------------------------- [mysqld] log_bin=mysql-bin server-id=1 ----------------------------- 3) systemctl start mariadb 4) mysql ์ ‘์† ํ›„ ์•„๋ž˜ ๋ช…๋ น์–ด ์‹คํ–‰ > GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.. 2021. 4. 20.
[MariaDB] Specified key was too long; max key length is 767 bytes MariaDB์—์„œ ranger db ์ƒ์„ฑํ•  ๋•Œ๋งˆ๋‹ค ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค... ๊นŒ๋จน์ง€ ์•Š๊ฒŒ ์ ์–ด๋‘ .. ์ดˆ๊ธฐ์— ์„ธํŒ…ํ•ด๋‘๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค. ๐Ÿ’ก ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• my.cnf์— ์•„๋ž˜ ์˜ต์…˜ ์ถ”๊ฐ€ ํ›„ mariaDB ์žฌ๊ธฐ๋™ $ vi /etc/my.cnf [mysqld] ... innodb_file_format = barracuda innodb_large_prefix = on โœ… ์žฌ๊ธฐ๋™ ํ›„ ํ™•์ธ ๋ช…๋ น์–ด MariaDB [(none)]> SHOW VARIABLES LIKE 'innodb_lar%'; +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | innodb_large_prefix | ON | +--------------.. 2020. 2. 3.
[MySQL] dump ๋ฐ import ๋ฐฉ๋ฒ• mysql dump ๋ฐ import ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. โ—พ DB backup (dump) 1. ํ…Œ์ด๋ธ” ๋ฐฑ์—… mysqldump --single-transaction -u user -p'password' DB_NM TABLE_NM > table_nm.sql --single-transaction : ํ•˜๋‚˜์˜ ํŠธ๋žœ์žญ์…˜์œผ๋กœ dump ์ˆ˜ํ–‰ ์šฉ๋Ÿ‰์ด ํฐ ํ…Œ์ด๋ธ” dump ํ•  ๊ฒฝ์šฐ ํ•ด๋‹น ํ…Œ์ด๋ธ” lock ๊ฑธ๋ฆผ, ์ด ์˜ต์…˜์„ ์‚ฌ์šฉํ•ด์ค˜์•ผ DB lock ๊ฑธ๋ฆฌ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. 2. DB ์ „์ฒด ๋ฐฑ์—… mysqldump --single-transaction --all-databases -u user -p'password' > db_nm.sql โ—พ dump sql ํŒŒ์ผ ์ ์šฉ (import) mysql -u user -p'password' DB_NM <.. 2019. 6. 3.
[MySQL] Workbench ๋‹ซ์€ ํƒญ์ด ๊ณ„์†ํ•ด์„œ ์—ด๋ฆฌ๋Š” ํ˜„์ƒ ํ•ด๊ฒฐ Mysql Workbench ์ž‘์—… ์‹œ ํƒญ์„ ๋‹ซ๊ณ  ์žฌ์‹œ์ž‘ํ–ˆ์„ ๋•Œ ๊ณ„์†ํ•ด์„œ ์ด์ „์— ์ž‘์—…ํ•œ ํƒญ์ด ์—ด๋ฆฌ๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š”๋ฐ์š” ์•„๋ž˜ ์„ค์ • ์ ์šฉํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค Edit -> Preferences -> SQL Editor -> Save snapshot of open editors on close (์ฒดํฌ ํ•ด์ œ) 2017. 12. 16.