1.mysql download
- Select the corresponding version download address
Here we download mysql-8.0.17-winx64
2. Unzip
-
Unzip and create the root directory after unzip
my.ini
anddata
folder -
basedir: Replace with your own root directory
< /ul>
my.ini:
[client]# Set the default character set of the mysql client default-character-set=utf8 [mysqld] # Set 3306 port port = 3306# Set mysql installation directory basedir=D:\develop\mysql\mysql-8.0.17-winx64\mysql-8.0.17-winx64# Allow maximum number of connections max_connections=1000max_user_connections=500wait_timeout=200# The character set used by the server defaults to the 8-bit encoding latin1 character set character-set-server=utf8# The default storage engine that will be used when creating a new table default-storage-engine=INNODB
3. Open the command line
< ul>
4. Initialize the database
mysqld --initialize --console
After success, there will be an initial password, remember this initial password
5. Install the database
mysqld install
6. Start mysql service
net start mysql
7. Log in to mysql and enter the initial password above
mysql -u root -p
8. Set a new password
< pre class="cmd">ALTER?USER?’root’@’localhost’?IDENTIFIED?BY?’123456′;
Here I use the online
set password for [email protected] = password('new password');
prompt me that the statement is wrong