Win7 installation MySQL-5.7.16 process, win7mysql-5.7.16

Source: Internet
Author: User

Win7 installation MySQL-5.7.16 process, win7mysql-5.7.16

1. Create a MYSQL folder on drive C;
2, copy the mysql-5.7.16-winx64 to the C: \ MYSQL folder, renamed mysql-5.7.16;
3, in the mysql-5.7.16 directory, create my. ini file, the content is as follows:
[Mysql]
# Set the default Character Set of the mysql client
Default-character-set = utf8
[Mysqld]
# Set port 3306
Port = 3306
# Set the installation directory of mysql
Basedir = C :\mysql \ mysql-5.7.16
# Set the directory for storing mysql database data
Datadir = C: \ MYSQL \ mysql-5.7.16 \ data
Tmpdir = C: \ MYSQL \ mysql-5.7.16 \ data
# Maximum number of connections allowed
Max_connections = 200
# The default character set used by the server is the 8-bit latin1 character set.
Character-set-server = utf8
# The default storage engine used to create a new table
Default-storage-engine = INNODB

4、use the authority to run cmd.exe, enter the C: \ MYSQL \ mysql-5.7.16 \ bin directory;
5. Execute the command: mysqld -- initialize-insecure -- user = mysql, the data directory is automatically created under the C: \ MYSQL \ mysql-5.7.16 directory;
6. Run the command mysqld install to install MySQL;
7. Execute the command: net start mysql and start MySQL;
8. Open MySQL and execute the command: mysql-uroot-p. By default, there is no password. Enter the password and press Enter;
How to set the password: mysqladmin-u root-p password
(Mysqladmin-u root-p password mysql)
9. SQL used:
-> Show databases; find the database
-> Use Database Name; Switch database directory
-> Show tables; query tables
-> Select * from table name for SQL query
-> Exit.

10. Create your own database:
Create database name;
Grant select, INSERT, UPDATE, DELETE, CREATE, DROP, alter on database name. * TO database name @ localhost identified by 'Password ';
Set password for 'database name' @ 'localhost' = OLD_PASSWORD ('Password ');

Create database lfhdb;
Grant select, INSERT, UPDATE, DELETE, CREATE, DROP, alter on lfhdb. * to lfhdb @ localhost identified by 'mysql ';
-- The following error is returned.
Set password for 'lfhdb' @ 'localhost' = OLD_PASSWORD ('mysql ');

11. Remote Logon Settings:
Grant all PRIVILEGES on LFHDB. * to root @ '10. 211.55.2 'identified by 'mysql ';

LFHDB. * indicates the table to which the preceding permissions are for, LFHDB indicates the database, and * indicates all the tables,
It can be inferred that the authorization for all tables in all databases is "*. *",
Authorize "database name. *" for all tables in a database and "database name. Table Name" for a table in a database ".

Root indicates the user you want to authorize. This user can be an existing user or a non-existing user.

10.211.55.2 indicates the IP address that allows remote connection. If you want to restrict the IP address, set it to "%.

Mysql is the user's password.


How to enable MySQL Remote Account-3) execute the preceding statement and then execute the following statement to take effect immediately.
> Flush privileges;

 

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.