Java Series-Installing MySQL (iii)

Source: Internet
Author: User

First step: MySQL installation files are divided into two types, one in MSI format and one in ZIP format. If the MSI format can be directly clicked on the installation, according to the installation prompts it to install (I believe you can read English tips), General MySQL will be installed in C:\Program files\mysql\mysql Server 5.6 Directory The ZIP format is self-extracting, and after decompression, MySQL can actually be used, but to configure. Download http://dev.mysql.com/downloads/mysql/,

Select MySQL Community Server

64bit ZIP Archive, click Download.

MySQL is open source database, so-called open source is able to view the source code, I believe that many children's boots will be interested in this. So where is the source code?

When I just entered-(the first picture that address). There is a select Platform, choose the following source code on the line.

(similarly if you want to download MySQL under the Linux platform is also here to find)

Download complete, proceed to install and configure

Second Step: Install (Unzip)

The ZIP version archive is free to install. Just unzip the line. It's no different from the installation version, but it doesn't need to be installed. Find the downloaded Mysql-x.x.xx-winx64.zip right-click to select (Unzip to ... )

Step Three: Configure default files

3.1 Configuring Environment variables:

My Computer, properties, advanced environment variables

Select Path, after which you add: the path to your Mysql Bin folder (for example: C:\Mysql\mysql-5.7.16-winx64\bin)

3.2 Configuring the My.ini file:

After configuring the environment variables do not be busy to start MySQL, we also need to modify the configuration file (if not configured, after the start of the error will appear in the diagram Oh!). : Error 2 system cannot find file), mysql-5.7 default profile is in C:\Mysql\mysql-5.7.16-winx64\my-default.ini, or create a My.ini file yourself, modify or add configuration () in it:

[Mysqld]

Basedir = C:\Mysql\mysql-5.7.16-winx64
DataDir = C:\Mysql\mysql-5.7.16-winx64\data
Port = 3306

When installing the MySQL 5.7+ version, if it is found that the data folder is missing from the root directory, the other My.ini content is configured, the DataDir line is commented out, the cmd command window is opened, and the file is entered into the bin directory of the MySQL installation directory. Then enter the command:

Mysqld--initialize-insecure--user=mysql

Then enter, go to the directory to view, has automatically created a good data folder, problem solving!

Installing the MySQL Service

A start-up in the search bar inside the input cmd, the above will come out a cmd.exe, do not busy to determine, to right-click this cmd.exe select an administrator to run this option. Otherwise there will be an insufficient error code, the specific number of forgotten. This is a feature of Win7. You know, it's fine. If My.ini write wrong, the error code is 1067.

(You can also find this cmd.exe in the C:\Windows\System32 directory, also right-click it, as Administrator.) )

After the installation is successful, start the service, continue to enter in cmd: net start MySQL (), the service started successfully!

At this time many people will appear error, please see note:

Note: Error 2 and error 1067 often occur at this time.

If the "Error 2 system cannot find a file", check whether the configuration file has been modified or whether to enter the bin directory, if the configuration file is correct and enter the Bin folder, you need to remove MySQL (input mysqld-remove) and then reinstall (Input mysqld- Install);

If error 1067 occurs, it is a configuration file modification error, verify that the configuration file is correct.

After the service started successfully, you can log in, enter Mysql-u root-p (no password for the first login, press ENTER directly), Login success!

How to set Password: mysqladmin-u root-p password password.

Exit the exit and you're done. Remember to directly close the CMD window is not exited, to enter exit will not exit AH.

Precautions

My.ini files must be encoded in English (such as ANSI in Windows), not UTF-8 or GBK, so it is better to copy My-default.ini directly.

Java Series-Installing MySQL (iii)

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.