From 8491309c9d19379a9bcd1696e818e901be624c20 Mon Sep 17 00:00:00 2001 From: oleg20111511 Date: Fri, 6 May 2022 00:50:43 +0300 Subject: [PATCH] Add linux notes --- linux/linux_general.txt | 2 ++ linux/linux_users.txt | 6 ++++++ linux/mysql_commands.txt | 18 ++++++++++++++++++ linux/postgres_commands.txt | 17 +++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100755 linux/linux_general.txt create mode 100755 linux/linux_users.txt create mode 100755 linux/mysql_commands.txt create mode 100755 linux/postgres_commands.txt diff --git a/linux/linux_general.txt b/linux/linux_general.txt new file mode 100755 index 0000000..abc9043 --- /dev/null +++ b/linux/linux_general.txt @@ -0,0 +1,2 @@ +wifi: +https://raspberrypi.stackexchange.com/questions/109425/ubuntu-server-18-wifi-hotspot-setup diff --git a/linux/linux_users.txt b/linux/linux_users.txt new file mode 100755 index 0000000..63a9845 --- /dev/null +++ b/linux/linux_users.txt @@ -0,0 +1,6 @@ +adduser oleg20111511 +sudo usermod -a -G sudo oleg20111511 + +ssh-copy-id + +chgrp oleg20111511 /var/www diff --git a/linux/mysql_commands.txt b/linux/mysql_commands.txt new file mode 100755 index 0000000..ffc244e --- /dev/null +++ b/linux/mysql_commands.txt @@ -0,0 +1,18 @@ +install: +sudo apt install mysql-server +sudo apt install libmysqlclient-dev + +user creation: +CREATE USER 'socialstore' IDENTIFIED BY 'socialstorepassword'; +SELECT user FROM mysql.user; + +database creation: +CREATE DATABASE StoreDatabase; +GRANT ALL PRIVILEGES ON StoreDatabase.* TO socialstore; + +database management: +USE StoreDatabase; +SHOW TABLES; + +installation: + diff --git a/linux/postgres_commands.txt b/linux/postgres_commands.txt new file mode 100755 index 0000000..1e289a8 --- /dev/null +++ b/linux/postgres_commands.txt @@ -0,0 +1,17 @@ +Start: +su postgres +psql + +Show databases: +\l + +Switch to database: +\c [name] + +Show tables +\dt + +Create new database and user: +create database mydb; +create user myuser with encrypted password 'mypass'; +grant all privileges on database mydb to myuser;