This article mainly introduces the actual operation process of installing and configuring green MySQL. We have correctly installed and configuring color MySQL in the environment of MySQL5.1, and has a detailed introduction to it, the following is the detailed content of the article.
Install and configure green MySQL:
I downloaded MySQL 5.1.
:
Http://dev.mysql.com/downloads/mysql/
Download the free installation 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 the character set of the mysql server
- 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 preceding 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 is complete, 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:
- E:\erlangPro\mysqlTest\src>mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 8
- Server version: 5.1.39-community MySQL Community Server (GPL)
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> use mysql
- Database changed
- mysql> update user set passwordpassword=password('admin') where user='root';
- Query OK, 2 rows affected (0.03 sec)
- Rows matched: 2 Changed: 2 Warnings: 0
- mysql>
Log out of MySQL and restart the MySQL service. The above content introduces the installation and configuration of the green version of MySQL. I hope you will get some benefits.