view_create_and_delete_mysql_users
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| view_create_and_delete_mysql_users [2016/08/03 07:48] – walkeradmin | view_create_and_delete_mysql_users [2016/08/27 18:39] (current) – [To Create a New User with all Privileges and a Password] walkeradmin | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| | | ||
| mysql -u root -pPassword (no space between -p and your password) | mysql -u root -pPassword (no space between -p and your password) | ||
| + | \\ | ||
| + | Once logged in you can do the following: | ||
| + | \\ | ||
| + | \\ | ||
| + | ==== To View Users ==== | ||
| + | | ||
| + | SELECT user, host FROM mysql.user; | ||
| + | \\ | ||
| + | ==== To Create a User ==== | ||
| + | | ||
| + | CREATE USER ' | ||
| + | | ||
| + | Once created, the user requires permissions | ||
| + | | ||
| + | GRANT ALL PRIVILEGES ON * . * TO ' | ||
| + | | ||
| + | If you want to be able to access the server from anywhere, replace localhost with % | ||
| + | | ||
| + | GRANT ALL PRIVILEGES ON * . * TO ' | ||
| + | \\ | ||
| + | ==== To Create a New User with all Privileges and a Password ==== | ||
| + | GRANT ALL PRIVILEGES ON mydb.* TO ' | ||
| + | \\ | ||
| + | ==== To Delete a User ==== | ||
| + | | ||
| + | DROP USER ' | ||
| + | \\ | ||
| \\ | \\ | ||
view_create_and_delete_mysql_users.1470210497.txt.gz · Last modified: (external edit)
