Mysql Install bug Solution with general usage instructions

Source: Internet
Author: User
Tags mysql client

Problem Description:

when installing MySQL, the second reload can be a strange situation if the first installation is not successful. Through some attempts, it was found that the main reason for installing the previous tutorials was that the first installation was unsuccessful, but MySQL default port 3306 was already occupied. This causes the "service not to start" classic error to occur during the subsequent installation process, although each step is perfectly correct. The solution is described in detail below.

The solution is explained behind. First, to see the normal installation steps: (1) Download 1. Download the MySQL8.0.12 version from the Web,: https://dev.mysql.com/downloads/mysql/(2) Install here if the download is a ZIP package, Unzip directly to an installation directory to complete; the directory that the blogger extracts here is: D:\Mylargeprogram\Mysql\mysql-8.0.12-winx64. If you download the MSI file, double-click on it, follow the prompts, and remember that it is important to set the root password. (3) configuration The first step: Create a new My.ini file in the file directory, the code is as follows, the two work paths to their own follow the path.
[mysqld]# setting Port 3306=3306# Set up the MySQL installation directory Basedir=d:\mylargeprogram\mysql\mysql-8.0. A-winx64# Set the data storage directory for the MySQL database DataDir=d:\mylargeprogram\mysql\mysql-8.0. A-winx64\data# Maximum number of connections allowed Max_connections= $# Number of attempts to allow connection failures. This is to prevent someone from attempting to attack the database system from the host Max_connect_errors=Ten# The default character set used by the server is Utf8character-Set-server=utf8# default storage engine to use when creating a new tabledefault-storage-engine=innodb# default to use "Mysql_native_password" Plugin authentication default_authentication_plugin=mysql_native_password[mysql]# Setting the MySQL client default character setdefault-character-Set=utf8[client]# Set the default port to use when MySQL client connects to service Port port=3306default-character-Set=utf8
Second step: Execute mysqld--initialize-insecure instruction to configure, the installation path will generate a data folder by default

Step three: Then enter mysqld--install install the MySQL service prompt installation is successful fourth step: Start the service net start MySQL here if the display service start successfully on behalf of the successful installation, but here is generally the start of the service, the service cannot start the error. 【Solutions】:(1) can enter mysqld--console start to view the error message started, Bo main error message is 3306 Port has been occupied by another service, the start can not be done. This is the key to the problem. (2) go to find 3306 by who occupied it. The steps are as follows:
Start-run-cmd, enter Netstat-ano, look at the first column, followed by the port, find 3306, remember the corresponding PID
Then open Task Manager view, select column, check the PID (process identifier), and determine the process in Task Manager to find just the PID, see what the program occupies the port, turn it off in the restart MySQL will not pack port is occupied by the error

(3) Re-use MSQLD--remove Delete the service, and then delete the Data folder, re-execute the following three instructions to completeMysqld--initialize-insecuremysqld--installnet start MySQL appears following instructions success

(4) User settings (1) 1. CMD to the bin directory to execute mysql-uroot (no password required), you can enter, because the top is created with insecure (2) to change the password: The root user can be changed at the beginning of a blank password status, now it is possible to login with the new password.

(3): Log in to the MySQL environment

(4) also want to create some new users and authorize create user ' test ' @ ' localhost ' identified by ' your password ';
Grant all privileges on * * to [email protected] ' localhost ';
Run these two lines of SQL statement, again with the identity of test enter the password into the command line input: Mysql-utest-p return, and then enter the password just set to enter.

(5) Exit the MySQL environment if you want to exit the SQL environment and return to the normal CMD environment, enter exit return. Enter MySQL again to execute the 3rd (6) Simple execution of the statement show databases; You can see the default database

Use mysql;show Tables;select * from user, (7) CMD environment configuration: for easy start up

If you do not want the CD to the MySQL bin directory every time, you can configure the environment variables, the cmd command executes the mysql instruction will go to the environment variables to find the corresponding path. Right-click My Computer, properties, advanced system settings, environment variable->path-> edit, will download the full path of the extracted MySQL bin directory inside: C:\wamp-all\mysql-5.7.13\bin; Multiple are separated by semicolons.

Mysql Install bug Solution with general usage instructions

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.