当前位置:网站首页>MySQL installation
MySQL installation
2022-04-23 17:21:00 【first quarter of the moon】
Form writing habits together ! This is my participation 「 Nuggets day new plan · 4 Yuegengwen challenge 」 Of the 20 God , Click to see the event details .
Hanshan Temple outside Suzhou , Midnight to the passenger ship .
1 Preface
In the process of project development ,mysql Is a frequently used storage database , In this article, I will introduce mysql Database installation and use , Will be divided into linux System installation and windows install , And some system configuration problems .
2 mysql install
Before installation , You need to clarify the installation method and path , The compiled source code package is adopted , The download address is as follows :
https://downloads.mysql.com/archives/community/
Copy code
You can choose according to the installation environment linux/centos/windows/mac Version of the file to download . In addition to mysql During startup , The configuration file of the system needs to be loaded , A default configuration file is provided below :
[mysqld]
# Database port and data file address socket File address , Configuration file about address windows and Linux There is a difference
port=3306
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/mysql.sock
# Set database users and maximum connections
user=mysql
max_connections=151
# Set ignore case
lower_case_table_names = 1
# Specified encoding
character-set-server=utf8
collation-server=utf8_general_ci
# Turn on ip binding
# bind-address = 0.0.0.0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# Specify client connection mysql At the time of the socket Communication file path
[client]
socket=/usr/local/mysql/mysql.sock
default-character-set=utf8
Copy code
2.1 linux mysql install
stay linux In the system , The installation steps are as follows :
1 You need to download the installation package file first ,mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
2 Unzip the file into the installation directory ,tar -xzvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz -C /usr/local
Create a soft connection ln -s mysql-5.7.18-linux-glibc2.5-x86_64 mysql
3 Create user groups and grant permissions
groupadd mysql -> useradd -r -g mysql -s /bin/mysql
cd /usr/local/mysql -> chown -R mysql:mysql ./
4 install mysql ./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize
5 Add configuration file my.cnf And add it to the self startup file cp support-files/mysql.server /etc/init.d/mysqld
6 restart mysql service mysqld restart
7 Establish database connection account alter user 'root'@'localhost' identified by 'rootroot';
Copy code
2.2 windows mysql install
windows install mysql Database services are generally similar to linux It's similar , But there are differences in specific steps .linux The configuration file on is my.cnf, windows The configuration file on is my.ini. The following is a mysql Installation steps of :
1 Set the environment variable , First of all mysql Home directory , MYSQL_HOME D:\mysql-5.7.23-winx64, Then set the path Variable Path %MYSQL_HOME%\bin
2 Use the administrator to open cmd Tools ,c:/windows/system32 Use cmd.exe , Open as Administrator cmd, Switch to mysql_home/bin
3 perform perform mysqld.exe -install
4 perform mysqld -initialize-insecure Initialize the installation environment
5 perform net start mysql / net stop mysql start-up / stop it mysql service
6 perform mysqld -initialize, To initialize , Type on the command line mysql -uroot -p Enter directly into the console .
7 Set up root password set password for [email protected]=password('xxxxxxx');
Copy code
2.3 Database state
After installing the database , type status, You can see the database information as shown in the figure , Can display the account number of the database , database information , Database version , Character information, connection information and protocol version of the database , Current thread information statistics, etc .
3 Database password modification
View the password related configuration of the current database :
show variables like 'validate_password%';
Copy code
As shown in the figure above , Specifies the length of the password, the length of mixed characters and the number of string lengths , Security level and other data configuration . Change account password :
# The account and password of the lower version are modified
set password for [email protected]'localhost' = password('123456');
# In the high version, there is no... In the database password Field of , You need to use the following methods to modify your password
alter user 'root'@'localhost' identified by '123456';
Copy code
4 summary
In this paper mysql Installation information of the database and password setting of the database .
版权声明
本文为[first quarter of the moon]所创,转载请带上原文链接,感谢
https:https://yzsam.com/html/EUHoQw.html
边栏推荐
- Promise (II)
- ASP. Net core configuration options (Part 1)
- Baidu Map Case - modify map style
- Preliminary understanding of promse
- Customize my_ Strcpy and library strcpy [analog implementation of string related functions]
- Seven cattle upload pictures (foreground JS + background C API get token)
- Promise (I)
- [C] thoroughly understand the deep copy
- Go language, array, string, slice
- . net type transfer
猜你喜欢
![[ES6] promise related (event loop, macro / micro task, promise, await / await)](/img/69/ea3ef6063d373f116a44c53565daa3.png)
[ES6] promise related (event loop, macro / micro task, promise, await / await)

RPC核心概念理解

Understanding of RPC core concepts

JS, entries(), keys(), values(), some(), object Assign() traversal array usage

Detailed explanation of Milvus 2.0 quality assurance system

线性代数感悟之1

.Net Core3. 1 use razorengine NETCORE production entity generator (MVC web version)

C语言函数详解

Net standard

On lambda powertools typescript
随机推荐
Clickhouse - data type
XTask与Kotlin Coroutine的使用对比
ClickHouse-数据类型
Manually implement simple promise and its basic functions
ASP. Net core configuration options (Part 2)
[related to zhengheyuan cutting tools]
Node template engine (EJS, art template)
[batch change MySQL table and corresponding codes of fields in the table]
RPC核心概念理解
Shell script -- shell programming specification and variables
Error in v-on handler: "typeerror: cannot read property 'resetfields' of undefined"
Header built-in object
Calculation formula related to tolerance analysis
How to use the input table one-way service to send (occupy less) picture files (body transmission)? FileReader built-in object involved
Baidu Map Case - modify map style
Model problems of stock in and stock out and inventory system
Oninput one function to control multiple oninputs (take the contents of this input box as parameters) [very practical, very practical]
Grpc gateway based on Ocelot
[markdown notes]
Read a blog, re understand closures and tidy up