win10 installation MySQL5.6.

I divided two ways to download and install for everyone to see, pay attention to this thing database is not the latest version does not care, care about is stable enough, and now the company is commonly used version mysql5.5 and mysql5.6, I now use mysql5 .6 version to you to demonstrate this:

The first method of installation download:

  mysql Download: https://dev.mysql.com/downloads , if you are there to download, see the operation:

    img

    And selection in the following manner:

    img

  If you download the mysql installation program, which is called the end of the expansion .msi file, then when you install on the installation of such a graphic manner the following tutorial.

  img

  img

  Select Custom mode here, because my computer is 64-bit, x64 choice

  img

  img

  img

  img

  img

  img

  img

  img

  img

  

  At this point, the installation is complete. To add the path C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin system variables into the environment variable "Path"

  Right-click on My Computer -> Click Properties

  img

  img

  img

  img

  Finally, open cmd, enter mysql -u root -p, and press Enter, if Welcome words appear, indicating that mysql installation was successful.

  img

The second download installation methods:

  mysql Download: https://dev.mysql.com/downloads, if you downloaded mysql official website zip archive, see the operation , attention and different download site first method above :

  img

  Then the following options to download, discover a zip archive right, zip compression after decompression can be used, the above msi also need to install it, the installation can be selected with a lot depends on the installation environment:

  img

    Click download to come:

  img

  Installed after the download is complete:

  1. Extracting archive MySQL, MySQL will download the compressed package extract to a custom directory. I put D: \ Program Files \ MySQL 

    img

  1. After the extraction is completed in fact can be used, but for convenience, that is, when cmd start mysql, they do not add the full path, so add the environment variable, the bin folder added to the environment variable, this bin file there mysqld server folder, there is a built-in mysql client, so after adding environment variables, in cmd can be directly used.

    img

    

    img

    This will be our mysql server (mysqld) and comes with a mysql client (for the user to test the machine, and it is used under the cmd window, called the mysql client, back when the operation will be used to)

    We then directly in the cmd window you can start the mysql server, and can be viewed from inside the Task Manager.

    img

    Then we start a cmd window to look at the use of mysql client, and then open the service connection at our end, we can succeed.

    Connection command is: mysql -h server IP address -P (uppercase) 3306 (mysql server default port) -uroot (user, here I use to measure the root user) -p password. Note: If this direct input password, middle and front -p password with no spaces.

    I tested this machine, so I wrote the mysql server IP address for the loopback address my native 127.0.0.1, in fact, if it is their test mysql server side of the machine, we can not write ip address and port time, write directly mysql -uroot -p, but mysql connection must write other computer IP address and port, and can not connect to a remote mysql server computer with other root, and pay attention to the firewall on the server mysql whether to allow 3306 to be connected to an outsider, even if you want others to change the firewall settings to allow him 3306 port is connected, directly or turn off the firewall (not recommended for direct closed, when the test can be used), otherwise it will error.

    img

    ip address 127.0.0.1 addition to writing, you can also write localhost, or your own ip address of the machine, but write ip address of the machine when the server will your client considered external device, so you are not allowed landing.

    When the unit test their own connections, you can not write ip address and port

    img

    So far, we would be able to connect to and use mysql database, but you find that shut down mysql server is too much trouble started when we entered directly Enter to start the mysqld

    There are two ways to close:

      1. turn off the server through Task Manager:

        img

      2. Close to the server through the cmd command mysql

        img

        img

    So we can be controlled by means of system services on or off mysql service, then the service will need to be added to the system mysql service, look at how to make the system services:

        Open cmd window Note: You must open an administrator cmd window, find the place in the lower left corner of the circle, click, and then enter cmd, matching up the command prompt, and then right-click to open as Administrator

        img

        img

        Then enter mysqld --install service name (can give the service a name, directly behind this directive, can not write, there is a default, the latter can view)

        img

        This will add a system service

        Then + r win key operation to open the window, which system services to open the input list services.msc

        img

        You can see the mysqld service, if not to click on the refresh button

        img

        Select the MySQL service this one, we can directly see the right features, there are startup and shutdown function, you can start and shut down the MySQL service in the form of system services, this service is enabled by default, we can also set whether self automatic start-up behavior, etc., left double-click the service you will see the following window.

        img

        

      After the addition of system services, we, can use two commands in cmd windows startup and shutdown services to get this mysql:

      Start command: net start mysql

      Close command: net stop mysql

      And can not be reused mysqld instructions directly started.

      img

      You can also remove system services just added through the instruction:

        Cmd command to remove the service: mysqld remove

Guess you like

Origin www.cnblogs.com/liwenhu/p/11431886.html