«   2019/12   »
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        
Archives
Today
9
Total
1,235,464
안정적인 DNS서비스 DNSEver
관리 메뉴

Blue Breeze

mysql set user password 본문

DB&NoSQL/MySQL\MariaDB

mysql set user password

푸른바람 C/H 2019. 11. 13. 09:41

DB 추가

CREATE DATABASE database_name default CHARACTER SET UTF8mb4;

사용자 추가

// GRANT ALL PRIVILEGES ON database_name.* TO user_name@hostname IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON dbname.* TO username@localhost IDENTIFIED BY 'password';

// INSERT INTO mysql.user (host, user, password) VALUES ('hostname', 'username', password('password'));
// insert into 를 사용하기 위해서는 null을 허용하지 않는 필드를 모두 구성해야 합니다.

호스트 추가

GRANT ALL PRIVILEGES ON database_name.* TO 'root'@'xxx.xxx.xxx.%';

비밀번호 변경

mysql> SET PASSWORD FOR 'user'@'localhost' = PASSWORD('password')
[2019-11-12 18:15:42] [HY000][1287] 'SET PASSWORD FOR <user> = PASSWORD('<plaintext_password>')' is deprecated and will be removed in a future release. Please use SET PASSWORD FOR <user> = '<plaintext_password>' instead
[2019-11-12 18:15:42] completed in 40 ms
mysql> set password for 'user'@'localhost' = 'password'
[2019-11-12 18:16:13] completed in 24 ms
0 Comments
댓글쓰기 폼