Basic usage of mysql in windows _ MySQL

Source: Internet
Author: User
Basic usage of mysql in windows I. mysql introduction

Mysql is a small and flexible database server software that is ideal for medium and small application systems. In addition to standard ansi SQL statements, mysql also supports multiple platforms. on unix/linux systems, mysql supports multithreading, in this way, we can obtain good performance. Like the first two software, it is open source software.

II. install mysql (windows version)

Decompress the downloaded file to a directory and run the setup program. The installation process is prompted. It is installed in c:/mysql by default. if you want to install it in other directories, there are still some changes. as a beginner, you can skip this step and install it in the default directory. After installation, go to the c:/mysql/bindirectory and run the mysqld-ware.exe file.

Run directly in win98. normally, there is no prompt

In nt, enter mysqld-inform Ware -- install to start the service.

Next, enter mysql. under normal circumstances, several lines of prompts will appear and the following symbol will appear:

Mysql>

By now, you have successfully installed mysql.

3. set the mysql User password

The default username for the mysql database is "root" (sa is similar to the MS SQL server), and the password is empty by default. Enter

C:/mysql/bin> "mysqladmin-u root-p password adminpassword

After you press enter, you will be prompted to enter the original password. because the original password is empty, press enter directly and change the password of the root user to "adminpassword.

IV. simple use of mysql databases

1. display the mysql database (note: If no prompt is displayed in the later part of this article, all the commands entered are at the mysql prompt)

Show databases

2. open a database

Use test

Test indicates the database name.

3. display all data tables in a database (a database must be opened first)

Show tables

Go

4. create a database as root (under the dos prompt)

Mysqladmin-u root-p password adminpassword create gsbook

Then you will be prompted to enter the password. Because our purpose is to make a message board. here I name the database "gsbook ".

5. add a data table to the database

Create table gsbook (id int not null auto_increment, primary key (id), nickname varchar (30), email varchar (30), homepage varchar (30), note text, w_time datetime)

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.