MYSQL Tutorial: If you are a beginner, you should check the MYSQL operation. if MYSQL runs on the server and you need to connect to the client, you need to connect as follows:
Shell> mysql-h host-u user-p
Enter password :************
Host and user indicate the host name and MySQL account name running on the MySQL server respectively. enter the name of the corresponding machine and the MySQL user name. ******** indicates your password.
If valid, you will see the following prompt:
Welcome to the MySQL monitor. Commands end with; or g.
Your MySQL connection id is 7 to server version: 5.0.18-nt
Type 'help; 'or 'H' for help. Type 'C' to clear the buffer.
Mysql>
Mysql> the prompt tells you to enter the command.
Sometimes MySQL allows you to log on to the server anonymously, and you can directly enter mysql.
Shell> mysql
After successful connection, you can enter quit at the mysql> prompt to exit at any time:
Mysql> quit
Bye
The following shows a simple query instance. this is a simple command that requires the server version number and current date:
Mysql> select version (), current_date;
+ ----------- + -------------- +
| Version () | current_date |
+ ----------- + -------------- +
| 5.0.18-nt | 2006-07-29 |
+ ----------- + -------------- +
1 row in set (0.00 sec)
Mysql>
Here we need to understand:
A command is usually composed of SQL statements followed by a semicolon.