Home > Database > Mysql Tutorial > body text

mysql在centos上的编译安装

WBOY
Release: 2016-06-01 13:16:02
Original
815 people have browsed it

CentOS

环境:centos6.5  mysql-5.6.17.tar.gz

wgethttp://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz

yum install -y gcc gcc-c++ gcc-c++.x86_64 bison.x86_64 libaio.x86_64 cmake.x86_64 ncurses-devel.x86_64

后面根据官方文档: MySQL 5.6 Manual 2.8.2 Installing MySQL Using a Standard Source Distribution

<code>shell></code><strong><code> groupadd mysql</code></strong>shell> <strong><code>useradd -r -g mysql mysql<br></code></strong>
Copy after login
shell> <strong><code>tar zxvf mysql-<em><code>VERSION</code></em>.tar.gz</code></strong>shell> <strong><code>cd mysql-<em><code>VERSION</code></em></code></strong>shell> <strong><code>cmake .</code></strong>shell> <strong><code>make</code></strong>shell> <strong><code>make install<br></code></strong>shell> <strong><code>cd /usr/local/mysql</code></strong>shell> <strong><code>chown -R mysql .</code></strong>shell> <strong><code>chgrp -R mysql .</code></strong>shell> <strong><code>scripts/mysql_install_db --user=mysql</code></strong>shell> <strong><code>chown -R root .</code></strong>shell> <strong><code>chown -R mysql data</code></strong>shell> <strong><code>bin/mysqld_safe --user=mysql &<br>安装完了 ,启动的时候就报错:<br>/usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2 - No such file or directory)<br>cd /var/run/<br>mkdir mysqld<br>chown -R mysql mysqld<br>chgrp -R mysql mysqld<br>再重新启动:<br>[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist<br>修改:/usr/local/mysql/my.cnf<br>datadir =/usr/local/mysql/data<br>重启电脑 <br>mysql.server start 启动成功<br>./bin/mysql<br>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)<br>ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock<br>执行这个命令后,成功运行mysql<br></code></strong>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template