mysql-5.6.16-winx64 installation-free version configuration under windows

I haven't installed mysql for a long time. I will install it today. It took a long time to install it, and I will record it

1. Download the mysql free installation version and extract it to a folder (assuming F:\Program Files\mysql-5.6.16-winx64)

2. Add the environment variable of MYSQL_HOME: F:\Program Files\mysql-5.6.16-winx64

3. Create a file F:\Program Files\mysql-5.6.16-winx64\my.ini with the following contents

[mysqld]
# These are commonly set, remove the # and set as required.
basedir = F:/Program Files/mysql-5.6.16-winx64
datadir = F:/Program Files/mysql-5.6.16-winx64/data
port = 8306
character_set_server=utf8
init_connect='SET NAMES utf8'
# server_id = .....

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

4. Open a cmd in administrator mode and enter F:\Program Files\mysql-5.6.16-winx64\bin

5、执行 mysqld --install mysql --defaults-file=F:\Program Files\mysql-5.6.16-winx64\my.ini

6. Execute net start mysql to start mysql

7. When you execute mysql -uroot -p and ask for a password, press Enter. If the installation is successful, you can connect to mysql

 

other:

1. Uninstall the mysql service

     a) 管理域权限cmd进入F:\Program Files\mysql-5.6.16-winx64\bin,执行mysqld -remove

     b) 或者在命令行里面执行sc delete mysql

2、有其他问题,就先卸载mysql服务(上面两个命令都执行一次),然后再重新安装,如果重新安装再出错误重启下电脑再重新安装

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326044804&siteId=291194637