Download presentation
Presentation is loading. Please wait.
Published byDennis Long Modified over 9 years ago
1
CSC 411/511: DBMS Design Dr. Nan Wang 1 Database Administration
2
Dr. Nan Wang 2 Account Management Statements Create user –CREATE USER user [IDENTIFIED BY [PASSWORD] 'password'] [, user [IDENTIFIED BY [PASSWORD] 'password']]… Drop user –DROP USER user [, user]... Grant Rename user –RENAME USER old_user TO new_user [, old_user TO new_user]... Revoke Set password –SET PASSWORD [FOR user] = { PASSWORD('some password') | OLD_PASSWORD('some password') | 'encrypted password' }
3
Dr. Nan Wang Grant- give privileges on an object to a user 3
4
Dr. Nan Wang examples 4
5
Dr. Nan Wang Revoke-remove privileges on an object from a user 5 GRANT OPTION FOR option revokes the ability of the identified users to grant the specified privilege(s) to other users
6
Dr. Nan Wang PUBLIC- grant a privilege to all users 6
7
Dr. Nan Wang ROLE/GROUP create a role that represents a type of database user and assign privileges to that role. CREATE ROLE [WITH ADMIN OPTION] 7
8
Dr. Nan Wang Revoke 8 DROP ROLE
9
Dr. Nan Wang Practise 9
10
Dr. Nan Wang MySQL Administrator 10
11
Dr. Nan Wang User Account 11
12
Dr. Nan Wang Connecting to and Disconnecting from the Server shell>mysql -h host -u user -p mysql> QUIT MySQL Server: –Mysqld: mysql server –Mysqld_safe: mysql server startup script –Mysql.server: mysql server startup script –Mysqld_multi: manage multiple mysql servers –http://dev.mysql.com/doc/refman/5.1/en/programs- server.html 12
13
Dr. Nan Wang Server information 13
14
Dr. Nan Wang Server Control 14
15
Dr. Nan Wang Server Control 15
16
Dr. Nan Wang Backup SELECT * INTO OUTFILE 'file_name' FROM tbl_name. mysqldump --tab=/path/to/some/dir --opt db_name mysqlhotcopy db_name /path/to/some/dir 16
17
Dr. Nan Wang Backup 17
18
Dr. Nan Wang Restore 18
19
Dr. Nan Wang Using mysql in Batch Mode shell> mysql < batch-file C:\> mysql -e "source batch-file" shell> mysql -h host -u user -p < batch-file Enter password: ******** shell> mysql mysql.out mysql> source filename mysql> \. filename 19
20
Dr. Nan Wang Load data LOAD DATA INFILE '/tmp/test.txt' INTO TABLE test FIELDS TERMINATED BY ',' LINES STARTING BY ‘\n\r'; 20
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.