티스토리 뷰
1. 연결
mysql -u [user id] -p mysql
2. db 생성
create database [database name];
3. table 및 user 생성 및 user 할당
grant all privileges on [database name].* to [user id]@localhost identified by '[password]' with grant option;
4. user 생성 확인
use mysql;
select * from user;
5. 연결
mysql -u [user id] -p [database name]
[root@build-test FlowAgent]# mysql -u root -p mysql Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 38 Server version: 5.6.34 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database test_table; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on test_table.* to test_user@localhost identified by 'testpassword' with grant option; Query OK, 0 rows affected (0.00 sec) mysql> use mysql; Database changed mysql> select * from user; mysql> quit Bye [root@build-test FlowAgent]# mysql -u test_user -p test_table Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 39 Server version: 5.6.34 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> |
'Database > MySQL' 카테고리의 다른 글
[MySQL] open_files_limit를 설정해도 적용안되는 문제 (0) | 2016.12.20 |
---|---|
[MySQL] 원격지 접속 설정 (0) | 2016.12.19 |
[MySQL] password 변경 (0) | 2016.12.19 |
[MySQL] mysql consol 연결 (0) | 2016.12.19 |
[MySQL] error 2006 - MySQL server has gone away (0) | 2016.10.11 |
- Total
- Today
- Yesterday
- noipath
- CentOS
- yum
- ld 옵션
- 물리디스크
- 파티션 추가
- aix compile
- postgresql11
- linux
- CLion
- _status
- CMAKE_OSX_SYSROOT
- physicaldisk
- pf.anchors
- virtualbox
- install
- lvremove
- vgcreate
- update
- centos7
- lvm 늘리기
- Ignoring CMAKE_OSX_SYSROOT value
- aix ld
- pfctl
- fielddata
- 센트6
- firewall-cmd service
- Repository
- mirrorlist
- _stats
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |