Special commands in MySql database query

Special commands in MySql database query

First: Installation of MySQL

Download the MySQL software and modify the installation path

Install the MySQL database 5.7.18

Step 1: Database MySQL5.7.18 can be downloaded from the official website, download address: http://www.filehorse.com/download-mysql-64/,

Step 2: Unzip the downloaded installation package to a disk.

Step 3: Configure environment variables, create a new environment variable MySQL_HOME, and enter the MySQL installation directory.

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

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

Step 5: Switch to the MySQL installation directory and install it using mysqld:

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

Start the service: mysqld --user=mysql,

Initialize 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.

Step 6: Register service mysqld --install MySQL

Start the service with the net start mysql command.

Enter the mysql -u root -p command: Then fill in the password entered when initializing the database in step 5, as shown below:

Enter show databases; in the mysql command to view the tables in the database, as shown in the following figure:

This indicates that the database has been installed successfully.

Second: Database special query statement

Sort in descending order, select name from data order by name desc; ---- here desc means sort in descending order

Query based on relative column position, select name, price from data order by 2,3; ----- 2,3 means sorting by the second column first, then by the third column.

Note: If you want to sort in descending order on multiple columns, you must specify each column with desc.

third:

The difference between creating a new link and creating a new database in Navicat database software

Creating a new link is to create a data link object, which contains the database

To create a data link,

Select the type of database link to create. Mine is MySQL, set the link name, password and port number.

Electronic MySQL create database

This will create the database.

Summarize

The above are the special commands in MySql database query that I introduced to you. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • 18 common commands in MySQL command line
  • Common operation commands of MySQL in Linux system
  • Centos7 restart apache, nginx, mysql, php-fpm command method
  • How to implement import and export mysql database commands under linux
  • Detailed explanation of the EXPLAIN command and its usage in MySQL
  • MySql common query command operation list
  • How to use commands in Mysql to achieve hierarchical search help detailed explanation
  • Solve the Chinese garbled problem of mysql5.5 database command line under Windows 10
  • Summary of Commonly Used MySQL Commands in Linux Operating System
  • Mysql uses the kill command to solve the deadlock problem (kill a certain SQL statement being executed)
  • MySQL 5.7 mysql command line client usage command details
  • MySQL database source command detailed explanation and examples
  • Common commands for mysql authorization, startup, and service startup

<<:  CentOS 7 switching boot kernel and switching boot mode explanation

>>:  Eight implementation solutions for cross-domain js front-end

Recommend

Several ways to store images in MySQL database

Usually the pictures uploaded by users need to be...

MYSQL A question about using character functions to filter data

Problem description: structure: test has two fiel...

How to monitor array changes in Vue

Table of contents Preface Source code Where do I ...

React Hooks Common Use Scenarios (Summary)

Table of contents 1. State Hook 1. Basic usage 2....

MySQL 8.0.18 installation and configuration method graphic tutorial

This article records the installation and configu...

JavaScript to add and delete messages on the message board

This article shares a small example of adding and...

JavaScript canvas text clock

This article example shares the specific code of ...

How to install Docker CE on Ubuntu 18.04 (Community Edition)

Uninstall old versions If you have installed an o...

Docker+gitlab+jenkins builds automated deployment from scratch

Table of contents Preface: 1. Install Docker 2. I...

Linux disk space release problem summary

The /partition utilization of a server in IDC is ...

MySQL5.6.31 winx64.zip installation and configuration tutorial

#1. Download # #2. Unzip to local and modify nece...

How to build php-nginx-alpine image from scratch in Docker

Although I have run some projects in Docker envir...

MySQL index pushdown details

Table of contents 1. Leftmost prefix principle 2....

Solve the problem of spring boot + jar packaging deployment tomcat 404 error

1. Spring boot does not support jsp jar package, ...