In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to install and configure mysql community server 8.0.12. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
download
This example is MySQL Community Server 8.0.12.
Decompression
Extract to the installation directory, such as the root directory of disk D.
This example is: d:\ mysql-8.0.12-winx64.
Create my.ini
My.ini is the configuration file for the 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 of the MySQL installation directory. It is important to note that the D:\ mysqlData directory is created first. The data directory is created by MySQL.
Initialize the installation
Execute:
Mysqld-defaults-file=D:\ mysql-8.0.12-winx64\ my.ini-initialize-console
The output of the console is as follows, which indicates that the installation is successful:
> mysqld-- defaults-file=D:\ mysql-8.0.12-winx64\ my.ini-- initialize-- console2018-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 50122018-08-20T16:14:45.289628Z 0 [ERROR] [Server]-- initialize specified but the data directory has files in it. Aborting.2018-08-20T16:14:45.299329Z 0 [ERROR] [Server] Aborting2018-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-- console2018-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 181482018-08-20T16:15:43.569562Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Lmurhkubuk.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, "LmurhkhumrBuk9Murray." Is the initialization password of the root user. You can make changes later.
Start and shut down MySQL server
Execute mysqld to start MySQL server, or execute mysqld-console to see the complete startup information:
> mysqld-- console2018-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) starting as process 163042018-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.
Close, you can execute mysqladmin-u root shutdown.
Use the MySQL client
Use mysql to log in with the account number of root and the password of "Lmurhkbuyer rBuk9mi.":
> mysql-u root-pEnter password: * Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 11Server version: 8.0.12Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
Execute the following statement to change the password. Where "123456" is the new password.
Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' 123456 query OK, 0 rows affected (0.13 sec)
MySQL common instructions
Show 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)
Use the database:
Mysql > USE lite;Database changed
Build a table:
Table creation and execution:
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 the details of the table:
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, 'Lao Wei'); Query OK, 1 row affected (0.08 sec) on "how to install and configure mysql community server 8.0.12" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.