[MySQL Advanced Road丨Part 2] Database Installation and Configuration
Method 1: Execute the command with the command line tool
Download address: MySQL download address
After entering the URL, click MySQL Community Server
:
Select version:
We choose version 5.7.24 in the historical version
Install to the MySQL folder on the D drive
Copy the bin directory path after decompression
Add the bin directory path to the Path of the system variable
Then add a configuration file mysql.ini and a data folder in the D:\Software\MySQL\mysql-5.7.24-winx64 directory
The content of the mysql.ini file is as follows:
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=D:\Software\MySQL\mysql-5.7.24-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\Software\MySQL\mysql-5.7.24-winx64\data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
win+R to open the control panel, input mysqld install
, the page echoes successful installation
NOTE If you get an error message when running a command
in cmd , this is usually due to a permission issue. To resolve this issue, there are a few things you can try:mysqld install
Install/Remove of the Service Denied!
-
Run cmd as administrator : Right-click on "Command Prompt" or "Windows PowerShell" and select "Run as Administrator". This will provide increased permissions and privileges to perform the install operation.
-
Make sure you have proper permissions : Check that your user account has sufficient permissions to install the service. Make sure you are an administrator on the computer or have appropriate privileges.
-
Check firewalls and security software : Some firewalls or security software may restrict the creation or modification of system services. Temporarily disable any firewall or security software, and retry running the "mysqld install" command.
Enter net start mysql
to start the service, the page will displayStart successfully
After the startup is successful, enter mysql -u root -p
and continue to press Enter.
Then enter again in cmd net start mysql
to start the service
After successful startup, entermysqladmin -u root -p password
Enter on the line enter password
Then set a password to suggest setting a simple and easy-to-remember password such root、user
as
If we want to log in to the local MySQL database, we only need to enter the following command:
mysql -u root -p
Press Enter to confirm, if installed correctly and MySQL is running, you will get the following response:
Enter password:
If the password exists, enter the password to log in, if it does not exist, press Enter to log in directly. After successful login, you will see the following prompt:
Welcome to the MySQL monitor…
At this point, the installation and configuration of MySQL has been completed.
Method 2: Install MySQL with msi
If you have multiple errors when using method 1 to install and configure the database, you can use method 2 to install MySQL.
Download link: MySQL download address
As shown in the picture:
As shown in the picture:
As shown in the picture:
As shown in the picture:
install to folder
The steps are as shown in the figure:
As shown in the picture:
Wait for the download to complete
The steps are as shown in the figure:
The configuration is as follows:
The steps are as shown in the figure:
Proceed as follows:
Proceed as follows:
Proceed as follows:
Proceed as follows:
Proceed as follows:
Proceed as follows:
Proceed as follows:
Proceed as follows:
After that click continuouslyFinishcan
If the following page appears, the installation is successful:
OpenCommand Line Client
Enter the password: root
to use MySQL
Summarize
The above is[MySQL Advanced Road丨Part 2] Database Installation and Configuration
Follow-up will share [MySQL Advanced Road丨Part 3]MySQL management and connection
I am Qiu said , see you next time.