#1. 우분투에서 mysql 삭제 및 재설치
------------------------------------------------------------------------------
1)apt-get purge mysql-server
2)apt-get purge mysql-common
3)rm -rf /var/log/mysql
rm -rf /var/log/mysql.*
rm -rf /var/lib/mysql
rm -rf /etc/mysql
4)apt-get install mysql-server --fix-mssing --fix-broken
질문 : 대문자 Y 엔터
------------------------------------------------------------------------------
##>mysql -uroot -p
비밀번호입력
mysql>show databases;
mysql>use mysql;
mysql>select host, user, authentication_string from user;
mysql>create user '사용자아이디'@localhost identified by '비밀번호';
mysql>create user '사용자아이디'@'%' identified by '비밀번호';
mysql>grant all privileges on *.* to '사용자아이디'@'localhost' identified by '비밀번호';
mysql>show grants for '사용자아이디'@'localhost';
mysql>grant all privileges on *.* to '사용자아이디'@'%' identified by '비밀번호';
mysql>show grants for '사용자아이디'@'%';
mysql>exit
------------------------------------------------------------------------------
##>cd /etc/mysql/mysql.conf.d
##>vi mysqld.conf
--> bind address : 127.0.0.1 --> #으로 주석처리할 것
##>sudo ufw allow out 3306/tcp
##>sudo ufw allow in 3306/tcp
##>sudo /etc/init.d/mysql restart