Installation and configuration of the "MySQL" MySQL5.7

Source: Internet
Author: User
Tags mysql client mysql download

First, the download of MySQL  1. Log in to MySQL download zip archive for 64-bit system (https://dev.mysql.com/downloads/mysql/) second, unzip the package to extract the downloaded zip archive to any folder. (here: C:\mysql5.7) Third, modify the configuration file will unzip the folder directory My-default.iniFile is renamed to My.ini。 Open and clear the contents with a text editor. Add content (refer to Internet):[MySQL]# Set the MySQL client default character set

Default-character-set=utf8

[Mysqld]#设置3306端口Port = 3306# Set up the MySQL installation directorybasedir=c:\mysql5.7# Set up a storage directory for MySQL database dataDatadir=c:\mysql5.7\data# Maximum number of connections allowedmax_connections=200# The character set used by the service side defaults to the 8-bit encoded latin1 character SetCharacter-set-server=utf8# The default storage engine that will be used when creating a new tableDefault-storage-engine=innodbNote:Basedir and DataDir are replaced with their own actual paths. The MySQL5.7 version of the compressed package after the initial decompression of the folder directory does not include the Data folder, do not worry, the following will be initialized with the command to create. Manual creation is not required here. Save exit after the modification is complete. Iv. Configure Environment Variables add C:\mysql5.7\bin (here as the path to the actual bin directory) in the PATH environment variable NOTE: With the preceding environment variable; run the cmd window with MySQL as Administrator. Switch to the C:/mysql5.7/bin directory and enter the following commands sequentially: 1. Mysqld install waits for prompt installation to succeed 2. Mysqld--initialize initializes the data directory 3. net start MySQL start service Six, modify the root user's password after the completion of the above five steps to run Mysql-u root-p, because the root user is not the default password, directly enter into. Prompt error:ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)This is because the root user of MySQL does not set a password, we need to temporarily ignore the permissions to set the root user's password. The operation is as follows: Add a line of statements under the [MYSQLD] entry in profile My.ini Skip_grant_tables save exit, and restart the MySQL service without restarting the MySQL service has no effect.         After restarting, run Mysql-u root-p prompt to enter the password directly into the MySQL in order to enter the following SQL statement 1.use MySQL;       Show Database changed2.update user set Authentication_string=password ("123456") where user= "root";     In parentheses for the password you want to set 3.flush privileges; Refresh the database, be sure to refresh the 4.quit exit to delete or comment out the skip_grant_tables in profile My.ini seven, the initial landing of some settings in the first login to MySQL can not be used directly, you need to reset the password again, otherwise you will be wrongERROR 1820 (HY000): Must SET PASSWORD before executing this statementInput command: Set Password=password (' 123456 ');  Consistent with the password set in the previous step, MySQL is ready to use, and the root user is only able to connect via the local computer, as learning is sufficient. If you need to connect remotely, you need to set the SQL statement as follows:Use MySQL;show tables;select Host,user from user;Update user set host= '% ' where user= ' root ';quitnet stop MySQLnet start MySQLNote:The host column specifies that the ip,% that is used to allow the user to log on is a wildcard character, and the setting to% means that any IP can access root

Installation and configuration of the "MySQL" MySQL5.7

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.