mysql在centos上的编译安装
程序员文章站
2024-02-07 17:51:22
...
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
shell>
groupadd mysql
shell>useradd -r -g mysql mysql
shell>tar zxvf mysql-
shell>VERSION
.tar.gzcd mysql-
shell>VERSION
cmake .
shell>make
shell>make install
shell>cd /usr/local/mysql
shell>chown -R mysql .
shell>chgrp -R mysql .
shell>scripts/mysql_install_db --user=mysql
shell>chown -R root .
shell>chown -R mysql data
shell>bin/mysqld_safe --user=mysql &
安装完了 ,启动的时候就报错:
/usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2 - No such file or directory)
cd /var/run/
mkdir mysqld
chown -R mysql mysqld
chgrp -R mysql mysqld
再重新启动:
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
修改:/usr/local/mysql/my.cnf
datadir =/usr/local/mysql/data
重启电脑
mysql.server start 启动成功
./bin/mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
执行这个命令后,成功运行mysql
推荐阅读
-
mysql在centos上的编译安装
-
在Mac OS上编译安装Nginx+PHP+MariaDB开发环境的教程,nginxmariadb
-
在Windows上安装FFmpeg程序的图文方法
-
分布式队列服务MemcacheQ在Linux系统下的编译安装
-
CentOS 7 安装解压版mysql5.7的教程
-
在Windows主机上定时备份远程VPS(CentOS)数据的批处理_MySQL
-
在Windows 95/98/NT上安装 PHP、MySQL、phpMyAdmin
-
solaris 11中怎么在没有安装mysql的机器下使用mysql_connect等函数
-
MySQL 5.0在Windows上安装三步骤
-
在CentOS/RHEL6.2/5.8,Fedora17/16上安装Nginx/PHP-FPM环境