Mysql installation and FAQs

Source: Internet
Author: User

Mysql installation and FAQs

I downloaded the MySQL compressed package and encountered a lot of problems when I started the configuration. Below I will record it and hope to help you with the same problem.

Decompress the package to the specified folder, create a txt file named my. ini, and write the following content.

[Mysql] # set the default character set of the mysql client default-character-set = utf8 [mysqld] # set port 3306 to port 3306 # set the mysql installation directory basedir = C: \ mysql-5.7.12-winx64 # Set the mysql database data storage directory datadir = C: \ mysql-5.7.12-winx64 \ data # maximum number of connections allowed max_connections = 200 # the character set used by the server defaults to an 8-bit latin1 character set character-set-server = utf8 # The default storage that will be used when creating a new table engine default-storage-engine = INNODB

After saving the file, copy it to the MySQL bin directory.

 

The absence of data folders invalidates many configuration methods on the Internet. If Initialization is not performed, the mysql service cannot be started. The initialization method is as follows:

Run cmd as an administrator and cd it to the bin directory in mysql. Run the command: mysqld -- initialize -- user = mysql -- console.

This command creates the data DIRECTORY and database to generate the root user and temporary password. For example, remember this password to facilitate logon.

 

Remember to configure the environment variables: Right-click this computer (Computer)-properties-advanced system settings-advanced-environment variables, and add your bin directory to the Path in the system variables, for example :; c: \ mysql-5.7.12-winx64 \ bin

Then install the mysql Service

Open cmd as an administrator and enter mysqld -- install in the bin directory of MySQL.

Be sure to enter the bin directory. Otherwise, the following error will occur when running mysql:

At this time, if you enter the bin directory for installation, an error will occur,

Because the same files have been installed, you must first remove the original files and enter the bin directory and enter the command mysqld -- remove

Then enter the command mysqld -- install in the bin directory to install the mysql service.

Finally, enter the command net start mysql to run the mysql service. After Entering mysql-u root-p, press enter and enter the temporary password that begins to be written down to the database.

After entering the database, you can change the password: set password = password ('new password'); and then press Enter. Note that the semicolon cannot be omitted.

 

If the problem persists, visit the following website:

Http://blog.csdn.net/mhmyqn/article/details/17043921 this is written for the blogger on the installation of mysql problems encountered in the article is very comprehensive,

 

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.