Special commands in MySQL database queries

Source: Internet
Author: User
Tags mysql create mysql create database

First: Installation of MySQL

Download MySQL software, after modifying the installation path

Installing the Database MySQL5.7.18

The first step: Database MySQL5.7.18 can download the corresponding version on the official website,: http://www.filehorse.com/download-mysql-64/,

Step two: Unzip the downloaded installation package to a disk,

Step Three: Configure the environment variable, create a new environment variable mysql_home, enter the MySQL installation directory,

Then insert the%mysql_home%\bin into the last face of the path;

Fourth step: Run the command line as an administrator, press Win+r to enter CMD, and click the right mouse button to run as Administrator.

Fifth step: Switch to the MySQL installation directory and install it using mysqld:

Initialize data: mysqld--initialize-insecure--user=mysql,

Start service: Mysqld--user=mysql,

Initialize the MySQL root password mysqladmin-u root password ' new-password ',

See https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html for details .  

Sixth step: Register Service mysqld--install MySQL

Start the service with the net start MySQL command.

Enter the Mysql-u root-p command: And then fill in the fifth step of the password that you entered when initializing the database, as shown in:

Enter show databases under the MySQL command; , look at the tables in the database, as shown in:

This indicates that the database has been successfully installed.

Second: Database Special query statements

In descending order, select name from Data order by name Desc; ----Here desc is in descending order of meaning

The relative column position of the query, select name, price from the data order by 2,3;-----here 2,3 means to sort by the second column first, and then sort by the third column.

Note: You must specify each column with DESC when you want to sort in descending order on more than one column.

Third:

Navicat database software new link, and the difference between a new database

New link creates a data link object that contains a database

To create a data link, create a database

Select the type of database link you created. My is MySQL, set the link name, the password port number.

E-MySQL CREATE database

This will create the database.

Special commands in MySQL database queries

Related Article

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.