Difference between revisions of "MySQL"

Jump to navigation Jump to search
148 bytes added ,  16:38, 5 July 2013
m
(→‎Maintenance: Added "Shrink MyISAM Table")
Line 22: Line 22:
== User Accounts ==
== User Accounts ==
=== Create Users and Grant/Revoke Privileges ===
=== Create Users and Grant/Revoke Privileges ===
After making any changes to user privilages, you need to flush them to ensure they're applied...
<source lang="mysql"> FLUSH PRIVILEGES; </source>
To give full privileges (including the ability to alter user accounts) to a new user coming from any location use;
To give full privileges (including the ability to alter user accounts) to a new user coming from any location use;
<source lang="mysql"> GRANT ALL PRIVILEGES on <database>.* to '<user>'@'%' identified by '<password>' with grant option; </source>
<source lang="mysql"> GRANT ALL PRIVILEGES on <database>.* to '<user>'@'%' identified by '<password>' WITH GRANT OPTION; </source>


To give no privileges to a new user coming from a specific host;
To give no privileges to a new user coming from a specific host;

Navigation menu