当前位置:网站首页>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
边栏推荐
- [related to zhengheyuan cutting tools]
- Model problems of stock in and stock out and inventory system
- JSON deserialize anonymous array / object
- websocket
- El date picker limits the selection range from the current time to two months ago
- Abnormal resolution of Xiaomi camera
- Variable length parameter__ VA_ ARGS__ Macro definitions for and logging
- Use of todesk remote control software
- Customize my_ Strcpy and library strcpy [analog implementation of string related functions]
- Websocket (basic)
猜你喜欢

Solution architect's small bag - 5 types of architecture diagrams

C语言函数详解

Understanding of RPC core concepts

2. Electron's HelloWorld
![[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)

Grpc gateway based on Ocelot

If you start from zero according to the frame

Nacos + aspnetcore + Ocelot actual combat code
![Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers](/img/65/89473397da4217201eeee85aef3c10.png)
Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers

Bottom processing of stack memory in browser
随机推荐
Calculation formula related to tolerance analysis
[C#] 彻底搞明白深拷贝
Use of five routing guards
Devexpress GridView add select all columns
[registration] tf54: engineer growth map and excellent R & D organization building
VsCode-Go
Expression "func" tSource, object "to expression" func "tSource, object" []
Summary of common websites
Shell-入门、变量、以及基本的语法
Kingdee Cloud Star API calling practice
Use of shell awk command
How to use the input table one-way service to send (occupy less) picture files (body transmission)? FileReader built-in object involved
How does matlab draw the curve of known formula and how does excel draw the function curve image?
Seven cattle upload pictures (foreground JS + background C API get token)
Come out after a thousand calls
Go language, array, string, slice
Solution architect's small bag - 5 types of architecture diagrams
Manually implement call, apply and bind functions
Generation of barcode and QR code
Your brain expands and shrinks over time — these charts show how