summarization on error of OS, script and program language
I) OS as Linux summaries or erroLogs
1.1) difference between cd /usr/bin, || and cd /usr, cd /bin
1.1.1) if we are at / directory, we need to enter to /usr/bin, then we should chenge route one time
- sample one:
[root@iZ2vc5lqzt23aweti4j777Z ~]# pwd
/root
[root@iZ2vc5lqzt23aweti4j777Z ~]# cd /
[root@iZ2vc5lqzt23aweti4j777Z /]# pwd
/
[root@iZ2vc5lqzt23aweti4j777Z /]# ls -l
total 64
lrwxrwxrwx. 1 root root 7 Feb 9 2022 bin -> usr/bin
dr-xr-xr-x. 5 root root 4096 Dec 19 12:08 boot
drwxr-xr-x 17 root root 3000 Jan 12 10:17 dev
drwxr-xr-x. 102 root root 12288 Jan 12 10:17 etc
drwxr-xr-x. 2 root root 4096 Feb 9 2022 home
lrwxrwxrwx. 1 root root 7 Feb 9 2022 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Feb 9 2022 lib64 -> usr/lib64
drwx------. 2 root root 16384 Oct 11 11:31 lost+found
drwxr-xr-x. 2 root root 4096 Feb 9 2022 media
drwxr-xr-x. 2 root root 4096 Feb 9 2022 mnt
drwxr-xr-x. 3 root root 4096 Dec 21 14:14 opt
dr-xr-xr-x 198 root root 0 Jan 12 10:17 proc
dr-xr-x---. 11 root root 4096 Jan 12 14:49 root
drwxr-xr-x 31 root root 940 Jan 12 10:17 run
lrwxrwxrwx. 1 root root 8 Feb 9 2022 sbin -> usr/sbin
drwxr-xr-x. 2 root root 4096 Feb 9 2022 srv
dr-xr-xr-x 13 root root 0 Jan 12 10:17 sys
drwxrwxrwt 11 root root 260 Jan 12 14:14 tmp
drwxr-xr-x. 12 root root 4096 Oct 11 11:32 usr
drwxr-xr-x. 22 root root 4096 Dec 19 14:22 var
[root@iZ2vc5lqzt23aweti4j777Z /]# cd /usr/bin
[root@iZ2vc5lqzt23aweti4j777Z bin]# pwd
/usr/bin
1.1.2) if we change directory twice, one by one, then we will jump back to the first bin directory.
- sample two:
[root@iZ2vc5lqzt23aweti4j777Z bin]# cd /
[root@iZ2vc5lqzt23aweti4j777Z /]# ll
total 64
lrwxrwxrwx. 1 root root 7 Feb 9 2022 bin -> usr/bin
dr-xr-xr-x. 5 root root 4096 Dec 19 12:08 boot
drwxr-xr-x 17 root root 3000 Jan 12 10:17 dev
drwxr-xr-x. 102 root root 12288 Jan 12 10:17 etc
drwxr-xr-x. 2 root root 4096 Feb 9 2022 home
lrwxrwxrwx. 1 root root 7 Feb 9 2022 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Feb 9 2022 lib64 -> usr/lib64
drwx------. 2 root root 16384 Oct 11 11:31 lost+found
drwxr-xr-x. 2 root root 4096 Feb 9 2022 media
drwxr-xr-x. 2 root root 4096 Feb 9 2022 mnt
drwxr-xr-x. 3 root root 4096 Dec 21 14:14 opt
dr-xr-xr-x 198 root root 0 Jan 12 10:17 proc
dr-xr-x---. 11 root root 4096 Jan 12 14:49 root
drwxr-xr-x 31 root root 940 Jan 12 10:17 run
lrwxrwxrwx. 1 root root 8 Feb 9 2022 sbin -> usr/sbin
drwxr-xr-x. 2 root root 4096 Feb 9 2022 srv
dr-xr-xr-x 13 root root 0 Jan 12 10:17 sys
drwxrwxrwt 11 root root 260 Jan 12 14:14 tmp
drwxr-xr-x. 12 root root 4096 Oct 11 11:32 usr
drwxr-xr-x. 22 root root 4096 Dec 19 14:22 var
[root@iZ2vc5lqzt23aweti4j777Z /]# cd usr
[root@iZ2vc5lqzt23aweti4j777Z usr]# ll
total 128
dr-xr-xr-x. 2 root root 36864 Dec 22 14:48 bin
drwxr-xr-x. 2 root root 4096 Feb 9 2022 games
drwxr-xr-x. 54 root root 4096 Dec 22 14:48 include
dr-xr-xr-x. 35 root root 4096 Dec 22 14:48 lib
dr-xr-xr-x. 57 root root 36864 Dec 22 14:48 lib64
drwxr-xr-x. 29 root root 4096 Dec 21 14:20 libexec
drwxr-xr-x. 13 root root 4096 Dec 19 12:07 local
dr-xr-xr-x. 2 root root 20480 Dec 21 14:15 sbin
drwxr-xr-x. 103 root root 4096 Dec 22 14:48 share
drwxr-xr-x. 5 root root 4096 Dec 19 14:22 src
lrwxrwxrwx. 1 root root 10 Feb 9 2022 tmp -> ../var/tmp
[root@iZ2vc5lqzt23aweti4j777Z usr]# cd / bin
-bash: cd: too many arguments
[root@iZ2vc5lqzt23aweti4j777Z usr]# cd /bin
[root@iZ2vc5lqzt23aweti4j777Z bin]# pwd
/bin
1.2) 误写标点
user,逗号name 改为 user.顿号name
change user,name to user.name
ps: we should change from comma to dot
II) Mysql
2.1) sequence of SQL Operation: Start->log on -> operate Mysql
Welcome to Alibaba Cloud Elastic Compute Service !
Last login: Wed Jan 17 08:51:34 2024 from 47.96.60.217
[root@iZ2vc5lqzt23aweti4j777Z ~]# sudo systemctl start mysqld.service
[root@iZ2vc5lqzt23aweti4j777Z ~]# systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2024-01-17 08:51:47 CST; 11s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 18311 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 18266 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 18313 (mysqld)
Tasks: 27 (limit: 11861)
Memory: 205.3M
CGroup: /system.slice/mysqld.service
└─18313 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
Jan 17 08:51:46 iZ2vc5lqzt23aweti4j777Z systemd[1]: Starting MySQL Server...
Jan 17 08:51:47 iZ2vc5lqzt23aweti4j777Z systemd[1]: Started MySQL Server.
[root@iZ2vc5lqzt23aweti4j777Z ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.44 MySQL Community Server (GPL)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| RECOVER_YOUR_DATA |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql>
2.2) before creation of table, we should use which database we need.
mysql> create table Users(
-> id int primary key auto_increment,
-> email varchar(255) not null unique,
-> bio text,
-> country varchar(2)
-> );
ERROR 1046 (3D000): No database selected
mysql> use airbnb;
Database changed
2.3) Between : include the left value, yet not include the right value except the words with many letters
SELECT * FROM Customers WHERE CustomerName BETWEEN 'a' AND 'C';
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo Emparedados y helados Ana Trujillo Avda. de la Constitución 2222 México D.F. 05021 Mexico
3 Antonio Moreno Taquería Antonio Moreno Mataderos 2312 México D.F. 05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina Berglund Berguvsvägen 8 Luleå S-958 22 Sweden
6 Blauer See Delikatessen Hanna Moos Forsterstr. 57 Mannheim 68306 Germany
7 Blondel père et fils Frédérique Citeaux 24, place Kléber Strasbourg 67000 France
8 Bólido Comidas preparadas Martín Sommer C/ Araquil, 67 Madrid 28023 Spain
9 Bon app' Laurence Lebihans 12, rue des Bouchers Marseille 13008 France
10 Bottom-Dollar Marketse Elizabeth Lincoln 23 Tsawassen Blvd. Tsawassen T2F 8M4 Canada
11 B's Beverages Victoria Ashworth Fauntleroy Circus London EC2 5NT UK
SELECT * FROM Customers;
CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo Emparedados y helados Ana Trujillo Avda. de la Constitución 2222 México D.F. 05021 Mexico
3 Antonio Moreno Taquería Antonio Moreno Mataderos 2312 México D.F. 05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina Berglund Berguvsvägen 8 Luleå S-958 22 Sweden
6 Blauer See Delikatessen Hanna Moos Forsterstr. 57 Mannheim 68306 Germany
7 Blondel père et fils Frédérique Citeaux 24, place Kléber Strasbourg 67000 France
8 Bólido Comidas preparadas Martín Sommer C/ Araquil, 67 Madrid 28023 Spain
9 Bon app' Laurence Lebihans 12, rue des Bouchers Marseille 13008 France
10 Bottom-Dollar Marketse Elizabeth Lincoln 23 Tsawassen Blvd. Tsawassen T2F 8M4 Canada
11 B's Beverages Victoria Ashworth Fauntleroy Circus London EC2 5NT UK
SELECT * FROM Products WHERE ProductName BETWEEN 'Geitost' AND 'Pavlova';
ProductID ProductName SupplierID CategoryID Unit Price
6 Grandma's Boysenberry Spread 3 2 12 - 8 oz jars 25.00
8 Northwoods Cranberry Sauce 3 2 12 - 12 oz jars 40.00
9 Mishi Kobe Niku 4 6 18 - 500 g pkgs. 97.00
10 Ikura 4 8 12 - 200 ml jars 31.00
13 Konbu 6 8 2 kg box 6.00
15 Genen Shouyu 6 2 24 - 250 ml bottles 15.50
16 Pavlova 7 3 32 - 500 g boxes 17.45
22 Gustaf's Knäckebröd 9 5 24 - 500 g pkgs. 21.00
24 Guaraná Fantástica 10 1 12 - 355 ml cans 4.50
25 NuNuCa Nuß-Nougat-Creme 11 3 20 - 450 g glasses 14.00
26 Gumbär Gummibärchen 11 3 100 - 250 g bags 31.23
30 Nord-Ost Matjeshering 13 8 10 - 200 g glasses 25.89
31 Gorgonzola Telino 14 4 12 - 100 g pkgs 12.50
32 Mascarpone Fabioli 14 4 24 - 200 g pkgs. 32.00
33 Geitost 15 4 500 g 2.50
36 Inlagd Sill 17 8 24 - 250 g jars 19.00
37 Gravad lax 17 8 12 - 500 g pkgs. 26.00
41 Jack's New England Clam Chowder 19 8 12 - 12 oz cans 9.65
43 Ipoh Coffee 20 1 16 - 500 g tins 46.00
44 Gula Malacca 20 2 20 - 2 kg bags 19.45
49 Maxilaku 23 3 24 - 50 g pkgs. 20.00
51 Manjimup Dried Apples 24 7 50 - 300 g pkgs. 53.00
55 Pâté chinois 25 6 24 boxes x 2 pies 24.00
56 Gnocchi di nonna Alice 26 5 24 - 250 g pkgs. 38.00
65 Louisiana Fiery Hot Pepper Sauce 2 2 32 - 8 oz bottles 21.05
66 Louisiana Hot Spiced Okra 2 2 24 - 8 oz jars 17.00
67 Laughing Lumberjack Lager 16 1 24 - 12 oz bottles 14.00
69 Gudbrandsdalsost 15 4 10 kg pkg. 36.00
70 Outback Lager 7 1 24 - 355 ml bottles 15.00
72 Mozzarella di Giovanni 14 4 24 - 200 g pkgs. 34.80
74 Longlife Tofu 4 7 5 kg pkg. 10.00
76 Lakkalikööri 23 1 500 ml 18.00
77 Original Frankfurter grüne Soße 12 2 12 boxes 13.00
~~~