当前位置:网站首页>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
边栏推荐
- [C] thoroughly understand the deep copy
- groutine
- How to sort the numbers with text in Excel from small to large instead of the first number
- ASP. NET CORE3. 1. Solution to login failure after identity registers users
- Self use learning notes - connected and non connected access to database
- Metaprogramming, proxy and reflection
- Milvus 2.0 détails du système d'assurance de la qualité
- Use of Shell sort command
- Get the column name list of the table quickly in Oracle
- Understanding of RPC core concepts
猜你喜欢

Understanding of RPC core concepts

ASP. Net core dependency injection service life cycle

XTask与Kotlin Coroutine的使用对比
![[PROJECT] small hat takeout (8)](/img/54/0187eeb637f4dcd4ad3969b00e2b77.png)
[PROJECT] small hat takeout (8)

2.Electron之HelloWorld

Clickhouse table engine

VLAN advanced technology, VLAN aggregation, super VLAN, sub VLAN

基于51单片机红外无线通讯仿真

1-4 configuration executable script of nodejs installation
![[WPF binding 3] listview basic binding and data template binding](/img/2e/fbdb4175297bb4964a8ccfd0b909ae.png)
[WPF binding 3] listview basic binding and data template binding
随机推荐
Read a blog, re understand closures and tidy up
Use of five routing guards
Net standard
Come out after a thousand calls
Understanding and small examples of unity3d object pool
Clickhouse SQL operation
1-2 characteristics of nodejs
Indexes and views in MySQL
线性代数感悟之1
.Net Core3. 1 use razorengine NETCORE production entity generator (MVC web version)
Use between nodejs modules
JS, entries(), keys(), values(), some(), object Assign() traversal array usage
[WPF binding 3] listview basic binding and data template binding
Self use learning notes - connectingstring configuration
Handwritten event publish subscribe framework
First knowledge of go language
Shell-sed命令的使用
Shell-cut命令的使用
Using quartz under. Net core -- job attributes and exceptions of [4] jobs and triggers
How does matlab draw the curve of known formula and how does excel draw the function curve image?