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=D,-
9&'
&
)
)
'(9
+<
9
,
9
9
&' 9
'( )
'
#
0 &'
+0
F B
9
( 8. ,(
/'(<
+ 9
9
88
>)
,
+96*(9A(,
&' +
B ) 9
9,
))=
)=
/'(
))
)
.
)
/'(
))
BI
)
0
/'(
))
>I88
>
>+( 8. ,9
))IJ*0K:L7*K007K7:-MN
))
)
)) )))/
'(
+
,
7<
5559
<
user1@mycomputer:~$ mysql -h 1.2.3.4 -P 4000 -u user1 -p pass1
7<
9
9
<
user1@mycomputer:~$ mysql -h 1.2.3.4 -u user1 -p
Enter password:
9
<
user1@mycomputer:~$ mysql -u user2 -p pass2 studenti
/
01
! !
$
: 9&'
9
+
7*7-,3
=
9 E
+
,0
<
user1@mycomputer:~$ mysql
Welcome to the MySQL monitor.
/
4
<
'(9
/
49
'(. 9
+<
B ) 9
) )
,9C D
+<
,
! !
%
5
: = 9
= <
E
O+= ,9
O;?
1
+
CD ,9
O?
/
4P
+
,<
mysql> select curdate(), curtime()\g
+------------+-----------+
| curdate() | curtime() |
+------------+-----------+
| 2009-06-14 | 17:46:40 |
+------------+-----------+
1 row in set (0.00 sec)
O;<
mysql> select curdate(), curtime()\G
*************************** 1. row ***************************
curdate(): 2009-06-14
curtime(): 17:46:42
1 row in set (0.00 sec)
&'
*-()9
/
4'
,'
! !
&
#
7
=
/
4<
=9
) /
4+
'(,
=
9
'(
6)
+,=
!<
mysql> help
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
?
(\?) Synonym for `help'.
clear
(\c) Clear command.
connect
(\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new
delimiter.
edit
(\e) Edit command with $EDITOR.
ego
(\G) Send command to mysql server, display result vertically.
exit
(\q) Exit mysql. Same as quit.
go
(\g) Send command to mysql server.
help
(\h) Display this help.
nopager
(\n) Disable pager, print to stdout.
notee
(\t) Don't write into outfile.
pager
(\P) Set PAGER [to_pager]. Print the query results via PAGER.
print
(\p) Print current command.
prompt
(\R) Change your mysql prompt.
quit
(\q) Quit mysql.
rehash
(\#) Rebuild completion hash.
source
(\.) Execute an SQL script file. Takes a file name as an argument.
status
(\s) Get status information from the server.
system
(\!) Execute a system shell command.
tee
(\T) Set outfile [to_outfile]. Append everything into given outfile.
use
(\u) Use another database. Takes database name as argument.
charset
(\C) Switch to another charset. Might be needed for processing binlog with
multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
For server side help, type 'help contents'
6)
9
&<
mysql> help contents;
You asked for help about help category: "Contents"
For more information, type 'help <item>', where <item> is one of the following
categories:
Account Management
Administration
[...output omis...]
mysql> help Administration;
You asked for help about help category: "Administration"
For more information, type 'help <item>', where <item> is one of the following
topics:
DESCRIBE
FLUSH QUERY CACHE
HELP COMMAND
HELP STATEMENT
)
9
&7
==
=<
mysql> help help command;
Name: 'HELP COMMAND'
Description:
Syntax:
mysql> help search_string
/
012
! '
&'
) +C=D,
'(.
C
D
C= D
+
,
9
-
#
9
'(
) &9
9 &9
9
*+-
. /
0
*+
-
12-
%
*+
*+
-
! '
)
'(+
= ,
9
8 )
=
9 9
+ &
,/'(
<
1
Q
))+
)
,
=
*
8R
=
R89 )
*
1
8RS
= R8
/'( 9
1
/'( & '(
#$
9
9
C D
/'(
9
/'(
=
7+
,<
-- crearea bazei de date principale
CREATE SCHEMA academie; # baza de date cu clase si studenti
/* creare tabele:
studenti
clase
*/
CREATE TABLE studenti /* conturile de utilizator sunt in alta tabela */ (Nume CHAR(50))
# portiunea gri a instructiunii se executa numai daca ruleaza pe srv MySQL > 5.0.21
SHOW /*!50021 FULL */ TABLES;
! '
(
7
'( /
4<
:.-7
3
<
mysql> SOURCE c:/sql/import.sql;
[...output omis...]
/
4 ) 9 T
<
'
)
*+
3
#
& '(9 & <
&'
0
)
9 &'(
1 H2"#
'(9 & +
=<88B > 8B > 8'(Q ,#
9
#$
9 C D &
#
?
)
&
9
7
&
9
#$+</'(:,9 9
9C=
=
D
.*+
03$*+
4
'
%
3
+99,
)
'(9
+ U
4' ,0
'(
5%
4' 6% !4' 7
& 8
9
0
9
<
9 9V
W
+
,
9
9
+<+
555,95+
",,
1
+<
,9
<
SELECT * FROM `tabela produse`
03$:*+%
*+
%)
9 <
5
'
$
,
/'(
==
>
# 9
9
9
# 9
F B
9
( 8.
1
'
*
0 )9
= <99
"
-
. ./012".)
/'( /;
%