데이터베이스 사용자 계정으로 로그인, 계정 분실 시 사용자 계정으로 로그인후 검색, 계정 생성, 계정 삭제
모든 사용자 확인
1 SQL > SELECT Host, User FROM mysql.user; cs
1 | SQL > SELECT Host, User FROM mysql.user; | cs |
데이터베이스 사용자 계정으로 로그인
1 2 3 4 5 | c:/ > sqlplus "/as sysdba" SQL > show user SQL > select * from all_users; | cs |
mysql 인스톨 후 root사용자의 임시비밀번호 발급 및 비밀번호 변경
Securing MySQL
When the MySQL server is started for the first time, a temporary password is generated for the MySQL root user. You can find the password by running the following command:
sudo grep 'temporary password' /var/log/mysqld.logThe output should look something like this:
2018-05-23T10:59:51.251159Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: q&0)V!?fjksLMake note of the password, because the next command will ask you to enter the temporary root password.
Run the mysql_secure_installation command to improve the security of our MySQL installation:
sudo mysql_secure_installationSecuring the MySQL server deployment.
Enter password for user root:After entering the temporary password you will be asked to set a new password for user root. The password needs to be at least 8-characters long and to contain at least one uppercase letter, one lowercase letter, one number, and one special character.
The existing password for the user account root has expired. Please set a new password.
New password:
Re-enter new password:The script will also ask you to remove the anonymous user, restrict root user access to the local machine and remove the test database. You should answer “Y” (yes) to all questions.
계정 분실 시 사용자 계정으로 로그인
sqlplus "/as sysdba" 로 로그인 하는경우에는 system 계정 패스워드 파일을 사용하거나 OS 인증을 사용한다.
OS 인증의 경우에는 윈도우에서 ORA_DBA 그룹, 유닉스에서 dba 그룹인 경우 오라클이 설치된 컴에 administrator로 접속한 다음
1 2 3 4 5 6 7 | C:\>sqlplus /nolog SQL > conn /as sysdba - sys 로 로그인 한 경우와 같기 때문에 System계정의 암호를 변경 할 수 있다. SQL > alter user system identified by NEW_PASSWORD; - system의 새로운 비번 설정 SQL > alter user sys identified by NEW_PASSWORD; - sys의 새로운 비번 설정 | cs |
*sys와 system 관리자의 차이
1. SYS
DBMS의 데이터 딕셔너리 소유자, 오라클 데이터베이스 관리자(SUPER USER)
디폴트 패스워드 : change_on_install(8i 이전버전)
DB생성 가능
2. SYSTEM
SQL*FORMS등 툴을 위한 데이터딕셔너리 소유자
디폴트 패스워드 : manager(8i 이전버전)
권한은 SYS와 같으나 DB생성 권한은 없음
3. scott
샘플 사용자 계정
디폴트 패스워드: tiger
계정 생성(계정생성은 시스템관리자 로그인 후 가능하다)
1 | SQL > CREATE USER valuefactory identified by 1234; -패스워드 변경도 가능 | cs |
http://valuefactory.tistory.com/287?category=777823에서 계정생성시 권한부여에 대한 자세한 내용참고
권한부여
1 | SQL>grant connect, resource to valuefactory; | cs |
http://jihwan4862.tistory.com/78 에서 권한 부여에 대한 자세한 내용 참고
계정 삭제
1 | SQL > drop user valuefactory cascade; | cs |