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

How to avoid duplication of data when inserting in MySql batch

Table of contents Preface 1. insert ignore into 2...

IIS 7.5 uses URL Rewrite module to achieve web page redirection

We all know that Apache can easily set rewrites f...

mysql 5.6.23 winx64.zip installation detailed tutorial

For detailed documentation on installing the comp...

CSS horizontal centering and limiting the maximum width

A CSS layout and style question: how to balance h...

css Get all elements starting from the nth one

The specific code is as follows: <div id="...

JavaScript removes unnecessary properties of an object

Table of contents Example Method 1: delete Method...

Detailed explanation of JavaScript implementation of hash table

Table of contents 1. Hash table principle 2. The ...

Network configuration of Host Only+NAT mode under VirtualBox

The network configuration of Host Only+NAT mode u...

JavaScript canvas to achieve code rain effect

This article shares the specific code for canvas ...

Complete steps to use samba to share folders in CentOS 7

Preface Samba is a free software that implements ...

Implementing image fragmentation loading function based on HTML code

Today we will implement a fragmented image loadin...

Vue implements dynamic routing details

Table of contents 1. Front-end control 1. In the ...

MySQL 8.0.20 winx64 installation and configuration method graphic tutorial

This article shares with you the installation and...

How to use vue-video-player to achieve live broadcast

Table of contents 1. Install vue-video-player 2. ...

Several ways to solve CSS style conflicts (summary)

1. Refine the selector By using combinators, the ...