1. Download the MySQL installation package
2. Install MySQL, customize and modify paths
3. Configure MySQL, select Custom->server mode->500 access, tick console, settings gbk-> set password and allow root users to Telnet, and so on.
With administrator privileges, in console input: net start MySQL, start MySQL
Then login: mysql-u root-p, enter password after login success, such as:
Create a user database:
Create DATABASE user_db;
:
Tips: Be sure to add a semicolon after the sentence, otherwise it will be entered until you press CTRL + C to end and log out.
show databases;
View all existing databases;
To add tables, data to the database, first select the database:
One: specified when logging in to the database, command: mysql-d selected database name-h hostname-u user name-P
For example, select the database you just created when you log in: mysql-d samp_db-u root-p
Second: after logging in using the USE statement to specify, command: used database name;
The USE statement can be executed without a semicolon, and a samp_db is used to select the database you just created, and you will be prompted after successful selection: Database changed
Enter the name of the CREATE TABLE table (column declaration) as shown in:
or create a different text input: For some longer statements at the command prompt may be easy to get wrong, so we can use any text editor to save the statement after the file is saved as Createtable.sql, through the command prompt file redirection execution execution of the script. The command is:mysql> source D:\Stool\mysql5.5\createtable.sql
For more details, see: http://www.cnblogs.com/mr-wid/archive/2013/05/09/3068229.html
MySQL Installation and application