Method: 1. Download the MySQL compressed package from the mysql official website and decompress it; 2. Configure environment variables; 3. Create a new my.ini file under the mysql path and configure it; 4. The administrator runs the cmd command line , enter the "mysqld install" command, and press Enter to display the service.
MySQL compressed package is installed using dos command
Step 1:
Configure environment variables, enter the bin directory in the mysql compressed package file, copy the path, and paste it in the system variable path
Second step:
Create a record in my.ini under the mysql path
[mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [mysqld] #设置3306端口 port = 3306 # 设置mysql的安装目录 basedir=F:\mysql8.0.14(填上你的mysql安装目录) # 设置mysql数据库的数据的存放目录 datadir=F:\mysql8.0.14\data((填上你的mysql安装目录,data不用创建 它自己会创建的) # 允许最大连接数 max_connections=200 # 服务端使用的字符集默认为8比特编码的latin1字符集 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB
Step 3:
The administrator runs cmd, enters mysqld install and the service is installed. OK
Then enter mysqld --Initialize and there will be a suffix in the data folder. err file, the initial password is in it. Be sure to remember this. I have been fooled many times by online trolls.
Wait for completion and no error will be reported. There will be no prompt message in the dos box when it is completed.
Step 4:
Use mysql -uroot -p. Add a space between bars, otherwise it won’t work. Just enter the initial password. Enter mysql
Step 5:
Modify the encryption method If you want to use the nativemysql management tool, you must do this step
use mysql;
select user,plugin from user ;
You can see the root encryption method
Then modify the statement
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Then modify the password
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('The password you want to set');
The statement can be copied directly. The number is also haha, otherwise MySQL cannot be terminated
If any error occurs in the above process, it is very simple to reinstall
Open the registry regedit
Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\EventLog\Application\MySQLD Service
##Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\EventLog\Application \MySQLD Service
Follow this path and delete the mysql
dos command and execute sc delete mysql to delete the service
If MySQL cannot be executed when running dos, then execute cmd in the bin directory and then operate
Recommended tutorial:The above is the detailed content of How to install mysql using dos command?. For more information, please follow other related articles on the PHP Chinese website!