Special commands in MySQL database query: mysql DataBase Query

Source: Internet
Author: User

Special commands in MySQL database query: mysql DataBase Query

1. Install MySQL

Download the MySQL software and modify the installation path.

Install database MySQL5.7.18

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

Step 2: extract the downloaded installation package to a disk,

Step 3: configure the environment variable, create the environment variable MySQL_HOME, and enter the installation directory of MySQL,

Then insert % MYSQL_HOME % \ bin to the end of Path;

Step 4: run the command line as an administrator, press win + R and Enter cmd, right-click and run the command as an administrator.

Step 5: switch to the MySQL installation directory and use mysqld for installation:

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

Start the service: mysqld -- user = mysql,

Initialize mysql root password mysqladmin-u root password 'new-password ',

For more information, see https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html. 

Step 6: register the service mysqld -- install MySQL

Use the net start mysql command to start the service.

Enter the mysql-u root-p command, and then enter the password entered during database initialization in step 5, as shown in:

Run the mysql Command show databases; To View tables in the database, as shown in:

This indicates that the database has been installed successfully.

Second: Special Database Query statements

In descending order, select name from data order by name desc; ---- Here, desc means sorting in descending order.

For a query of relative column positions, select name, price from data order by; ----- here, 2 and 3 indicate sorting by the second column and then by the third column.

Note: To sort multiple columns in descending order, desc must be used for each column.

Third:

What is the difference between creating a link for Navicat database software and creating a database?

Creating a link is to create a data link object that contains a database

To create a data link

Select the database link type. For MySQL, set the Link name and password port number.

Create Database in e-MySQL

In this way, the database will be created.

 

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.