Installation and configuration of MySQL green decompress version, mysql green decompress version

Source: Internet
Author: User

Installation and configuration of MySQL green decompress version, mysql green decompress version

The MySQL version used in this example is the MySQL-5.6.17-winx64.

[For more information, see http://blog.csdn.net/mahoking]


Procedure:
1. Install the MySQL database


1. Download The mysql-5.6.17-winx64.zip file.
2. Decompress to the specified directory, in this example, D: \ mysql-5.6.17-winx64.
3, modify the configuration file, my-default.ini name changed to: my. ini, file parameters in the Configuration:
[Mysqld]
# Set the installation directory of mysql
Basedir = D:/mysql-5.6.17-winx64
# Set the data storage directory of the mysql database, which must be data
Datadir = D:/mysql-5.6.17-winx64/data
Note: The path is a backslash. You can also change it to two forward slashes and add double quotation marks,
Example: datadir = "D: \ mysql-5.6.17-winx64 \ data"
# Mysql Port
Port = 3306
# Character Set
Character_set_server = utf8
SQL _mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES

4. Install the MySQL Service
Find cmd.exe in the path C: \ Windows \ system32and right-click it to run as an administrator. (permissions are strictly differentiated under win 7 and must be set as administrator)
Automatic: mysqld -- install [service name]
Manual: mysqld -- install-manual [service name]
Mysqld-install MySQL -- defaults-file = "D :\ mysql-5.6.17-winx64 \ my. ini"
Note: You must change "-defaults" to "-- defaults". The mysqld command does not have the-d option, while MYSQL does not parse parameters, if you encounter xxxx-dxxxx,-D will be treated as an option.
Mysql finds c: \ my. ini and c: \ windows \ my. ini by default, and my. ini or my. cnf under the installation directory.
5. Start and Stop the mysql Service
Go to the mysql bin directory (D: \ mysql-5.6.17-winx64 \ bin>) under the doc command ),
Enter "net start mysql" to start mysql,
Enter "net stop mysql" to stop the mysql service.


Ii. root Password modification and logon


1. log on
(Local) log on to the mysql database. In the doc command window, enter the command: mysql-u root-p.
Enter the password.
Note: The password for installing the administrator root for the first time in mysql decompress is blank. Therefore, you can directly press enter to log on to the mysql database.

Remote Login (extended) Configuration
Mysql-h 192.168.80.109-u root-p
Mysql-h 192.168.80.109-u root-p123456
Note:
-H indicates the logon ip address,
-U indicates the user,
-P specifies the password. If no password is written after-p, the system will prompt you to enter the password. After-p, you can directly write the password, so that you no longer need to enter the password.
2. Modify the root password
Start the mysql service and enter the following command:
Use mysql
Use the mysql data source and enter the "doc" command box.
Update mysql. user set password = PASSWORD ('newpassword') where User = 'root ';
Enter the following in the doc command box:
Flush privileges;
Mysql needs flush privileges to refresh the MySQL system permission table after setting a user or changing the password. Otherwise, access is denied. Another method is to restart the mysql server, to make the new settings take effect.

Note:

In this step, the following problems may occur:
ERROR 1044 (42000): Access denied for user ''@ 'localhost' to database 'mysql '.
Cause:
In the user table of the mysql database, an account with an empty username is an anonymous account. As a result, the user logs on to the database anonymously, even though the user name is root, you can see the '@ 'localhost' in the error message.
Solution:
Method 1:

1. Disable mysql
# Service mysqld stop
2. Block Permissions
# Mysqld_safe -- skip-grant-table
The screen displays: Starting demo from .....
3. Start a new terminal Input
# Mysql-u root mysql
Mysql> UPDATE user SET Password = PASSWORD ('newpassword') where USER = 'root ';
Mysql> flush privileges; // remember this sentence. Otherwise, if you close the previous terminal, the original error will occur.
Mysql> \ q
Method 2:
1. Disable mysql
# Service mysqld stop
2. Block Permissions
# Mysqld_safe -- skip-grant-table
The screen displays: Starting demo from .....
3. Start a new terminal Input
# Mysql-u root mysql
Mysql> delete from user where USER = '';
Mysql> flush privileges; // remember this sentence. Otherwise, if you close the previous terminal, the original error will occur.
Mysql> \ q

 

3. Uninstall installed MySQL


You can view it in the Service Manager of Windows. "Start"-> "run", enter "services. msc", and press Enter. The Windows Service Manager is displayed, and the service item "MySQL" is displayed.
Go to D: \ mysql-5.6.17-winx64 \ bin> under the doc command and enter "mysqld-remove" or "SC delete mysql" to run the uninstall service.

 

[For more information, see http://blog.csdn.net/mahoking]

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.