Green version of MySQL installation and configuration

Source: Internet
Author: User

Operation Steps:
First, install MySQL database


1. Download the Mysql-5.6.17-winx64.zip file.
2, extract to the specified directory, this example is D:\mysql-5.6.17-winx64.
3, modify the configuration file, My-default.ini name to: My.ini, the parameters in the file configuration:
[Mysqld]
# set up the MySQL installation directory
basedir=d:/mysql-5.6.17-winx64
# Set the data storage directory for MySQL database, must be
datadir=d:/Mysql-5.6.17-winx64/data
Note: The path is a backslash, can also be changed to two forward slash, you can also 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 MySQL Service
Locate cmd.exe under Path C:\Windows\System32, right-click to run as Administrator (Win 7 under strict distinction between permissions, must be 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: Be sure to change "-defaults" to "--defaults", mysqld directive does not have the-D option, while MySQL in parsing parameters, as long as the encounter xxxx-dxxxx will be the D as an option to deal with.
MySQL defaults to find C:\my.ini and C:\windows\my.ini, My.ini or my.cnf in the installation directory.
5. mysql Service start and stop
Under the doc command, go to the MySQL bin directory (d:\ mysql-5.6.17-winx64\bin>),
Enter "net start MySQL" to start MySQL,
Enter "net stop MySQL" to stop the MySQL service.


Second, the root password modification and login


1. Login
Log in to the MySQL database (local) in the Doc Command window, enter the command: Mysql-u root–p
Enter the password when prompted.
Note: MySQL decompression version of the initial installation of administrator root password is empty, so direct return to the MySQL database once again login.

remote Login (extension) configuration
Mysql-h 192.168.80.109-u root–p
Mysql-h 192.168.80.109-u root-p123456
Comments:
-H is the specified login IP,
-u Specifies the user,
-P Specify the password, after-p if nothing is written, then the next prompt to enter the password,-P can also be directly written on the password, so that no longer need to enter a password.
2. Change the root password
To start the MySQL service, enter the command:
Use MySQL
Using the MySQL data source, the doc command box enters
Update Mysql.user set Password=password (' NewPassword ') where user= ' root ';
Doc Command Box and enter:
Flush privileges;
MySQL new setup user or change password after use flush privileges refresh the MySQL system permission related table, otherwise there will be denied access, there is another way, is to restart the MySQL server for the new settings to take effect.

Precautions:

When this step occurs, the following issues may occur:
ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' MySQL '.
Reason:
Because the user table of the MySQL database, there is an account named empty, the anonymous account, resulting in the login is the use of root, but the actual anonymous login, through the error message "@" localhost can be seen.
Workaround:
Method One:

1. Turn off MySQL
# Service Mysqld Stop
2. Blocking permissions
# Mysqld_safe--skip-grant-table
Screen appears: 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 to say this, otherwise if you close the previous terminal, the original error will appear
Mysql> \q
Method Two:
1. Turn off MySQL
# Service Mysqld Stop
2. Blocking permissions
# Mysqld_safe--skip-grant-table
Screen appears: Starting demo from .....
3. Start a new terminal input
# mysql-u Root MySQL
mysql> Delete from user where user= ';
Mysql> FLUSH privileges;//Remember to say this, otherwise if you close the previous terminal, the original error will appear

Green version of MySQL installation and configuration

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.