Properties->Advanced System Settings->Environment Variables" in sequence; then change the name of a file in the root directory to my.ini; finally Just start mysql."/> Properties->Advanced System Settings->Environment Variables" in sequence; then change the name of a file in the root directory to my.ini; finally Just start mysql.">

Home >Database >Mysql Tutorial >How to directly decompress and install mysql

How to directly decompress and install mysql

藏色散人
藏色散人Original
2020-11-02 10:43:596153browse

How to directly decompress and install mysql: first decompress mysql to any path; then open "Computer->Properties->Advanced System Settings->Environment Variables" in sequence; then change an Change the file name to my.ini; finally start mysql.

How to directly decompress and install mysql

Recommended: "mysql video tutorial"

mysql 5.5.x zip direct decompression version installation method

1. Go to the official website to download mysql-5.5.10-win32.zip, and then unzip mysql to any path, such as: C:\mysql-5.5.10-win32

2. Open Computer->Properties->Advanced System Settings->Environment Variables,

Create a new environment variable, the variable name is: MYSQL_HOME, and the variable value is your mysql root directory, such as: C: \mysql-5.5.10-win32

Then add in the system variable Path:;%MYSQL_HOME%\bin

3. There are several already written "my- ini file starting with ", choose the one that suits you, such as: my-small.ini.

Make a copy, change the file name to my.ini, and add the following content:

[mysqld] 
#设置字符集为utf8 
default-character-set = utf8 
basedir = C:/mysql-5.5.10-win32 
datadir = C:/mysql-5.5.10-win32/data 
 
[client] 
#设置客户端字符集 
default-character-set = utf8 
 
[WinMySQLadmin] 
Server = C:/mysql-5.5.10-win32/bin/mysqld.exe

4. Open the command prompt, enter the %MYSQL_HOME%/bin directory, and execute the command: mysqld - install installs mysql to windows service. After successful execution, it will prompt: C:\mysql-5.5.10-win32\bin>Service successfully installed.

If you want to uninstall the service, execute the command: mysqld -remove.

Then execute: net start mysql at the command prompt to start mysql. To stop the service, enter the command: net stop mysql.

If you want to set whether mysql starts automatically, you can enter service.msc in the Start menu -> Run to open the service management and set it.

5. When logging in for the first time, enter:

C:\Users\Administrator>mysql -u root

Change password:

Method 1:

mysql> update mysql.user set password=PASSWORD('root') where User='root' 
mysql> flush privileges

or

Method 2: Use mysqladmin

mysqladmin -u root password "newpass"

If root has set a password, use the following method

mysqladmin -u root password oldpass "newpass"

Method 3: Use UPDATE to directly edit the user table

   mysql -u root
  mysql> use mysql;
  mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
  mysql> FLUSH PRIVILEGES;

When you lose your root password, you can do this:

    mysqld_safe --skip-grant-tables&
  mysql -u root mysql
  mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';
  mysql> FLUSH PRIVILEGES;

6. There are blank rows in the MySQL user database. Delete them and it will be OK.

mysql> delete from user where user="";

The above is the detailed content of How to directly decompress and install mysql. 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