{"rsdb":{"rid":"155939","subhead":"","postdate":"0","aid":"117056","fid":"57","uid":"1","topic":"1","content":"

1.\u5173\u95ediptables<\/p>

# chkconfig iptables off<\/p>

2.\u4fee\u6539selinux<\/p>

# setenforce 0 \u4e34\u65f6\u5173\u95ed \u91cd\u542f\u540e\u65e0\u6548<\/p>

Or<\/p>

\u76f4\u63a5\u4fee\u6539\/etc\/selinux\/config \u6587\u4ef6<\/p>

\u5c06SELINUX=enforcing\u6539\u4e3aSELINUX=disabled<\/p>

\u91cd\u542f\u673a\u5668\u5373\u53ef<\/p>

3.\u65b0\u589emysql\u7528\u6237\u7ec4<\/p>

# groupadd mysql<\/p>

# useradd -r -g mysql mysql<\/p>

4.\u65b0\u5efa\u6570\u636e\u5e93<\/a>\u6267\u884c\u6587\u4ef6\u76ee\u5f55(\u540e\u9762\u4f1a\u628a\u7f16\u8bd1\u597d\u7684mysql\u7a0b\u5e8f\u5b89\u88c5\u5230\u8fd9\u4e2a\u76ee\u5f55)<\/p>

# mkdir -p \/usr\/local\/mysql<\/p>

5.\u65b0\u5efa\u6570\u636e\u5e93<\/a>\u6570\u636e\u6587\u4ef6\u76ee\u5f55<\/p>

# mkdir -p \/mysql\/data<\/p>

# mkdir -p \/mysql\/logs<\/p>

# mkdir -p \/mysql\/temp<\/p>

6.\u7f16\u8f91PATH\u641c\u7d22\u8def\u5f84<\/p>

# vi \/etc\/profile<\/p>

\u5728profile\u6587\u4ef6\u672b\u5c3e\u589e\u52a0\u4e24\u884c<\/p>

PATH=\/usr\/local\/mysql\/bin:\/usr\/local\/mysql\/lib:$PATH<\/p>

export PATH<\/p>

\u4f7fPATH\u641c\u7d22\u8def\u5f84\u7acb\u5373\u751f\u6548<\/p>

# source \/etc\/profile<\/p>

7.\u7f16\u8f91my.cnf\u6587\u4ef6<\/p>

# vi \/etc\/my.cnf<\/p>

(\u65b9\u6cd5\u540c\u6e90\u7801\u7f16\u8bd1\u5b89\u88c5)<\/p>

8.\u8bbe\u7f6e\u8f6f\u76ee\u5f55<\/p>

# ln -s mysql-5.6.28-linux-glibc2.5-x86_64 mysql<\/p>

# chown -R mysql:mysql \/usr\/local\/mysql<\/p>

9.\u521d\u59cb\u5316<\/p>

shell> scripts\/mysql_install_db --user=mysql<\/p>

shell> chown -R root .<\/p>

shell> chown -R mysql data<\/p>

\uff08\u770b\u5230\u4e24\u4e2aOK\u8bf4\u660e\u521d\u59cb\u5316\u6210\u529f\uff09<\/p>

10.\u542f\u52a8\u5b9e\u4f8b<\/p>

\/usr\/local\/mysql\/bin\/mysqld_safe --user=mysql & (&\u662f\u5728\u540e\u53f0\u8fd0\u884c)<\/p>

11.\u8fd0\u884cmysql<\/p>

\/usr\/local\/mysql\/bin\/mysql -S \/tmp\/mysql.sock \u542f\u52a8MySQL<\/p>

Ps: \u5b89\u88c5\u65f6\u9047\u5230\u7684\u95ee\u98981<\/p>

\u521d\u59cb\u5316\u6ca1\u6709\u6210\u529f<\/p>

\u542f\u52a8\u5b9e\u4f8b\u540e \u67e5\u770b\/mysql\/logs\/errolog.log\u7684\u5185\u5bb9 \u51fa\u73b0\u62a5\u9519<\/p>

\u770b\u5230\u4e00\u6761 permission denied<\/p>

\u5e94\u8be5\u5c31\u662f\/mysql\/temp\/\u7684\u6743\u9650\u95ee\u9898 \u7136\u540e\u6211\u5c31\u53bb\u770b\u4e86\u4e00\u4e0b\u6743\u9650<\/p>

[root@linux1 \/]# ls -l<\/p>

drwxr-xr-x. 5 root root 4096 Dec 7 18:28 mysql<\/p>

\u6539\u4e00\u4e0bmysql\u6587\u4ef6\u5939\u7684\u6743\u9650<\/p>

[root@linux1 \/]# chown -R mysql:mysql mysql<\/p>

[root@linux1 \/]# ls -l<\/p>

drwxr-xr-x. 5 mysql mysql 4096 Dec 7 18:28 mysql<\/p>

\u7136\u540e\u628a\/mysql\/data \/mysql\/logs \/mysql\/temp \u4e0b\u7684\u5185\u5bb9\u5168\u90e8\u5220\u9664<\/p>

\u518d\u53bb\u91cd\u65b0\u505a\u521d\u59cb\u5316\u7684\u6b65\u9aa4<\/p>

\u53d1\u73b0\u521d\u59cb\u5316\u6210\u529f<\/p>

\u542f\u52a8\u5b9e\u4f8b\u540e\u67e5\u770berror log\u770b\u5230<\/p>

\u8bf4\u660e\u542f\u52a8\u6210\u529f\uff0c\u53ef\u4ee5\u8fd0\u884cmysql\u4e86~<\/p>

\u5b89\u88c5\u65f6\u9047\u5230\u7684\u95ee\u98982<\/p>

\u8bbe\u7f6e\u8f6f\u8fde\u63a5\u6ca1\u6709\u6210\u529f<\/p>

\u89e3\u51b3\u65b9\u6cd51\uff1a\u4e0d\u8bbe\u7f6e\u8f6f\u8fde\u63a5\uff0c\u76f4\u63a5\u5c06\u89e3\u538b\u597d\u7684mysql-5.6.28-linux-glibc2.5-x86_64\u76f4\u63a5\u91cd\u547d\u540d\u4e3a mysql<\/p>

# mv mysql-5.6.28-linux-glibc2.5-x86_64 mysql<\/p>

\u89e3\u51b3\u65b9\u6cd52\uff1a\u5c06\u4e00\u5f00\u59cb\u65b0\u5efa\u7684mysql\u6587\u4ef6\u5939\u5220\u9664\uff0c\u76f4\u63a5\u8bbe\u7f6e\u8f6f\u8fde\u63a5\u5c31\u53ef\u4ee5\u4e86\uff0c\u5b83\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2amysql\u7684\u8f6f\u8fde\u63a5\u7684\u6587\u4ef6\u5939\uff0c\u8f6f\u8fde\u63a5\u7684\u6587\u4ef6\u5939\u4e3a\u6de1\u84dd\u8272<\/p>

# rm -rf mysql<\/p>

# ln -s mysql-5.6.28-linux-glibc2.5-x86_64 mysql<\/p>","orderid":"0","title":"CentOS 6.8 \u4e0b\u8f7dMySQL 5.6 \u4e8c\u8fdb\u5236\u5305\u5b89\u88c5","smalltitle":"","mid":"0","fname":"\u6570\u636e\u5e93\u7f16\u7a0b","special_id":"0","bak_id":"0","info":"0","hits":"57","pages":"1","comments":"0","posttime":"2017-01-02 08:14:55","list":"1483316095","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"http:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"CentOS<\/A> 6.8<\/A> \u4e0b\u8f7d<\/A> MySQL<\/A> 5.6<\/A> \u4e8c\u8fdb\u5236<\/A> \u5b89\u88c5<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"14.17.22.31","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"CentOS 6.8 \u4e0b\u8f7dMySQL 5.6 \u4e8c\u8fdb\u5236\u5305\u5b89\u88c5","lastview":"1493276963","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}