1, start the MySQL server
In fact, the previous article has talked about how to start MySQL. Two methods: First, with Winmysqladmin, if the machine is started automatically run, you can go directly to the next step. The second is to run in DOS mode
D:mysqlbinmysqld
2, access to the MySQL interactive operation interface
In DOS mode, run: d:mysqlbinmysql
Appears: The MySQL prompt, at this time has entered the MySQL interactive operation mode.
If "error 2003:can′t connect to MySQL server on′localhost′ (10061)" appears,
Shows that your MySQL has not yet started.
3, exit the MySQL operation interface
Enter quit at the mysql> prompt to exit the interactive interface at any time:
Mysql> quit
Bye
You can also use control-d to exit.
4. The first Order
Mysql> Select Version (), current_date ();
+----------------+-----------------+
| Version () | Current_date () |
+----------------+-----------------+
| 3.23.25a-debug | 2001-05-17 |
+----------------+-----------------+
1 row in Set (0.01 sec)
Mysql>
This command requires the MySQL server to tell you its version number and current date. Try the above command in a different case to see what the results are. The results show that the case of the MySQL command is consistent.
Practice the following actions:
Mysql>select (20+5) *4;
Mysql>select (20+5) *4,sin (Pi ()/3);
Mysql>select (20+5) *4 as Result,sin (Pi ()/3); (as: Specify Kana as result)
Mysql> Select
-> USER ()
->,
-> Now ()
->;
+--------------------+---------------------+
| USER () | Now () |
+--------------------+---------------------+
| Odbc@localhost | 2001-05-17 22:59:15 |
+--------------------+---------------------+
1 row in Set (0.06 sec)
Mysql>
Notice how the middle comma and the last semicolon are used.