tailieunhanh - MySQL /PHP Database Applications Second Edition phần 9

Lệnh này làm cho tất cả các thay đổi cần thiết cho người sử dụng và các bảng db. Phần đầu tiên của báo cáo cấp có thể mất tất cả các đối số (mà phải được theo sau bởi VỚI CẤP nếu nó thực sự cấp tất cả các đặc quyền), hoặc nó có thể thực hiện bất kỳ các tùy chọn được liệt kê trong bảng người sử dụng. | Appendix E MySQL User Administration 603 mysql grant all on guestbook. to jim@localhost identified by pword This command makes all the necessary changes to the user and db tables. The first part of the grant statement can take the argument all which must be followed by WITH GRANT if it s really to grant all privileges or it can take any of the options listed in the user table. Most often you are granting rights to use SQL statements select create alter delete drop index insert and update . The second portion of the grant statement on guestbook in the example identifies where privileges are to be applied universally to a single database to tables or to columns. Table E-1 shows how to indicate where privileges should be applied. Table E-1 setting permissions Identifier grant all on . grant all on database. grant all on grant all col1 col2 on Meaning Rights are universal inserted into the user table Rights apply to all tables in a single database Rights apply to a single table Rights apply only to specific columns in a specific database and table The third portion of the grant statement to jim@localhost in the example indicates the user to be given access. As we mentioned earlier MySQL needs both a name and a host. In the grant statement these are separated by the @ symbol. Finally the identified by portion of the grant statement gives the user a password. Here are a few more examples of grant statements grant select update insert on to alvin@localhost identified by pword The preceding statement allows alvin to view update and insert records into the table guestbook in database guestbook2k. grant select update name url on to chipmunk@localhost identified by pword 604 Part V Appendixes With the preceding statement the user can view and update only two columns name and url . No deletes or inserts are allowed. grant all on . to josh@localhost identified by pword WITH GRANT OPTION The .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.