728x90
반응형
삭제
cd /home
rm /var/lib/mysql/ -R
rm /etc/mysql/ -R
apt-get autoremove -y mysql* --purge
apt-get remove -y apparmor
MySQL 설치
apt install -y libaio1 libncurses5
groupadd mysql
useradd -g mysql mysql
wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.51-linux-glibc2.12-x86_64.tar.gz
tar -xvf mysql-5.6.51-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.6.51-linux-glibc2.12-x86_64 /usr/local/mysql
권한 설정
cd /usr/local/mysql
mkdir /usr/local/mysql/tmp
chown mysql:mysql -R /usr/local/mysql
chown -R root .
chown -R mysql data
chown -R mysql tmp
MySQL 실행
scripts/mysql_install_db --user=mysql
cp support-files/my-default.cnf /etc/my.cnf
bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/init.d/mysql.server
bin/mysqladmin -u root password '[PASSWORD]'
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
/etc/init.d/mysql.server start
/etc/init.d/mysql.server stop
# 혹시 비밀번호 잘못 했다면
update mysql.user set password=password('PASSWORD') where user='root' and host='localhost';
flush privileges;
이후 my.cnf 변경 후에 재시작하여 잘 실행되는지 확인
728x90
반응형
'OS > Ubuntu' 카테고리의 다른 글
Ubuntu 20.04 고정 IP 할당 방법 (0) | 2022.05.16 |
---|---|
[Ubuntu 18] docker 를 이용한 MariaDB Sharding (샤딩) (0) | 2021.01.15 |