File tree Expand file tree Collapse file tree 1 file changed +20
-15
lines changed Expand file tree Collapse file tree 1 file changed +20
-15
lines changed Original file line number Diff line number Diff line change 1
- # Mysql 安装和配置
1
+ # MySQL 安装和配置
2
2
3
3
4
- ## Mysql 安装
4
+ ## MySQL 安装
5
5
6
6
- Mysql 安装
7
7
- 官网:< http://www.mysql.com/ >
44
44
- 常用命令软连接,才可以在终端直接使用:mysql 和 mysqladmin 命令
45
45
- ` sudo ln -s /usr/program/mysql/bin/mysql /usr/bin `
46
46
- ` sudo ln -s /usr/program/mysql/bin/mysqladmin /usr/bin `
47
-
47
+ - 开放防火墙端口:
48
+ - `sudo iptables -I INPUT -p tcp -m tcp --dport 3306 -j ACCEPT`
49
+ - `sudo service iptables save`
50
+ - `sudo service iptables restart`
48
51
49
52
## 修改 root 账号密码
50
53
63
66
- 重启 MySQL 服务:`service mysql restart`
64
67
65
68
66
- ## Mysql 配置
69
+ ## MySQL 配置
67
70
68
71
- 官网配置参数解释:< http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.html >
69
72
- 找一下当前系统中有多少个 my.cnf 文件:` find / -name "my.cnf" ` ,我查到的结果:
70
- ``` nginx
71
- /etc/my.cnf
72
- /usr/program/mysql/my.cnf
73
- /usr/program/mysql/mysql-test/suite/ndb/my.cnf
74
- /usr/program/mysql/mysql-test/suite/ndb_big/my.cnf
75
- .............
76
- /usr/program/mysql/mysql-test/suite/ndb_rpl/my.cnf
77
- ```
78
- - 保留 **/etc/my.cnf** 和 **/usr/program/mysql/mysql-test/** 目录下配置文件,其他删除掉。
79
- - 我整理的一个单机版配置说明(MySQL 5.6,适用于 1G 内存的服务器):
80
- - [my.cnf](MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-comprehensive.cnf)
73
+
74
+ ``` nginx
75
+ /etc/my.cnf
76
+ /usr/program/mysql/my.cnf
77
+ /usr/program/mysql/mysql-test/suite/ndb/my.cnf
78
+ /usr/program/mysql/mysql-test/suite/ndb_big/my.cnf
79
+ .............
80
+ /usr/program/mysql/mysql-test/suite/ndb_rpl/my.cnf
81
+ ```
82
+
83
+ - 保留 ** /etc/my.cnf** 和 ** /usr/program/mysql/mysql-test/** 目录下配置文件,其他删除掉。
84
+ - 我整理的一个单机版配置说明(MySQL 5.6,适用于 1G 内存的服务器):
85
+ - [my.cnf](MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-comprehensive.cnf)
81
86
82
87
83
88
## MySQL 主从复制
You can’t perform that action at this time.
0 commit comments