Describe mariadb database create user and database
This commit is contained in:
		@@ -223,6 +223,30 @@ Clone the repository `script` to your site with:
 | 
			
		||||
 | 
			
		||||
## 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
 | 
			
		||||
 | 
			
		||||
	$ yay -S python-mysql-connector
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user