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

Java uses Apache.POI to export HSSFWorkbook to Excel

Use HSSFWorkbook in Apache.POI to export to Excel...

Details of the order in which MySQL reads my.cnf

Table of contents The order in which MySQL reads ...

Make your website automatically use IE7 compatibility mode when browsing IE8

Preface To help ensure that your web pages have a ...

Solution to input cursor misalignment in Chrome, Firefox, and IE

Detailed explanation of the misplacement of the in...

Vue implements partial refresh of the page (router-view page refresh)

Using provide+inject combination in Vue First you...

VMware configuration VMnet8 network method steps

Table of contents 1. Introduction 2. Configuratio...

The process of installing and configuring nginx in win10

1. Introduction Nginx is a free, open source, hig...

Design reference WordPress website building success case

Each of these 16 sites is worth reading carefully,...

How to open external network access rights for mysql

As shown below: Mainly execute authorization comm...

js to realize a simple puzzle game

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

Detailed process of Vue front-end packaging

Table of contents 1. Add packaging command 2. Run...