Skip to content

Instantly share code, notes, and snippets.

@1242035
Created August 29, 2019 14:34
Show Gist options
  • Save 1242035/a9f53228f4f98b6bc342ae98677d387d to your computer and use it in GitHub Desktop.
Save 1242035/a9f53228f4f98b6bc342ae98677d387d to your computer and use it in GitHub Desktop.
Install mysql service window
1. download mysql bin zip at: https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.17-winx64.zip
2. extract to H:\tools\mysql\8.0.17
3. add add H:\tools\mysql\8.0.17\bin t system path
4. create database dir: H:\tools\mysql\database
5. run command: mysqld --initialize --datadir=H:\tools\mysql\database
6. install service by command: mysqld --install me-server-mysqld --defaults-file=H:\tools\mysql\conf\my.cnf
7. create text file passwors.txt
8. set password for user root: mysqld --defaults-file=H:\tools\mysql\conf\my.cnf --init-file=H:\tools\mysql\conf\password.txt
9. start service
password.txt
SET PASSWORD FOR 'root'@'localhost' = '123456';
my.cnf
[mysqld]
# set basedir to your installation path
basedir=H:\\tools\\mysql\\8.0.17\\
# set datadir to the location of your data directory
datadir=H:\\tools\\mysql\\database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment