Home >Database >Mysql Tutorial >What to do if mysql zip installation fails

What to do if mysql zip installation fails

藏色散人
藏色散人Original
2020-10-27 09:59:072375browse

Solution to the failure of mysql zip installation: First download MySQL and decompress it; then create a new file "my.ini" in the decompressed path; then add the code "default-character-set=utf8..." ;Finally, complete the installation through the mysqld install command.

What to do if mysql zip installation fails

Recommendation: "mysql video tutorial"

MySQL5.7.17, it seems to be the latest version now, download address

Here you can choose your own platform version and choose your own download. Mine is the windows version. It should be more or less the same.

Downloaded files Let’s talk about the ZIP version here. I haven’t tried the MIS version and don’t know about it.
As a reminder here, it is best todownload the version without debug, because I downloaded it once and the installation failed in the end because there was no ini file, which caused many problems.

After decompression is completed, just put it into a created file.

The decompressed file has the default configuration file (my-default.ini), create a new file in the decompressed path: my.ini (copy the my-default.ini file, and then change it above ), copy the following code into it. F:\mysql appears twice in the code. This is the decompression path of my MySQL. You can replace it according to your own path.

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8 
[mysqld]
#设置3306端口
port = 3306 
# 设置mysql的安装目录
basedir="F:\mysql"
# 设置mysql数据库的数据的存放目录
datadir="F:\mysql\data"
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

Run the command prompt as administrator (Right-click the icon in the lower left corner, I forgot its name. There is a command prompt running as an administrator there. You must use this icon to directly What R), switch to the bin directory of MySQL, enter the mysqld install command (note that it is mysqld instead of mysql) and press Enter to install MySQL, as shown in the following figure: Because I have downloaded and installed it here, it shows that the service already exists. Yours should show that the service was created successfully.

Now that the installation is complete, we have the last step to start running it once.

Enter net start mysql to start MySQL, enter net stop mysql to shut down the MySQL service . It’s still the same problem. Mine has been completed, and yours should be starting up, with the words "starting successful".

Configure the environment variables here. Different Windows versions have different environment variables. They are roughly in System and Security-System-Advanced System Settings-Environment Variables. , we find a path environment variable here, click edit, then click edit text, and add the path to the bin of your own MySQL under its path; be sure to remember to add ## after each path segment. #";".

#Some people may have some problems here. Unfortunately, I also encountered them.

Some people will have a problem that startup fails.

Solution: After installing MySQL, open the cmd command window and enter the bin directory in the MySQL installation directory, then enter the following command and press Enter: mysqld –initialize-insecure –user=mysql

After executing the above command, MySQL will create a data folder and build a default database. The logged-in user name is root and the password is empty. Then You can start the mysql service through the command net start mysql.

After that, I just did it myself. But it is under cmd. Not a graphical interface. The two better graphical interfaces are workbench and sqlyog developed by MySQL itself. There is a tutorial for installing workbench later.

The above is the detailed content of What to do if mysql zip installation fails. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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