Describe mariadb database create user and database
This commit is contained in:
parent
3f223b399e
commit
1ce2f886e1
@ -223,6 +223,30 @@ Clone the repository `script` to your site with:
|
|||||||
|
|
||||||
## Connecting to MariaDB database
|
## Connecting to MariaDB database
|
||||||
|
|
||||||
|
### Install mariadb database
|
||||||
|
|
||||||
|
$ yay -S mariadb
|
||||||
|
|
||||||
|
Configure the database with e.g.
|
||||||
|
|
||||||
|
$ sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
|
||||||
|
|
||||||
|
Enable and start the database service with:
|
||||||
|
|
||||||
|
$ sudo systemctrl enable mariadb.service
|
||||||
|
$ sudo systemctrl start mariadb.service
|
||||||
|
|
||||||
|
#### Create a user "om" who has only access to the database table
|
||||||
|
|
||||||
|
# mariadb
|
||||||
|
|
||||||
|
CREATE DATABASE callbook;
|
||||||
|
|
||||||
|
GRANT ALL PRIVILEGES ON callbook.* TO 'om'@'localhost' IDENTIFIED BY 'oe3tkt';
|
||||||
|
|
||||||
|
FLUSH PRIVILEGES;
|
||||||
|
QUIT;
|
||||||
|
|
||||||
## Install python-mariadb
|
## Install python-mariadb
|
||||||
|
|
||||||
$ yay -S python-mysql-connector
|
$ yay -S python-mysql-connector
|
||||||
|
Loading…
Reference in New Issue
Block a user