Presentation is loading. Please wait.

Presentation is loading. Please wait.

Access Control Stage 1: Connection Verification the three user table scope fields the three user table scope fields Host, User, Password Host, User, Password.

Similar presentations


Presentation on theme: "Access Control Stage 1: Connection Verification the three user table scope fields the three user table scope fields Host, User, Password Host, User, Password."— Presentation transcript:

1

2 Access Control Stage 1: Connection Verification the three user table scope fields the three user table scope fields Host, User, Password Host, User, Password Accept the connection Accept the connection Match your hostname, user name, password Match your hostname, user name, password

3 預設的情況 root 為沒有密碼 你可以為 root 設定密碼 你可以為 root 設定密碼 shell> mysql -u root mysql mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password'); 方法 1: 設定新的 passwd shell> mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD('new_password') -> WHERE user='root'; mysql> FLUSH PRIVILEGES; shell> mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD('new_password') -> WHERE user='root'; mysql> FLUSH PRIVILEGES; 方法 2: 直接對 user Table 下指令 shell> mysqladmin -u root password new_password 方法 3: 利用 mysqladmin command

4 加入新的 user shell> mysql --user=root mysql mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO monty@"%" -> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT RELOAD,PROCESS ON *.* TO admin@localhost; mysql> GRANT USAGE ON *.* TO dummy@localhost; 察看目前的 user mysql> select current_user();

5 為目前的 User 建立 passwd mysql> set password for Jing@localhost=password('BB'); 設定新的 passwd 為 BB 測試一下 C:\Program Files\mysql\bin>mysql -u Jing mysql -p Enter password: ** C:\Program Files\mysql\bin>mysql -u Jing mysql -p Enter password: **


Download ppt "Access Control Stage 1: Connection Verification the three user table scope fields the three user table scope fields Host, User, Password Host, User, Password."

Similar presentations


Ads by Google