Excerpt from: http://www.cnblogs.com/wuhou/archive/2008/09/28/1301071.html
Application Environment: Ubuntu
One: Installation
Apt-get Install Mysql-server (note not MySQL)
Two: Use
Note: During the installation process, you are prompted for the MySQL password, so the following steps are required to access MySQL:
#mysql-U root-p
Note:-P cannot be omitted
View the current MySQL user
Mysql> SELECT User,host,password from user
-
;(Note After you execute the SQL statement, add a semicolon to indicate that this is a complete SQL statement that can be executed, otherwise the angle brackets are always present)
+------------------+-----------+-------------------------------------------+
| user | Host | password |
+------------------+-----------+-------------------------------------------+
| Root | localhost | *81f5e21e35407d884a6cd4a731aebfb6af209e1b |
| Root | Ubuntu | *81f5e21e35407d884a6cd4a731aebfb6af209e1b |
| Root | 127.0.0.1 | *81f5e21e35407d884a6cd4a731aebfb6af209e1b |
| Debian-sys-maint | localhost | *d232094ed96225af2c0ce31bbf7b6da7cc9c3f06 |
+------------------+-----------+-------------------------------------------+
Installation and use of MySQL