centos 에서 mysql 설치
마스터욱
0
41
0
0
2020-08-28 05:06:37
# yum -y install http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
# yum -y install mysql-community-server
# systemctl start mysqld
# systemctl enable mysqld
자동 생성된 비밀번호는 /var/log/mysqld.log 에서 확인 가능
[Note] A temporary password is generated for root@localhost: TSSyLNATu4-M
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'TSSyLNATu4-M';
mysql> FLUSH PRIVILEGES
mysql> use mysql
mysql> SET GLOBAL validate_password_policy=LOW;
mysql> UPDATE user set authentication_string=password('새로운비밀번호') where user='root';
[root@ip-172-31-17-24 ~]# service mysqld stop
[root@ip-172-31-17-24 ~]# service mysqld start
################ mysql utf 설정
# vi /etc/my.cnf
[client]
default-character-set = utf8
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
character-set-client-handshake = FALSE
skip-character-set-client-handshake
[mysqldump]
default-character-set=utf8
# systemctl restart mysqld