d:cd D:\MySQL\mysql-5.7.21-winx64\binmysqld --defaults-file=D:\MySQL\mysql.inimysqld --initialize-insecure#安装服务mysqld --install#启动服务mysqld --console#关闭、启动服务net stop mysql net start mysql#删除服务sc delete mysql#请求链接mysql -u root -p#选择数据库USE mysql;#修改root密码update user set authentication_string=password('qiaobo123') where user='root' and Host='localhost';#给任意IP 访问GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'qiaobo123' WITH GRANT OPTION;grant all privileges on *.* to 'root'@'localhost' identified by 'qiaobo123' with grant option;grant all privileges on *.* to 'root'@'%' identified by 'qiaobo123';GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'qiaobo123' WITH GRANT OPTION;FLUSH PRIVILEGES;#跳过验证开启安全模式mysqld --skip-grant-tables#查看端口被那个占用?netstat -aon|findstr "3306"tasklist|findstr 2816;#杀进程taskkill /f /t /im mysqld.exe#杀进程taskkill /pid 2816 -t -f;39.105.36.86#打开服务services.msc
mysql配置项:
[mysql]# 设置mysql客户端默认字符集default-character-set=utf8 [mysqld]#设置3306端口port = 3306 # 设置mysql的安装目录basedir=D:\MySQL\mysql-5.7.21-winx64# 设置mysql数据库的数据的存放目录datadir=D:\MySQL\data# 允许最大连接数max_connections=200# 服务端使用的字符集默认为8比特编码的latin1字符集character-set-server=utf8# 创建新表时将使用的默认存储引擎default-storage-engine=INNODB
技术交流QQ群:15129679