MySQL: Difference between revisions
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..." |
|||
(2 intermediate revisions by the same user not shown) | |||
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. | |||
==Docker== | |||
I suggest using the [https://hub.docker.com/_/mariadb docker mariadb container].<br> | |||
It is also available on [https://gallery.ecr.aws/docker/library/mariadb AWS ECR Public Gallery]. | |||
===Upgrades=== | |||
To upgrade the container, set the environment variable <code>MARIADB_AUTO_UPGRADE=1</code> and bump the version number.<br> |
Latest revision as of 18:21, 14 December 2022
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.
Docker
I suggest using the docker mariadb container.
It is also available on AWS ECR Public Gallery.
Upgrades
To upgrade the container, set the environment variable MARIADB_AUTO_UPGRADE=1
and bump the version number.