
os: ubuntu 22.04.3 LTS
1. MySQL 설치
sudo apt update
sudo apt install mysql-server
👉 MySQL 상태 확인
sudo systemctl status mysql
2. 계정 생성
1. root 접속
sudo mysql -u root
2. use mysql
use mysql
3. 계정 생성
create user 'test'@'%' identified by 'test1234';
- test: 사용자이름 (username)
- test1234: 비밀번호 (password)
4. 권한 부여
grant all privileges on test_db.* to 'test'@'%';
- test_db: 데이터베이스명 (database)
- test: 사용자이름 (username)
5. 생성한 계정 확인하는 방법
SELECT user, host, authentication_string, plugin FROM mysql.user;
300x250