· 3 years ago · Oct 25, 2021, 06:20 AM
1Microsoft Windows [Version 10.0.19042.928]
2(c) Microsoft Corporation. All rights reserved.
3
4C:\Users\nelly> mysql - uroot
5mysql Ver 15.1 Distrib 10.4.21-MariaDB, for Win64 (AMD64), source revision 4902b0fdc91cc6dc169dd2322daf966a2eeafdd8
6Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
7
8Usage: mysql [OPTIONS] [database]
9
10Default options are read from the following files in the given order:
11C:\WINDOWS\my.ini C:\WINDOWS\my.cnf C:\my.ini C:\my.cnf C:\xampp\mysql\my.ini C:\xampp\mysql\my.cnf C:\xampp\mysql\data\my.ini C:\xampp\mysql\data\my.cnf
12The following groups are read: mysql mariadb-client client client-server client-mariadb
13The following options may be given as the first argument:
14--print-defaults Print the program argument list and exit.
15--no-defaults Don't read default options from any option file.
16The following specify which files/extra groups are read (specified before remaining options):
17--defaults-file=# Only read default options from the given file #.
18--defaults-extra-file=# Read this file after the global files are read.
19--defaults-group-suffix=# Additionally read default groups with # appended as a suffix.
20
21 -?, --help Display this help and exit.
22 -I, --help Synonym for -?
23 --abort-source-on-error
24 Abort 'source filename' operations in case of errors
25 --auto-rehash Enable automatic rehashing. One doesn't need to use
26 'rehash' to get table and field completion, but startup
27 and reconnecting may take a longer time. Disable with
28 --disable-auto-rehash.
29 (Defaults to on; use --skip-auto-rehash to disable.)
30 -A, --no-auto-rehash
31 No automatic rehashing. One has to use 'rehash' to get
32 table and field completion. This gives a quicker start of
33 mysql and disables rehashing on reconnect.
34 --auto-vertical-output
35 Automatically switch to vertical output mode if the
36 result is wider than the terminal width.
37 -B, --batch Don't use history file. Disable interactive behavior.
38 (Enables --silent.)
39 --binary-as-hex Print binary data as hex
40 --character-sets-dir=name
41 Directory for character set files.
42 --column-type-info Display column type information.
43 -c, --comments Preserve comments. Send comments to the server. The
44 default is --skip-comments (discard comments), enable
45 with --comments.
46 -C, --compress Use compression in server/client protocol.
47 -#, --debug[=#] This is a non-debug version. Catch this and exit.
48 --debug-check Check memory and open file usage at exit.
49 -T, --debug-info Print some debug info at exit.
50 -D, --database=name Database to use.
51 --default-character-set=name
52 Set the default character set.
53 --delimiter=name Delimiter to be used.
54 -e, --execute=name Execute command and quit. (Disables --force and history
55 file.)
56 -E, --vertical Print the output of a query (rows) vertically.
57 -f, --force Continue even if we get an SQL error. Sets
58 abort-source-on-error to 0
59 -G, --named-commands
60 Enable named commands. Named commands mean this program's
61 internal commands; see mysql> help . When enabled, the
62 named commands can be used from any line of the query,
63 otherwise only from the first line, before an enter.
64 Disable with --disable-named-commands. This option is
65 disabled by default.
66 -i, --ignore-spaces Ignore space after function names.
67 --init-command=name SQL Command to execute when connecting to MariaDB server.
68 Will automatically be re-executed when reconnecting.
69 --local-infile Enable/disable LOAD DATA LOCAL INFILE.
70 -b, --no-beep Turn off beep on error.
71 -h, --host=name Connect to host.
72 -H, --html Produce HTML output.
73 -X, --xml Produce XML output.
74 --line-numbers Write line numbers for errors.
75 (Defaults to on; use --skip-line-numbers to disable.)
76 -L, --skip-line-numbers
77 Don't write line number for errors.
78 -n, --unbuffered Flush buffer after each query.
79 --column-names Write column names in results.
80 (Defaults to on; use --skip-column-names to disable.)
81 -N, --skip-column-names
82 Don't write column names in results.
83 --sigint-ignore Ignore SIGINT (CTRL-C).
84 -o, --one-database Ignore statements except those that occur while the
85 default database is the one named at the command line.
86 -p, --password[=name]
87 Password to use when connecting to server. If password is
88 not given it's asked from the tty.
89 -W, --pipe Use named pipes to connect to server.
90 -P, --port=# Port number to use for connection or 0 for default to, in
91 order of preference, my.cnf, $MYSQL_TCP_PORT,
92 /etc/services, built-in default (3306).
93 --progress-reports Get progress reports for long running commands (like
94 ALTER TABLE)
95 (Defaults to on; use --skip-progress-reports to disable.)
96 --prompt=name Set the command line prompt to this value.
97 --protocol=name The protocol to use for connection (tcp, socket, pipe).
98 -q, --quick Don't cache result, print it row by row. This may slow
99 down the server if the output is suspended. Doesn't use
100 history file.
101 -r, --raw Write fields without conversion. Used with --batch.
102 --reconnect Reconnect if the connection is lost. Disable with
103 --disable-reconnect. This option is enabled by default.
104 (Defaults to on; use --skip-reconnect to disable.)
105 -s, --silent Be more silent. Print results with a tab as separator,
106 each row on new line.
107 -S, --socket=name The socket file to use for connection.
108 --ssl Enable SSL for connection (automatically enabled with
109 other flags).
110 --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies
111 --ssl).
112 --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl).
113 --ssl-cert=name X509 cert in PEM format (implies --ssl).
114 --ssl-cipher=name SSL cipher to use (implies --ssl).
115 --ssl-key=name X509 key in PEM format (implies --ssl).
116 --ssl-crl=name Certificate revocation list (implies --ssl).
117 --ssl-crlpath=name Certificate revocation list path (implies --ssl).
118 --tls-version=name TLS protocol version for secure connection.
119 --ssl-verify-server-cert
120 Verify server's "Common Name" in its cert against
121 hostname used when connecting. This option is disabled by
122 default.
123 -t, --table Output in table format.
124 --tee=name Append everything into outfile. See interactive help (\h)
125 also. Does not work in batch mode. Disable with
126 --disable-tee. This option is disabled by default.
127 -u, --user=name User for login if not current user.
128 -U, --safe-updates Only allow UPDATE and DELETE that uses keys.
129 -U, --i-am-a-dummy Synonym for option --safe-updates, -U.
130 -v, --verbose Write more. (-v -v -v gives the table output format).
131 -V, --version Output version information and exit.
132 -w, --wait Wait and retry if connection is down.
133 --connect-timeout=# Number of seconds before connection timeout.
134 --max-allowed-packet=#
135 The maximum packet length to send to or receive from
136 server.
137 --net-buffer-length=#
138 The buffer size for TCP/IP and socket communication.
139 --select-limit=# Automatic limit for SELECT when using --safe-updates.
140 --max-join-size=# Automatic limit for rows in a join when using
141 --safe-updates.
142 --secure-auth Refuse client connecting to server if it uses old
143 (pre-4.1.1) protocol.
144 --server-arg=name Send embedded server this as a parameter.
145 --show-warnings Show warnings after every statement.
146 --plugin-dir=name Directory for client-side plugins.
147 --default-auth=name Default authentication client-side plugin to use.
148 --binary-mode By default, ASCII '\0' is disallowed and '\r\n' is
149 translated to '\n'. This switch turns off both features,
150 and also turns off parsing of all clientcommands except
151 \C and DELIMITER, in non-interactive mode (for input
152 piped to mysql or loaded using the 'source' command).
153 This is necessary when processing output from mysqlbinlog
154 that may contain blobs.
155 --connect-expired-password
156 Notify the server that this client is prepared to handle
157 expired password sandbox mode even if --batch was
158 specified.
159
160Variables (--variable-name=value)
161and boolean options {FALSE|TRUE} Value (after reading options)
162--------------------------------- ----------------------------------------
163abort-source-on-error FALSE
164auto-rehash TRUE
165auto-vertical-output FALSE
166binary-as-hex FALSE
167character-sets-dir (No default value)
168column-type-info FALSE
169comments FALSE
170compress FALSE
171debug-check FALSE
172debug-info FALSE
173database (No default value)
174default-character-set auto
175delimiter ;
176vertical FALSE
177force FALSE
178named-commands FALSE
179ignore-spaces FALSE
180init-command (No default value)
181local-infile FALSE
182no-beep FALSE
183host (No default value)
184html FALSE
185xml FALSE
186line-numbers TRUE
187unbuffered FALSE
188column-names TRUE
189sigint-ignore FALSE
190port 0
191progress-reports TRUE
192prompt \N [\d]>
193protocol
194quick FALSE
195raw FALSE
196reconnect TRUE
197socket (No default value)
198ssl FALSE
199ssl-ca (No default value)
200ssl-capath (No default value)
201ssl-cert (No default value)
202ssl-cipher (No default value)
203ssl-key (No default value)
204ssl-crl (No default value)
205ssl-crlpath (No default value)
206tls-version (No default value)
207ssl-verify-server-cert FALSE
208table FALSE
209user (No default value)
210safe-updates FALSE
211i-am-a-dummy FALSE
212connect-timeout 0
213max-allowed-packet 16777216
214net-buffer-length 16384
215select-limit 1000
216max-join-size 1000000
217secure-auth FALSE
218show-warnings FALSE
219plugin-dir (No default value)
220default-auth (No default value)
221binary-mode FALSE
222connect-expired-password FALSE
223
224C:\Users\nelly>mysql -uroot
225Welcome to the MariaDB monitor. Commands end with ; or \g.
226Your MariaDB connection id is 16
227Server version: 10.4.21-MariaDB mariadb.org binary distribution
228
229Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
230
231Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
232
233MariaDB [(none)]> show databases;
234+--------------------+
235| Database |
236+--------------------+
237| information_schema |
238| mysql |
239| performance_schema |
240| phpmyadmin |
241| shoot |
242| test |
243+--------------------+
2446 rows in set (0.013 sec)
245
246MariaDB [(none)]> use test;
247Database changed
248MariaDB [test]> show tables;
249Empty set (0.001 sec)
250
251MariaDB [test]> create database Reservations;
252Query OK, 1 row affected (0.024 sec)
253
254MariaDB [test]> select Reservations;
255ERROR 1054 (42S22): Unknown column 'Reservations' in 'field list'
256MariaDB [test]> use Reservations;
257Database changed
258MariaDB [Reservations]> Create Table
259 -> ;
260ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
261MariaDB [Reservations]>
262MariaDB [Reservations]>
263MariaDB [Reservations]> Create Table Agency(name VARCHAR(100) NOT NULL, city VARCHAR (100) NOT NULL, country VARCHAR (100) NOT NULL, telnum VARCHAR (10) NOT NULL);
264Query OK, 0 rows affected (0.023 sec)
265
266MariaDB [Reservations]> SHOW TABLES
267 -> show Agency
268 ->
269 ->
270 ->
271 -> ;
272ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'show Agency' at line 2
273MariaDB [Reservations]> Show tables
274 -> INSERT INTO Agency
275 -> ;
276ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO Agency' at line 2
277MariaDB [Reservations]> IMSERT INTO Agency
278 -> shoe
279 -> cpnds
280 -> sdn;
281ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IMSERT INTO Agency
282shoe
283cpnds
284sdn' at line 1
285MariaDB [Reservations]> create table Agency(
286 -> name VARCHAR (100) NOT NULL,
287 -> city VARCHAR (100) NOT NULL,
288 -> country VARCHAR(100) NOT NULL,
289 -> telnum CHAR (10) NOT NULL);
290ERROR 1050 (42S01): Table 'agency' already exists
291MariaDB [Reservations]> SHOW AGENCY
292 -> ;
293ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AGENCY' at line 1
294MariaDB [Reservations]> INSERT INTO AGENCY
295 -> (name, city, country, telnum)
296 -> VALUES ('Nelly', 'Radnevo', 'Bulgaria', '0894080007');
297Query OK, 1 row affected (0.026 sec)
298
299MariaDB [Reservations]> INSERT INTO AGENCY
300 -> (name, city, country, telnum)
301 -> VALUES ('Gaby', 'Stara Zagora', 'Bulgaria', '0888693322');
302Query OK, 1 row affected (0.008 sec)
303
304MariaDB [Reservations]> SELECT *FROM Agency;
305+-------+--------------+----------+------------+
306| name | city | country | telnum |
307+-------+--------------+----------+------------+
308| Nelly | Radnevo | Bulgaria | 0894080007 |
309| Gaby | Stara Zagora | Bulgaria | 0888693322 |
310+-------+--------------+----------+------------+
3112 rows in set (0.002 sec)
312
313MariaDB [Reservations]> CREATE TABLE Clients(
314 -> egn CHAR (10) NOT NULL,
315 -> name VARCHAR (100) NOT NULL,
316 -> telnum CHAR (10) NOT NULL,
317 -> email VARCHAR (100) NOT NULL);
318Query OK, 0 rows affected (0.012 sec)
319
320MariaDB [Reservations]> INSERT INTO Clients
321 -> (egn, name, telnum, email)
322 -> VALUES ('0341297531', 'Nelly', '0894080007', 'nelly@gmail.com');
323Query OK, 1 row affected (0.004 sec)
324
325MariaDB [Reservations]> INSERT INTO Clients
326 -> (egn, name, telnum, email)
327 -> VALUES ('0350287532','Gaby','0899693322','gaby@gmail.com');
328Query OK, 1 row affected (0.002 sec)
329
330MariaDB [Reservations]> Create table RES(
331 -> agencyname VARCHAR (100) NOT NULL,
332 -> egn CHAR (10) NOT NULL,
333 -> date VARCHAR (10) NOT NULL,
334 -> status VARCHAR (100) NOT NULL);
335Query OK, 0 rows affected (0.010 sec)
336
337MariaDB [Reservations]> INSERT INTO RES
338 -> (agencyname, egn, date, status)
339 -> VALUES ('Softadev','0341297531','28.10.2021','expecting');
340Query OK, 1 row affected (0.007 sec)
341
342MariaDB [Reservations]> SELECT * FROM RES
343 -> ;
344+------------+------------+------------+-----------+
345| agencyname | egn | date | status |
346+------------+------------+------------+-----------+
347| Softadev | 0341297531 | 28.10.2021 | expecting |
348+------------+------------+------------+-----------+
3491 row in set (0.001 sec)
350
351MariaDB [Reservations]> Bye
352Ctrl-C -- exit!
353
354C:\Users\nelly>