Home > Database > Mysql Tutorial > body text

How to install mysql using commands?

青灯夜游
Release: 2020-09-27 17:58:25
Original
4849 people have browsed it

Installation method: 1. Download the MySQL installation package from the official website and unzip it; 2. Use the cd command in the cmd command line to enter the MySQL bin directory; 3. Execute "mysqld --install MySQL --defaults-file =C:\mysql\my.ini" command.

How to install mysql using commands?

windows command line installation MySQL

1. Download the MySQL installation package

2. Unzip the folder to the directory you want

How to install mysql using commands?

3. Configuration File

Create a new my.ini configuration file and enter the following

# The following options will be passed to all MySQL clients  
[client]  
#password   = your_password
port        = 3306
[mysql]
#设置mysql客户端的字符集
default-character-set = utf8
# The MySQL server
[mysqld]
port        = 3306
#设置mysql的安装目录
basedir = c:/mysql
#设置mysql数据库的数据存放目录,必须是data或者/xxx-data
datadir = c:/mysql/data
#设置服务器段的字符集
character_set_server = utf8
Copy after login

4. Enter the command line as an administrator, enter

cd C:\mysql\bin
mysqld --install MySQL --defaults-file=C:\mysql\my.ini
Copy after login

Note: If you are prompted "Install/Remove of the Service Denied!", it means you are not using administrator mode

Complete the installation

5. The installation has been completed, now configure the environment variables for MySQL

Right-click My Computer->Advanced System Settings->Environment Variables

Find the Path variable, (both system and user, I usually use system variables)

Edit Path, add ";C:\mysql\bin" at the end, that's it, complete

The above is the detailed content of How to install mysql using commands?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!