Changes

Jump to navigation Jump to search

Coral: mysql edit restricted user

7,311 bytes added, 13:40, 12 November 2011
Created page with "<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font..."
<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font-size:12px">'''''Coral'' :'''&nbsp; [[Coral: mysql intro|MySQL]] | [[Coral: mysql change password|Change password]] | [[Coral: mysql restore password|Restore password]] | [[Coral: mysql console|MySQL Console]] | [[Coral: mysql create delete database|Create delete Database]] | [[Coral: mysql create restricted user|Create Restricted User]] | [[Coral: mysql edit restricted user|Edit Restricted User]]</span></div>

{|style="margin-top:5px;"
|-valign="top"
|
<span style="margin-bottom:5px;font-size:25px;color: #31799F;">MySQL Edit Restricted User</span>

There are three methods for editing a restricted user; you can use a command window, phpMyAdmin or UniController. UniController provides a convenient menu option described bellow. To use this option ensure the MySQL server is running otherwise a warning message is produced.


__TOC__

|
{| cellpadding="0" cellspacing="0" style="margin-left:6px;margin-bottom:5px;padding-left:6px;padding-right:6px;font-size:11px;background-color: #FFFFEB;border: 1px solid darkslateblue;"
|-
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral
|-
|&nbsp;||[[Coral: Introduction|Home]]
|-
|&nbsp;||[[Coral: start quick start|Quick Start]]
|-
|&nbsp;||[[Coral: general intro|General]]
|-
|&nbsp;||[[Coral: apache intro|Apache]]
|-
|<span style="font-size: 14px;">ยป</span>||[[Coral: mysql intro|MySQL]]
|-
|&nbsp;||[[Coral: php intro|PHP]]
|-
|&nbsp;||[[Coral: msmtp intro|MSMTP]]
|-
|&nbsp;||[[Coral: cron intro|CRON]]
|-
|&nbsp;||[[Coral: dtdns intro|DtDNS]]
|-
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]
|-
|&nbsp;||[[Coral: perl intro|Perl]]
|-
|&nbsp;||[[Coral: index main|Main Index]]
|}
|}

==Edit Restricted MySQL User using UniController==
<span style="padding:6px;background-color:#99FFFF"> Server Configuration > MySQL > Edit Restricted MySQL User</span>

{|
|-valign="top"
|
'''''Edit Restricted User'''''

* 1) Select user to edit from the list, which populates the upper form
* 3) Enter the old or a new password for the user
* 5) Select or deselect user privileges as required
* 6) Click "Update User" button

'''''Delete Restricted User'''''

* 1) Select user to be deleted from the list.
* 7) Click "Delete" button

Note 1: Cancel (8) and (9) clear both the edit fields and the user selection.
|
[[Image:Coral_mysql_edit_restricted_user.gif]]
|}

'''''[[#top | Top]]'''''
==Edit Restricted MySQL User using phpMyAdmin==

Start UniController and start both servers, then click phpMyAmin button. To edit a restricted user, proceed as follows:

Note: Assume the user '''fred''' has already been created.

{|
|-valign="top"
|
When first started the phpMyAdmin home page is displayed; you can
always return to this page by clicking the home icon (1)

* 1) If not at the home page, click '''home icon'''
* 2) From the top menu bar, select '''Privileges'''
* 3) Under "Action", Click '''Edit Privileges'''

The '''Edit Privileges: User 'fred'@'localhost'''' page is displayed. <br />
From this page you can change the user privileges, the database(s) <br />
the user is assigned to and privileges, password and login information.
|
[[Image:Coral_mysql_eru_phpmyadmin1.gif]]
|}

'''''[[#top | Top]]'''''
==Edit Restricted MySQL User using command window==
Editing an existing user with restricted privileges can be performed using the MySQL Client.

You can use REVOKE to remove some or all privileges or alternatively use GRANT to add additional privileges. This example assumes a user fred has been created with the privileges GRANT SELECT, INSERT, UPDATE, DELETE assigned on database wordpress.
You can revoke (remove) privileges; for example, the following command removes INSERT, UPDATE and DELETE.

* REVOKE INSERT, UPDATE, DELETE ON wordpress.* FROM 'fred'@'localhost' ;

You can grant (add) privileges; for example, the following command adds INSERT and UPDATE.

* GRANT INSERT, UPDATE ON wordpress.* TO 'fred'@'localhost' ;

You can display the grants assigned with the following command:

* SHOW GRANTS FOR 'fred'@'localhost';


Example for the above commands. Click MySQL console, which opens a command window. Then we run the MySQL Client with the following commands:

* mysql -uroot -proot
* SHOW GRANTS FOR 'fred'@'localhost';
* REVOKE INSERT, UPDATE, DELETE ON wordpress.* FROM 'fred'@'localhost' ;
* SHOW GRANTS FOR 'fred'@'localhost';
* GRANT INSERT, UPDATE ON wordpress.* TO 'fred'@'localhost' ;
* SHOW GRANTS FOR 'fred'@'localhost';
* exit

The results are shown below.
<pre>
C:\UniServer\usr\local\mysql\bin>mysql -uroot -proot

mysql> SHOW GRANTS FOR 'fred'@'localhost';
+-------------------------------------------------------------------------------------------------------------+
| Grants for fred@localhost |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'fred'@'localhost' IDENTIFIED BY PASSWORD '*F5F0B28BD93FCF0C77FD96BB97BBC745ED8EA6BC' |
| GRANT SELECT, INSERT, UPDATE, DELETE ON `wordpress`.* TO 'fred'@'localhost' |
+-------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> REVOKE INSERT, UPDATE, DELETE ON wordpress.* FROM 'fred'@'localhost' ;
Query OK, 0 rows affected (0.02 sec)

mysql> SHOW GRANTS FOR 'fred'@'localhost';
+-------------------------------------------------------------------------------------------------------------+
| Grants for fred@localhost |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'fred'@'localhost' IDENTIFIED BY PASSWORD '*F5F0B28BD93FCF0C77FD96BB97BBC745ED8EA6BC' |
| GRANT SELECT ON `wordpress`.* TO 'fred'@'localhost' |
+-------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> GRANT INSERT, UPDATE ON wordpress.* TO 'fred'@'localhost' ;
Query OK, 0 rows affected (0.01 sec)

mysql> SHOW GRANTS FOR 'fred'@'localhost';
+-------------------------------------------------------------------------------------------------------------+
| Grants for fred@localhost |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'fred'@'localhost' IDENTIFIED BY PASSWORD '*F5F0B28BD93FCF0C77FD96BB97BBC745ED8EA6BC' |
| GRANT SELECT, INSERT, UPDATE ON `wordpress`.* TO 'fred'@'localhost' |
+-------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> exit
Bye

</pre>

'''''[[#top | Top]]'''''
[[Related topics]]

[[Coral: mysql console|MySQL Console]]

'''''[[#top | Top]]'''''

----

[[Category: Uniform Server 8-Coral]]

Navigation menu