mysql5.7 installation
First
download
https://downloads.mysql.com/archives/community/
First download the mysql5.7.18zip installation package
Choose 32/64 bit version according to computer configuration
second
decompress
Unzip the compressed package to the path you specified, the red my.ini is generally not available, you need to create a new one yourself.
third
Configure environment variables
Configure environment variables: Control Panel -> System and Security -> System -> Advanced System Settings
fourth
Create a new text document directly in the bin folder and rename it to my.ini. If the permissions are not enough, you can move it to the bin directory after the desktop is created. In the my.ini configuration
[mysql]
# Set mysql client default character set
default-character-set=utf8
[mysqld]
# Set 3306 port
port = 3306
# Set mysql installation directory
basedir=E:\program\mysql-5.7.22-winx64
# Set The data storage directory of the mysql database
datadir=E:\program\mysql-5.7.22-winx64\data
# The maximum number of connections allowed
max_connections=200
# The character set used by the server defaults to 8-bit encoded latin1 character set
character-set -server=utf8
# The default storage engine that will be used when creating new tables
default-storage-engine=INNODB
fifth
Create a new data folder in the mysql root directory. Make sure that data is an empty folder before installation.
sixth
Run cmd command as administrator
Enter cd E:\program\mysql-5.7.22-winx64
Enter the bin directory
Enter mysqld --initialize --user=mysql --console and note the random password generated by the last line
Then enter mysqld --install
my input this command refuses
It's unknown for what reason
The following are not entered directly
Connect to mysql but I don't know which random password appears?
Just enter any password. This should not require a password. Enter whatever you want.
But the password is still unknown. Then change the password, the modification method of 5.7 is different from that of 5.1.
Shut down the running MySQL:
[[email protected] ~]# service mysql stop
run
[[email protected] ~]# mysqld_safe --skip-grant-tables &
For security you can disable remote connections like this:
[[email protected] ~]# mysqld_safe --skip-grant-tables --skip-networking
Use mysql to connect to the server:
[[email protected] ~]# mysql -p
change the password:
mysql> update mysql.user set authentication_string=password(' 123456 ') where user='root' and Host = 'localhost'; ///123456 own new password
*It is important to note that there is no Password field in the user table under the new version of the mysql database.
Success will display the Servers Successfully installed console input
net start mysql start mysql service
I refer to this to change the password
The address to change the password can refer to this
http://www.jb51.net/article/77858.htm