IWSPythoner

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

首先:my.ini 配置文件中 路径需要改成自己电脑mysql解压的路径.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
####################配置文件开始###################
 
 # For advice on how to change settings please see
 
 
 # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
 
 # *** default location during install, and will be replaced if you
 
 # *** upgrade to a newer version of MySQL.
 
 [client]
 
 default-character-set=utf8
 
  
 
 [mysqld]
 
 port=3306
 
 basedir ="D:\mysql\mysql-5.7.13-winx64/"
 
 datadir ="D:\mysql\mysql-5.7.13-winx64/data/"
 
 tmpdir ="D:\mysql\mysql-5.7.13-winx64/data/"
 
 socket ="D:\mysql\mysql-5.7.13-winx64/data/mysql.sock"
 
 log-error="D:\mysql\mysql-5.7.13-winx64/data/mysql_error.log"
 
  
 
 #server_id = 2
 
 #skip-locking
 
  
 
 max_connections=100
 
 table_open_cache=256
 
 query_cache_size=1M
 
  
 
 tmp_table_size=32M
 
 thread_cache_size=8
 
  
 
 innodb_data_home_dir="D:\mysql\mysql-5.7.13-winx64/data/"
 
 innodb_flush_log_at_trx_commit =1
 
 innodb_log_buffer_size=128M
 
 innodb_buffer_pool_size=128M
 
 innodb_log_file_size=10M
 
 innodb_thread_concurrency=16
 
 innodb-autoextend-increment=1000
 
 join_buffer_size = 128M
 
 sort_buffer_size = 32M
 
 read_rnd_buffer_size = 32M
 
 max_allowed_packet = 32M
 
 explicit_defaults_for_timestamp=true
 
 sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
 
 skip-grant-tables
 
 #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
 
####################配置文件结束###################

 

 

 

 

 

初始化mysql服务

mysqld --install MySQL

启动mysql服务

net start mysql

登录mysql

mysql -uroot -p

修改密码

mysql> update user set authentication_string=PASSWORD('123456') where User='root';

 

 

刷新数据库

 

FLUSH PRIVILEGES;

 

修改外网权限

针对所有服务器都可以访问

 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

 

修改@% 可以指定IP

 

posted on 2017-08-17 04:40  IWSPythoner  阅读(2073)  评论(0编辑  收藏  举报