MySQL Community Server 8.0.12 installation and configuration method graphic tutorial

MySQL Community Server 8.0.12 installation and configuration method graphic tutorial

MySQL 8 brings a brand new experience, such as support for NoSQL, JSON, etc., and has a performance improvement of more than twice that of MySQL 5.7. This article explains how to install MySQL 8 on Windows, as well as basic MySQL usage.

download

Download

In this case: MySQL Community Server 8.0.12.

Unzip

Unzip it to the installation directory, such as the root directory of drive D.

In this example: D:\mysql-8.0.12-winx64.

Create my.ini

my.ini is the configuration file for MySQL installation:

[mysqld]
# Installation directory basedir=D:\\mysql-8.0.12-winx64
#Data storage directory datadir=D:\\mysqlData\\data

my.ini is placed in the root directory of the MySQL installation directory. It should be noted that the D:\mysqlData directory must be created first. The data directory is created by MySQL.

Initial installation

implement:

mysqld --defaults-file=D:\mysql-8.0.12-winx64\my.ini --initialize --console

The console output is as follows, indicating that the installation is successful:

>mysqld --defaults-file=D:\mysql-8.0.12-winx64\my.ini --initialize --console
2018-08-20T16:14:45.287448Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server in progress as process 5012
2018-08-20T16:14:45.289628Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2018-08-20T16:14:45.299329Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-08-20T16:14:45.301316Z 0 [System] [MY-010910] [Server] D:\mysql-8.0.12-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.12) MySQL Community Server - GPL.

D:\mysql-8.0.12-winx64\bin>mysqld --defaults-file=D:\mysql-8.0.12-winx64\my.ini --initialize --console
2018-08-20T16:15:25.729771Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server in progress as process 18148
2018-08-20T16:15:43.569562Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: L-hk!rBuk9-.
2018-08-20T16:15:55.811470Z 0 [System] [MY-013170] [Server] D:\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) initializing of server has completed

Among them, "L-hk!rBuk9-." is the initialization password of the root user. Changes can be made later.

Start and stop MySQL server

Execute mysqld to start the MySQL server, or execute mysqld –console to see the complete startup information:

>mysqld --console
2018-08-20T16:18:23.698153Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-08-20T16:18:23.698248Z 0 [System] [MY-010116] [Server] D:\mysql-8.0.12-winx64\bin\mysqld.exe (mysqld 8.0.12) started as process 16304
2018-08-20T16:18:27.624422Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2018-08-20T16:18:27.793310Z 0 [System] [MY-010931] [Server] D:\mysql-8.0.12-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.12' socket: '' port: 3306 MySQL Community Server - GPL.

To shut down, execute mysqladmin -u root shutdown .

Using the MySQL Client

Use mysql to log in, the account is root, and the password is "L-hk!rBuk9-.":

>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.12

Copyright (c) 2000, 2018, 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.

Execute the following statement to change the password. "123456" is the new password.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.13 sec)

MySQL common commands

Display the existing databases:

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
|mysql |
| performance_schema |
|sys|
+--------------------+
4 rows in set (0.08 sec)

Create a new database:

mysql> CREATE DATABASE lite;
Query OK, 1 row affected (0.19 sec)

Using Database:

mysql> USE lite;
Database changed

Create a table:

Create a table and execute:

mysql> CREATE TABLE t_user (user_id BIGINT NOT NULL, username VARCHAR(20));
Query OK, 0 rows affected (0.82 sec)

View the table:

View all tables in the database:

mysql> SHOW TABLES;
+----------------+
| Tables_in_lite |
+----------------+
| t_user |
+----------------+
1 row in set (0.00 sec)

View table details:

mysql> DESCRIBE t_user;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| user_id | bigint(20) | NO | | NULL | |
| username | varchar(20) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

Insert data:

mysql> INSERT INTO t_user(user_id, username) VALUES(1, '老卫');
Query OK, 1 row affected (0.08 sec)

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • MySQL 8.0.12 installation and configuration method graphic tutorial
  • mysql installer community 8.0.12.0 installation graphic tutorial
  • MySQL 8.0.12 winx64 detailed installation tutorial
  • MySQL 8.0.12 decompression version installation tutorial personal test!
  • MySQL 8.0.12 installation configuration method and password change
  • MySQL 8.0.12 installation and configuration method graphic tutorial (Windows version)
  • MySQL 8.0.12 decompression version installation tutorial
  • CentOS7 uses yum to install mysql 8.0.12
  • MySQL 8.0.12 installation and configuration method graphic tutorial (windows10)
  • MySQL 8.0.12 installation steps and basic usage tutorial under Windows

<<:  JavaScript method to detect the type of file

>>:  Docker advanced method of rapid expansion

Recommend

MySQL 8.0.15 installation and configuration graphic tutorial

This article records the installation and configu...

CSS3 Bezier Curve Example: Creating Link Hover Animation Effects

We will use CSS3 animated transitions to create a...

What you need to know about msyql transaction isolation

What is a transaction? A transaction is a logical...

Using Nginx to implement grayscale release

Grayscale release refers to a release method that...

Thirty HTML coding guidelines for beginners

1. Always close HTML tags In the source code of p...

On Visual Design and Interaction Design

<br />In the entire product design process, ...

Problems with creating placeholders for HTML selection boxes

I'm using a placeholder in a text input and i...

Some conclusions on the design of portal website focus pictures

Focus images are a way of presenting content that ...

Solve the problem of running hello-world after docker installation

Installed Docker V1.13.1 on centos7.3 using yum B...

Detailed examples of Linux disk device and LVM management commands

Preface In the Linux operating system, device fil...

How to solve the mysql insert garbled problem

Problem description: When inserting Chinese chara...

Mysql query database capacity method steps

Query the total size of all databases Here’s how:...

How many ports can a Linux server open at most?

Table of contents Port-related concepts: Relation...

Vue application example code based on axios request encapsulation

Table of contents What is axios? Axios request ty...