installation, configuration and operation of win under MySQL

Source: Internet
Author: User
Tags db2 mysql client mysql download mysql gui mysql gui tools

The job requires that a win2012 server is installed, and that Tomcat, Nginx, MySQL, and JDK are deployed on top to make the Java project run properly. Talk today about MySQL's installation configuration and some problem handling.

On the official website www.mysql.com,http://dev.mysql.com/downloads/mysql/, download the MySQL Compression pack version (Windows (x86, 64-bit), ZIP Archive ) Mysql-5.7.14-winx64.zip, distinguish between 64-bit and 32-bit. To download, you need to register an account to download normally.

a.650) this.width=650; "Src=" http://h.hiphotos.baidu.com/exp/w=500/sign=6b474c9d1bd8bc3ec60806cab28aa6c8/ 7c1ed21b0ef41bd5aaa8115353da81cb38db3d99.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>

B. After the opening will go to another page, but did not start to download, this time do not fear, do not understand it is OK, you just know that he is to let you log in (login), or apply for an account (sign up) on the line, login or successful application will start the download. (Remember the password to the combination of letters and numbers, letters should be uppercase)

650) this.width=650; "Src=" http://h.hiphotos.baidu.com/exp/w=500/sign=ce957736cf11728b302d8c22f8fdc3b3/ D043ad4bd11373f09d979738a60f4bfbfaed04e8.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>

C. Note: Passwords must be combined with letters and numbers, with uppercase letters

650) this.width=650; "Src=" http://c.hiphotos.baidu.com/exp/w=500/sign=67492b4ae51190ef01fb92dffe1a9df7/ 32fa828ba61ea8d31f638fa3950a304e241f58d0.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>

D. Of course, if you have an account, you can also log in directly

650) this.width=650; "Src=" http://a.hiphotos.baidu.com/exp/w=500/sign=c5797c6c41166d223877159476220945/ 3b87e950352ac65c80ba9dd4f9f2b21192138ade.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>

E. Click Downnow after success. File is not big, only 200 m, very soon, a little bit (after success is said to arrive below this place, but if you do not know this, you find it yourself, or directly quit, repeat the above steps, choose to login that just.

650) this.width=650; "Src=" http://e.hiphotos.baidu.com/exp/w=500/sign=843cc94fbe3eb13544c7b7bb961fa8cb/ D31b0ef41bd5ad6ed9f2814d83cb39dbb6fd3c09.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>

F.mysql is open source database, so-called open source is able to view sources, then where 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

650) this.width=650; "Src=" http://g.hiphotos.baidu.com/exp/w=500/sign=834014cb123853438ccf8721a312b01f/ 8435e5dde71190efc0ac7578cc1b9d16fcfa60c6.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>


Installation steps:

1, ZIP archive version is free of installation. 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 ... ), find the place you want to install, default is in C \, but try not to put it under C + +, my is D:\mysql under

2, into the decompression directory, click Mysqld.exe, there is a black box there is no response, how to start it?

No response because the service hasn't been opened yet!

No, it's not open, okay?

Service is not installed!

How to install?

Keep looking behind ...

3. Change the default configuration. In fact, in theory now it is possible to install the service directly, but because it is the default configuration, we use a lot of problems. For example, the Chinese characters are all garbled and so on, so it is recommended that you configure the default files first.

In Mysql-x.x.xx-winx64 (my mysql5.7.14, according to my version) directory, create a new My.ini (the simplest way is to copy My-default.ini renamed to My.ini). Copy the following code to save the OK. My.ini will replace the following My-default.ini file. ini file is a configuration file inside window. Save the various default data inside. The installation version of the installation is to let you choose your own and then the system to save you in, Zip archive is to write their own, all the same.

Such as:

650) this.width=650; "Src=" http://d.hiphotos.baidu.com/exp/w=500/sign=79ab0fa4ca95d143da76e42343f18296/ 2f738bd4b31c87019a875141257f9e2f0708ff60.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>


Code :(Put inside D:\mysql\mysql-5.7.14, change to own software path, save)

[MySQL]

# Set the MySQL client default character set

Default-character-set=utf8

[Mysqld]

#设置3306端口

Port = 3306

# set up the MySQL installation directory

basedir=d:\mysql\mysql-5.7.14

# Set up a storage directory for MySQL database data

Datadir=d:\mysql\mysql-5.7.14\data

# Maximum number of connections allowed

max_connections=200

# The character set used by the server is default to the 8-bit encoded latin1 character set, MySQL 5.5 starts Default-character-set This configuration is not necessary, to be renamed Character-set-server

Character-set-server=utf8

# The default storage engine that will be used when creating a new table

Default-storage-engine=innodb


4. Install MySQL Service

Start-to-face search bar input cmd, 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 permission error code, if the My.ini is 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.) )

Run cmd as administrator (be sure to run as administrator, or not have enough permissions),

Input: cd D:\mysql\mysql5.7.14\bin into the MySQL Bin folder (regardless of whether the environment variable has been configured, also to enter the Bin folder, or after the start of the service will still report error 2)

Enter Mysqld-install (if run without administrator, there will be an error due to insufficient permissions: Install/remove of the Service denied!)

650) this.width=650; "Src=" http://d.hiphotos.baidu.com/exp/w=500/sign=95e07954af6eddc426e7b4fb09dab6a2/ Eac4b74543a9822654e87c968882b9014a90eb52.jpg "class=" Exp-image-default "alt=" MySQL 5.6 for Windows uncompressed configuration Installation "/>

650) this.width=650; "Src=" http://h.hiphotos.baidu.com/exp/w=500/sign=36d2427c5066d0167e199e28a72bd498/ 8b82b9014a90f6037c845df63b12b31bb051ed4f.jpg "class=" Exp-image-default "alt=" MySQL 5.6 for Windows uncompressed configuration Installation "/>

650) this.width=650; "Src=" http://d.hiphotos.baidu.com/exp/w=500/sign=8d5573693887e9504217f36c2039531b/ B8389b504fc2d562be60ac47e51190ef76c66c2b.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>


Install the service , after opening the CMD window as an administrator, switch the directory to the bin directory of your extracted files, whichever is your own. Re-enter mysqld install enter run on the line, Note is mysqld, not MySQL

The service successfully installed is OK.

650) this.width=650; "Src=" http://h.hiphotos.baidu.com/exp/w=500/sign=36d2427c5066d0167e199e28a72bd498/ 8b82b9014a90f6037c845df63b12b31bb051ed4f.jpg "class=" Exp-image-default "alt=" MySQL 5.6 for Windows uncompressed configuration Installation "/>

(To borrow someone else's diagram, enter the directory should be the MySQL directory of their own)


Start the service , followed by the input net start MySQL startup service. Or do not bother to manually, open the service manually started the MySQL service.

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

650) this.width=650; "Src=" http://b.hiphotos.baidu.com/exp/w=500/sign=fda266c4d488d43ff0a991f24d1fd2aa/ Aa64034f78f0f736ae628db00855b319eac413e6.jpg "class=" Exp-image-default "alt=" MySQL 5.6 for Windows uncompressed configuration Installation "/>

(To borrow someone else's diagram, enter the directory should be the MySQL directory of their own)


The simple way to open the service interface is win. Open Task Manager (right-click Task Manager or Ctrl+alt+delete, whatever you like). The service below is OK, which is much simpler than the control Panel method. It is also possible to enter services.msc in the cmd window.

650) this.width=650; "Src=" http://h.hiphotos.baidu.com/exp/w=500/sign=e06565af99504fc2a25fb005d5dce7f0/ 6d81800a19d8bc3e7e7eef6d808ba61ea8d34527.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>


Steps go to >net start MySQL startup service, always start, view My.ini configuration and path are correct, find log file, Mysql.user not found, after initializing database

D:\mysql\mysql-5.7.14\bin>mysqld.exe--defaults-file= "D:\mysql\mysql-5.7.14\my.ini"--initialize--explicit_ Defaults_for_timestamp

After, in the start error for system error 2, cannot find the specified file, mysqld-remove MySQL reinstall is not, manual start in the service can not start, found on the Internet a solution, also solved my confusion, modify the registry key:

The decompression version does not specify the directory as installed, so you need to change the registry:

Hkey_local_machine-system-currentcontrolset-services-mysql (service name)-imagepath

Change:

"C:\Program files\mysql\bin\mysqld"--defaults-file= "C:\Program Files\mysql\my.ini" MySQL for

"D:\mysql\mysql5.7.14\bin\mysqld"--defaults-file= "D:\mysql\mysql5.7.14\my.ini" MySQL

(To change the path of the registry to the file path where the Mysqld.exe is located after it has been uncompressed)

After >net start MySQL or an error

and executed it again.

>mysqld-remove MySQL

>mysqld-install

>net start MySQL

Start Normal, Obi.


5. Configure the environment variables for MySQL

Right-click My Computer, properties, advanced system settings, environment variable->path-> edit, add at the rear

D:\mysql\mysql5.7.14\bin;

Or

Add variable

mysql_home=d:\mysql\mysql5.7.14

Path last added (most have; do not add; if it is at the top, it needs to be added at the top;)

;%mysql_home%\bin


6. Use

In cmd

Change Directory to D:\mysql\mysql5.7.14\bin

>mysql-uroot-p (the first use is no password, but I use the password, maybe it was just initialized when there is or 5.7 of itself.) It's not very clear.)

To find the login password, login password in the data directory (My.ini configuration of the DataDir directory) log files, such as mine is under the D:\mysql\mysql-5.7.14\data. The file name is computer name. Err; For example, My computer is named server-10, the password is in the Server-10.err file, open the file in Notepad or notepad++ or any text editor, ctrl+f, search password or [email Protected] keyword,

Find the following line of information:

2016-03-16t02:41:45.969406z 1 [Note] A temporary password is generated for [email protected]: R1DIABLW&HGP


The corresponding login password is r1diablw&hgp

>mysql-uroot-p

Enter the password found above

Mysql>set Password = password (' password ');

mysql>exit;

Login with new password

>mysql-uroot-p

New password

Mysql>show databases;

Mysql>create database XXX default CharSet UTF8;

Mysql>grant all privileges on * * to ' root ' @ ' localhost ' identified by ' password '


CMD (where environment variables are added):

To export a database command line:

Mysqldump-u database user name-P Database name > the exported database file

Example: Mysqldump-u root-p db1>g:\liongg.sql (Exporting the database db1 to a liongg.sql file)

After the carriage return, will prompt for the password, has the input without the direct carriage return, a moment can succeed.


To import a database command line:

Mysql-u database user name –p Database name < the imported database file

Example: Mysqldump-u root-p db2<g:\liongg.sql (New database DB2, importing Liongg.sql)

Method 2 : Do not bother to add system environment variables , directly with the Windows command operation. The first thing you need to do is go to the Bin folder in the MySQL installation directory to use commands such as Mysql.exe and Mysqldump.exe.

Start > run, enter cmd OK to open the Command Line window: Enter the MySQL installation directory D: Enter the path plus command line mysql\mysql5.7.14\bin\mysqldump-u root-p db1>g:\liongg.sql.

Other similar.


Win under MySQL must enter exit exit, otherwise it will not quit



7, the above for the command line management database, below are several commonly used graphical database management software

A few graphical management tools are recommended for you:

1, PhpMyAdmin

2, Mysqldumper

3, Navicat

4. MySQL GUI Tools

5. MySQL ODBC Connector


8. Delete MySQL unused files, make their files smaller optimization lib and other directories under Debug and *.pdb files

650) this.width=650; "Src=" http://g.hiphotos.baidu.com/exp/w=500/sign=50363529c91349547e1ee864664f92dd/ Cc11728b4710b912c6157b56c1fdfc0393452245.jpg "class=" Exp-image-default "alt=" mysql download installation, configuration and use (win7x64) "/>



Reference article:

Http://jingyan.baidu.com/article/597035521d5de28fc00740e6.html Baidu Experience

http://www.oschina.net/question/727667_121198 Open source China Community Forum

http://www.cnblogs.com/bigbigtree/archive/2013/06/05/3118739.html Bigbigtree Blog

http://www.cnblogs.com/wy811007/archive/2012/07/10/mysql_error.html Database Problem Collection

This article is from the cloud blog, so be sure to keep this source http://weimouren.blog.51cto.com/7299347/1836487

installation, configuration and operation of win under MySQL

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.