How to install mysql on windows

132 阅读1分钟

Download mysql

Download it from here:
dev.mysql.com/downloads/m…

Install mysql

  1. unzip it and open terminal (run as administrator)
  2. change directory to xxx-mysql-xxxx/bin
$ cd <your mysql path>/bin
  1. create my.ini and set basedir and datadir
# xxxx-mysql/bin/my.ini
basedir=<your mysql path>/bin
datadir=<your mysql path>/data
  1. create data folder under /bin
  2. initialize mysql
$ mysqld --initialize

will get temperate passcode under file data/xxx.err

  1. install mysql
$ mysqld --install

Start server

$ net start mysql

Use temperaty password access mysql db

$ mysql -u root -p  # then input the temperary password

change password

$ mysqladmin -uroot -proot password <newpassword>