MySQL service and database management

MySQL service and database management

1. Start and stop service instructions

1.1 Official MSI installation address of MySQL 5.7 under Windows

(Choose your favorite version to install):

https://downloads.mysql.com/archives/installer/

1.1.1: Problems encountered in win7: Unable to locate program input point fesetround in dynamic link library Solution:

Download C++ library address:

https://support.microsoft.com/en-us/help/3138367/update-for-visual-c-2013-and-visual-c-redistributable-package

After downloading the selected installation, proceed to the next step:

1.2, Windows

(mysql57 is the mysql service name):

  • Start: net start mysql57
  • Shutdown: net stop mysql57

1.3, Linux

(mysql is the name of the MySQL service):

Start :[ root@localhost ~]service mysql start

Shutdown :[ root@localhost ~]service mysql stop

1.4. Enter mysql in cmd window under windows:

cd to the bin directory where mysql is installed:

C:\Windows\system32>cd C:\Program Files\MySQL\MySQL Server 5.7\bin

Connect to mysql server:

C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

mysql represents the client command, -u is followed by the database user to connect to, -p means that a password is required.

1.4 Database Management

1.4.1. Create an orderManage database

mysql> create database orderManage;
Query OK, 1 row affected (0.00 sec)

1.4.2. Display all databases

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cluster |
|mysql |
| test |
|orderManage|
+--------------------+ 5 rows in set (0.00 sec)


It can be found that in the above list, in addition to orderManage just created, there are 4 other databases, all of which are installed
MySQL is automatically created by the system, and its respective functions are as follows.

  • 1. information_schema : mainly stores some database object information in the system. For example, user table information, column information, permission information, character set information, partition information, etc.
  • 2. cluster : stores the system's cluster information.
  • 3. mysql : stores the system’s user permission information.
  • 4. test : A test database automatically created by the system, which can be used by any user.

1.4.3. Select a data entry

Select to enter the orderManage database:

mysql> use ordermanage;
Database changed


From this, we can see that when you choose to enter the database, the database name is not case sensitive.

1.4.4, View all tables in this database

mysql> show tables;
Empty set (0.00 sec)


At this point, it shows that there is no table in the orderManage database (Empty set means the operation result is empty)

1.4.5. Delete the database

mysql> drop database ordermanage;
Query OK, 0 rows affected (0.01 sec)


1.5. Configure MySQL to allow remote access

The following problems occur when connecting via IP:

Solution:

Log in to the MySQL database as the root user and query the login user information:

mysql -u root -p

use mysql;

select host from user where user = 'root'


Set host to %

update user set host='%' where user='root';


After the Host modification is completed, remember to execute flush privileges to make the configuration take effect immediately.

flush privileges;
 

This is the end of this article about MySQL service and database management. For more relevant MySQL service and database management content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of the installation, configuration, startup and shutdown methods of the Mysql server
  • MySQL multi-instance installation boot auto-start service configuration process
  • MySQL5.7 single instance self-starting service configuration process
  • MySQL configuration master-slave server (one master and multiple slaves)
  • MySQL in Windows net start mysql Start MySQL service error occurs System error solution
  • 5 MySQL GUI tools recommended to help you with database management
  • 19 MySQL optimization methods in database management
  • Detailed introduction to 5 commonly used MySQL database management tools
  • Summary of Common Commands for MySQL Database Management

<<:  Three notification bar scrolling effects implemented with pure CSS

>>:  Detailed explanation of Linux remote management and sshd service verification knowledge points

Recommend

Seven Principles of a Skilled Designer (1): Font Design

Well, you may be a design guru, or maybe that'...

Tutorial on how to install htop on CentOS 8

If you are looking to monitor your system interac...

Vue + element dynamic multiple headers and dynamic slots

Table of contents 1. Demand 2. Effect 3. All code...

KTL tool realizes the method of synchronizing data from MySQL to MySQL

Use ktl tool to synchronize data from mysql to my...

Introduction to encryption of grub boot program in Linux

Table of contents 1. What is grub encryption 2. g...

Looping methods and various traversal methods in js

Table of contents for loop While Loop do-while lo...

How to use the Linux md5sum command

01. Command Overview md5sum - Calculate and verif...

Detailed explanation of map overlay in openlayers6

1. Overlay Overview Overlay means covering, as th...

Sample code for installing Jenkins using Docker

Two problems that are easy to encounter when inst...

Web designers should optimize web pages from three aspects

<br />With the increase of bandwidth, there ...

Html easily implements rounded rectangle

Question: How to achieve a rounded rectangle usin...

js realizes the magnifying glass function of shopping website

This article shares the specific code of js to re...

Detailed explanation of MySQL multi-table join query

Table of contents Multi-table join query Inner Jo...