# apt install mariadb-server mariadb-client -y

 

# mysql_secure_installation

 

# echo "" >> /etc/mysql/mariadb.cnf

# echo "[mysqld]" >> /etc/mysql/mariadb.cnf

# echo "max_allowed_packet = 1G" >> /etc/mysql/mariadb.cnf

# echo "" >> /etc/mysql/mariadb.cnf

# echo "[mysqldump]" >> /etc/mysql/mariadb.cnf

# echo "quick" >> /etc/mysql/mariadb.cnf

# echo "max_allowed_packet = 2G" >> /etc/mysql/mariadb.cnf


MariaDB [(none)]> create database board;
MariaDB [(none)]> create user board identified by 'board';
MariaDB [(none)]> grant all privileges on board.* to board;
MariaDB [(none)]> grant process on *.* TO board;
MariaDB [(none)]> flush privileges;

MariaDB [(none)]> show grants for board;

 

백업

# mysqldump -u board -p board --hex-blob > yyyymmdd.sql

--hex-blob 옵션은 Blob타입까지 안전하게 백업받기 위한 것.

 

복구
# mysql -u board -p board < yyyymmdd.sql

#### mysql에서 덤프받은 경우
sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g' board20230227.sql

Posted by jtfafa
,