* centos 7
> wget --no-check-certificate https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar
> tar xvf mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar
> sudo yum -y localinstall mysql-community-common* mysql-community-libs* mysql-community-client* mysql-community-server-5*
# listen port : 3306
> sudo systemctl start mysqld
# 임시 비밀번호 확인 (JRpdip*S:6a#)
> grep 'temporary password' /var/log/mysqld.log
# root 비밀번호 변경
> mysql -uroot -pJRpdip*S:6a#
mysql> set password = password('Aaaa123$');
# db, user 생성
> create database testdb;
> create user 'user1'@'%' identified by 'user1A!@#';
> grant all privileges on testdb.* to 'user1'@'%';
> flush privileges;
* ubuntu 18.04
# 설치
> sudo apt-get -y install mysql-server
# root 암호 설정
> sudo mysql -u root
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
mysql> exit
# 재시작
> sudo systemctl restart mysql
# root 암호 변경 접속
> mysql -u root -p
root
# db, user 생성
mysql> create database user1;
mysql> create user 'user1'@'%' identified by 'user1';
mysql> grant all privileges on *.* to 'user1'@'%';
mysql> flush privileges;
mysql> exit
# bind-address 설정
> sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
# 재시작
> sudo systemctl restart mysql
'DB' 카테고리의 다른 글
[filebeat] 설치 및 로그 설정 (1) | 2019.10.01 |
---|---|
[redis] 명령어 (0) | 2019.08.02 |
[redis] cluster(shard) 방법 - redis 5 on centos 7 (0) | 2019.07.29 |
[redis] replication(master-slave) 및 sentinel(HA) 설치 테스트 - redis 5 on centos 7 (0) | 2019.07.26 |
[mongodb] shard cluster 구성 (0) | 2019.07.18 |
[mongodb] replica set(cluster) PSS 구성 (0) | 2019.07.17 |
[mongodb] replica set(cluster) PSA 구성 (0) | 2019.07.17 |
[mysql] insert loop 더미 데이터 넣기 (0) | 2019.01.25 |