Mysql 설치 on CentOS7
Mysql 설치 on CentOS7
IT
yum install mysql80-community-release-el7-5.noarch.rpm
# yum repolist enabled | grep "mysql.*-community.*"
Failed to set locale, defaulting to C
mysql-connectors-community/x86_64 MySQL Connectors Community 230
mysql-tools-community/x86_64 MySQL Tools Community 138
mysql57-community/x86_64 MySQL 5.7 Community Server 564
# yum install mysql-community-server
# mysqld -V
mysqld Ver 5.7.37 for Linux on x86_64 (MySQL Community Server (GPL))
# systemctl start mysqld
# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2022-04-10 09:58:01 KST; 7s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 74707 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 74690 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 74710 (mysqld)
CGroup: /system.slice/mysqld.service
└─74710 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
Apr 10 09:58:01 systemd[1]: Starting MySQL Server...
Apr 10 09:58:01 systemd[1]: Started MySQL Server.
nano /etc/my.cnf 를 열고 아래 문장 추가
[mysqld]
skip-grant-tables
열린다.
FLUSH PRIVILEGES; 로 권한 제거하고.
ALTER USER 'root'@'localhost' IDENTIFIED BY '<PASSWORD>';
하니 변경 된다.
5
Leave a Comment: