MySQL: Difference between revisions

From David's Wiki
Created page with "This page is primarily on the usage of MySQL and MariaDB. In cases where these differ, details are on MariaDB. ==Usage== ===Users=== <syntaxhighlight lang="mysql"> CREATE USE..."
 
Line 5: Line 5:
<syntaxhighlight lang="mysql">
<syntaxhighlight lang="mysql">
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'new_user'@'localhost';
GRANT ALL PRIVILEGES ON * . * TO 'new_user'@'localhost' WITH GRANT OPTION;
</syntaxhighlight>
</syntaxhighlight>
* <code>WITH GRANT OPTION</code> lets the user grant permissions to other users.

Revision as of 22:29, 17 August 2020

This page is primarily on the usage of MySQL and MariaDB. In cases where these differ, details are on MariaDB.

Usage

Users

CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'new_user'@'localhost' WITH GRANT OPTION;
  • WITH GRANT OPTION lets the user grant permissions to other users.