database

  • user notice: The _custom_breadcrumbs_get_breadcrumb() function called token replacement with an array rather than a string for $text in /mnt/webc/60/17/52309417/htdocs/drupal/sites/all/modules/token/token.module on line 263.
  • user notice: The _custom_breadcrumbs_get_breadcrumb() function called token replacement with an array rather than a string for $text in /mnt/webc/60/17/52309417/htdocs/drupal/sites/all/modules/token/token.module on line 263.

MySQL: Change Password

  • Replace {passwd} with the password of the user.
  • Replace {user} with the name of the user.

Change Password

GRANT USAGE ON * . * 
TO '{user}'@'%' 
IDENTIFIED BY '{passwd}' ;

Oracle Errors

ORA-00257: archiver error. Connect internal only, until freed.

MySQL: Remove User

  • Replace {db} with the name of the database.
  • Replace {user} with the name of the user.

Remove User

DROP USER '{user}'@'%';

Remove User and Database

Usually, {user} == {db}

DROP USER '{user}'@'%';
DROP DATABASE '{db}';

MySQL: Create User

  • Replace {db} with the name of the database.
  • Replace {passwd} with the password of the user.
  • Replace {user} with the name of the user.

Create User

CREATE USER '{user}'@'%' IDENTIFIED BY '{passwd}';

Create User and Database

Usually, {user} == {db}

CREATE USER '{user}'@'%' IDENTIFIED BY '{passwd}';
 
GRANT USAGE ON * . * 
TO '{user}'@'%' 
IDENTIFIED BY '{passwd}' 
WITH 
  MAX_QUERIES_PER_HOUR 0 

MySQL: Remove Database

  • Replace {db} with the name of the database.

Remove Database

DROP DATABASE IF EXISTS `{db}`;

MySQL: Create Database

  • Replace {db} with the name of the database.
  • Replace {user} with the name of the user.

Create Database

CREATE DATABASE IF NOT EXISTS `{db}`;

Create Database and Grant Rights to a User

CREATE DATABASE IF NOT EXISTS `{db}`;
GRANT ALL PRIVILEGES ON `{db}` . * TO '{user}'@'%';

MySQL: View Permissions

  • Replace {user} with the name of the user.

View Available Privileges

SHOW PRIVILEGES;

View Permissions

SHOW GRANTS FOR '{user}'@'%';

MySQL: Revoke Permissions

  • Replace {db} with the name of the database.
  • Replace {user} with the name of the user.

Revoke Permissions

REVOKE ALL PRIVILEGES ON `{db}` . * FROM '{user}'@'%';

Example: Revoke all privileges on database web from user andunix.

REVOKE ALL PRIVILEGES ON `web` . * FROM 'andunix'@'%';

MySQL: Grant Permissions

  • Replace {db} with the name of the database.
  • Replace {user} with the name of the user.

Grant Permissions

GRANT ALL PRIVILEGES ON `{db}` . * TO '{user}'@'%';

Example: Grant all privileges on database web to user andunix.

GRANT ALL PRIVILEGES ON `web` . * TO 'andunix'@'%';

Syndicate content