MySQL Installation and application

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.