Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- Simple Json
- ElasticSearch
- kibana
- mysql8버전 설치 #mysql8 tar설치
- major version 61
- csv파일
- map return
- 제이쿼리
- Gradle
- 스케줄 중복실행
- 파일 쓰기
- 가상머신
- jQeury
- json
- vo리턴
- ubunt mysql8
- spring
- Ajax
- 원하는 Mysql 버전 설치
- 스케줄 2번실행
- json 접근
- map리턴
- @ResponseBody
- csv
- context-quartz.xml
- 엘라스틱서치
- 카프카 #Kafka
- server.xml
- 파일 읽기
- JSONView
Archives
- Today
- Total
streetprogrammer
CentOS에서 원하는 MYSQL 버전 설치 본문
[1] MYSQL user 생성
$ groupadd mysql
$ useradd -r -g mysql -s /bin/false mysql
-r : 0~500 사이의 GID설정
-g : 그룹을 지정할 때 사용하는데, 지정할 그룹이 미리 생성되어 있어야 한다.
-s : 사용자 쉘을 지정하여 생성
[2] MYSQL 파일 다운로드 및 설치
URL : https://downloads.mysql.com/archives/community/
*원하는 mysql버전과 OS를 맞춰줍니다. CentOS이므로 Red Hat 계열로 선택
*설치서버의 경우 CentOS 7버전에 MYSQL 8.0.28 버전 설치 -> RedHat Linux7 / Oracle Linux 7 ( x86, 64-bit )
yum update
wget https://https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
tar -xvf mysql-8.0.28-1.el7.x86_64.rpm-bundle.tar
yum localinstall mysql-community-*
* yum을 사용하면 의존성 설치가 자동으로 진행되므로, 명령어를 통해 쉽게 처리합니다.
[error : GPG Key 만료]
[root@localhost ~]# yum install http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
[root@localhost ~]# yum install mysql-community-server
The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Failing package is: mysql-community-server-5.7.37-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
해결 : rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
[3] 구동하기
sudo systemctl start mysqld
sudo systemctl status mysqld
[4] 초기비밀번호 확인
cat /var/log/mysqld.log | grep "temporary password"
[5] 접속하기
mysql -u root
이떄, 초기 비밀번호 사용
[6] root비밀번호 변경
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '*******';
mysql> set global validate_password.policy=LOW;
* 비밀번호 보안 수준 낮게 하려면 : set global validate_password.policy=LOW; 사용
[7] DB생성
CREATE DATABASE ***_db_name default CHARACTER SET UTF8;
[8] 권한 부여
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> create user 'test'@'%' identified by '*****';
Query OK, 0 rows affected (0.05 sec)
Database changed
mysql> select host, user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | test |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
5 rows in set (0.00 sec)
mysql> create user 'root'@'%' identified by '*****';
Query OK, 0 rows affected (0.05 sec)
mysql> grant all privileges on *.* to 'test'@'%';
Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to 'root'@'%';
Query OK, 0 rows affected (0.04 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> select host, user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| % | test |
| % | root |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+------------------+
6 rows in set (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.08 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.12 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)
'DATABASE' 카테고리의 다른 글
마리아DB 바이너리 설치 (1) | 2022.12.19 |
---|---|
ubuntu에서 MYSQL8.0 버전 설치(이중설치-CMAKE) (1) | 2022.10.18 |
Comments