MySQL 5.7.16 install and give remote connection permissions

Source: Internet
Author: User
Tags mysql client

The ZIP version archive is free to install. Just unzip the line. No installation is required. I put it on the D-plate.



1. Configuration:
that is the origin of the My.ini file .
My-default.ini (this file is extracted, bring the file) Copy the rename My.ini, and then replace it with the following code: (Change the inside D:\mysql\mysql-5.6.17-winx64 to your own software path, save)

(The contents of the newly created My.ini file are as follows.) Remember to modify the path inside. )


[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.6.17-winx64
# Set up a storage directory for MySQL database data
Datadir=d:\mysql\mysql-5.6.17-winx64\data
# Maximum number of connections allowed
max_connections=200
# The character set used by the service side defaults to the 8-bit encoded latin1 character set
Character-set-server=utf8
# The default storage engine that will be used when creating a new table
Default-storage-engine=innodb


My My.ini file is as follows: (The specific directory in the above can see where my MySQL installation, and the following content consistent.) )



2. Install the MySQL service and start it:
that is the origin of the Data folder .
After you open the CMD window as an administrator, switch the directory to the bin directory where you unzipped the files
Then enter mysqld install Enter to run the line
Then the input net start MySQL startup service
Error!!!
"The server failed to start and the server did not report any errors. ”
And then...
Re-enter mysqld--initialize-insecure--user=mysql
(after executing the above command, MySQL will build a data folder, and set up the default database, login user name is root, password is empty)
Start again: Re-enter the net start MySQL startup service, OK successful. The above is copied from a blog elsewhere! Feel useful to keep a copy in case you forget that day!

3. To remote connection permissions:

problem: The remote connection to MySQL database appears error 1130:host ' root ' is not allowed to connect to this MySQL server error when resolving!

to modify root permissions

Use MySQL;
SELECT ' host ' from USER WHERE user= ' root ';
UPDATEUSER SET HOST = '% ' WHERE USER = ' root ';
Flushprivileges; Special Note: This is important.

The first sentence is to log in as the user root with permissions
Second sentence: select MySQL Library
The third sentence: View the host value of the user table in the MySQL library (hosts/IP names that can be accessed by the connection)
Clause Four: Modify the host value (increase the hostname/IP address with the wildcard%), or you can directly add
The second sentence: Refresh the MySQL system permissions related tables;

So that it can be done;


MySQL 5.7.16 install and give remote connection permissions

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.