MySQL configuration installation and root password changes

Source: Internet
Author: User
Tags change settings dedicated server

The first step:

Modify the My.ini file to replace it with the following (skip_grant_tables*** focus )

# for advice The Change settings see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html# Do not EDIT the this FILE. It's a template which 'll be copied to the# ***defaultLocation during install, and would be replacedifyou#***upgrade to a newer version of MySQL. [mysqld]# Remove Leading # andSetTo the amount of RAM forThe most important data# cacheinchMysql. Start at -% of Total RAM forDedicated server,Else Ten%. # innodb_buffer_pool_size=128m# Remove Leading # to turn on a very important data integrity option:logging# changes to the binary log between backups.# log_bin# These is commonlySet, remove the # andSet  asrequired.# Basedir=.... # datadir=..... # Port=.... # server_id=... # Remove leading # toSetOptions mainly useful forreporting servers.# The server defaults is faster fortransactions and fast selects.# Adjust sizes asneeded, experiment to find the optimal values.# join_buffer_size=128m# sort_buffer_size=2m# read_rnd_buffer_size=2M ######################################################### [client] Port=3306    default-character-Set=UTF8 [mysqld] skip_grant_tables Port=3306Character_set_server=UTF8 Basedir=e:\mysql-5.7. --winx64 #解压目录 DataDir=e:\mysql-5.7. --winx64\data #解压目录下data目录 Sql_mode=no_engine_substitution,strict_trans_tables [winmysqladmin] E:\mysql-5.7. --winx64\bin\mysqld.exe########

Step Two:

Go to the MySQL installation directory, press shift+ (right mouse button) Click the Command Line window to initialize with Mysqld--initialize (will create a data folder in the installation directory)

Step Three:

Enter command line mode under the installation directory folder shift+ (right mouse button) using net start MySQL startup service

Login with mysql-uroot-p without password

After entering

mysql> use MySQL;

mysql> Update user set Authentication_string=password ("123") where user= "root"; (don't forget the last semicolon)

Mysql>flush privileges;

mysql>quit;

Fourth Step:

Entering the My.ini file will Skip_grant_tables comments

Re-entry command line

net stop MySQL

net start MySQL (restart service)

Mysql-uroot-p

(log in with the changed password)

succeed;

*************************************************************************************************************** *********

Last hint: If the net start MySQL prompt cannot start the service, and no prompt error can be removed from the Data folder reinitialization start

MySQL configuration installation and root password changes

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.