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.
windows command line installation MySQL
1. Download the MySQL installation package
2. Unzip the folder to the directory you want
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
4. Enter the command line as an administrator, enter
cd C:\mysql\bin mysqld --install MySQL --defaults-file=C:\mysql\my.ini
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!