Procedure for installing green MySQL

Source: Internet
Author: User
Tags win32 window

The following articles mainly describe the actual steps for installing and configuring MySQL in the green version. we install MySQL 5.1 in the environment. We all know that MySQL is installed in multiple versions, however, the installation steps of many versions are too complex, so the following articles mainly list a simple installation method.

I downloaded MySQL 5.1.

Download the green-free mysqlinstallation package (mysql-noinstall-5.1.45-win32.zip)

Decompress the compressed file to E: \ MySQL-5.1.39-win32

1. Add E: \ MySQL-5.1.39-win32 \ bin in the path of the system environment variable Note: This is my MySQL installation path)

2. Edit the MySQL run configuration file my. ini. If not, copy the my-medium.ini and name it my. ini

Copy one copy to E: \ MySQL-5.1.39-win32 and C: \ WINDOWS respectively

Edit the my. ini file.

[MySQLd]

Set the installation directory for green MySQL

Basedir = E:/MySQL-5.1.39-win32/

Set the data storage directory of the MySQL database, which must be data or \ xxx \ data

Datadir = E:/MySQL-5.1.39-win32/data Set MySQL Server Character Set

Default-character-set = utf8

[Client]

Set the character set of the MySQL client

Default-character-set = gbk

Note: The configuration in the split line is optional. You can set it when creating a database.

3. Install the MySQL Service

Enter the directory E: \ myserver \ MS-DOS \ bin from the MySQL-5.0.37-win32 window and run the following command:

MySQLd -- install MySQL5 -- defaults-file = C: \ WINDOWS \ my. ini

MySQL5 is only the name of the service. You can set it by yourself. For example, change it to xiaomai.

That is, MySQLd -- install xiaomai -- defaults-file = C: \ WINDOWS \ my. ini

4. Start the MySQL database

In the above command window, enter the command: net start MySQL5

In this way, the MySQL service is started.

5. Stop the service

Execute net stop MySQL5.

6. After the installation of green MySQL in the preceding five steps, the default root user password of MySQL is blank.

You can set the root password:

Win + R-> Enter cmd-> open the windows command console and locate the file directory at will, as shown below:

 
 
  1. E:\erlangPro\MySQLTest\src>MySQL -u root -p  
  2. Enter password:  
  3. Welcome to the MySQL monitor. Commands end with ; or \g.  
  4. Your MySQL connection id is 8  
  5. Server version: 5.1.39-community MySQL Community Server (GPL)  
  6. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  7. MySQL> use MySQL  
  8. Database changed  
  9. MySQL> update user set passwordpassword=password('admin') where user='root';  
  10. Query OK, 2 rows affected (0.03 sec)  
  11. Rows matched: 2 Changed: 2 Warnings: 0  
  12. MySQL> 

Log out of MySQL and restart the MySQL service.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.