linux下mysql5.5的安装 博客分类: mysql mysqllinux
程序员文章站
2024-03-18 15:43:01
...
MySQL 5.5使用InnoDB作为默认的数据库存储引擎
下载:http://www.mysql.com/downloads/
mysql 5.5需要用cmake来编译:
安装cmake,及相关包:
yum install -y \
cmake\
gcc \
gcc-c++ \
ncurses-devel \
bison \
libaio
解压 mysql5.5.tar.gz ,编译:
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/data/mysqldata \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_TCP_PORT=3306 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DMYSQL_USER=mysql \
-DWITH_DEBUG=0
然后执行:
make && make install
可以用echo $? 检查每步结果,为0的话就表示成功.
如果想重新make,需清除cmake用:
make clean
rm -f CMakeCache.txt
设置:
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /usr/local/mysql/bin/
chmod 755 /usr/local/mysql/bin/mysql.server
chown -R mysql.mysql /usr/local/mysql
cd /usr/local/mysql
mkdir /data/mysqldata
scripts/mysql_install_db --user=mysql
cp -rpf /usr/local/mysql/data/* /data/mysqldata
vim /etc/my.cnf 请在[mysqld]下设置这一行:
datadir = /usr/local/mysql/data
添加相对路径:
echo " export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile
启动和停止Mysql:
mysql.server start
mysql.server stop
检测3306端口:
netstat -lnp
编辑 /etc/my.cnf:
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
log-bin=mysql-bin
expire_logs_days = 5
下载:http://www.mysql.com/downloads/
mysql 5.5需要用cmake来编译:
安装cmake,及相关包:
yum install -y \
cmake\
gcc \
gcc-c++ \
ncurses-devel \
bison \
libaio
解压 mysql5.5.tar.gz ,编译:
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/data/mysqldata \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DMYSQL_TCP_PORT=3306 \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DMYSQL_USER=mysql \
-DWITH_DEBUG=0
然后执行:
make && make install
可以用echo $? 检查每步结果,为0的话就表示成功.
如果想重新make,需清除cmake用:
make clean
rm -f CMakeCache.txt
设置:
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /usr/local/mysql/bin/
chmod 755 /usr/local/mysql/bin/mysql.server
chown -R mysql.mysql /usr/local/mysql
cd /usr/local/mysql
mkdir /data/mysqldata
scripts/mysql_install_db --user=mysql
cp -rpf /usr/local/mysql/data/* /data/mysqldata
vim /etc/my.cnf 请在[mysqld]下设置这一行:
datadir = /usr/local/mysql/data
添加相对路径:
echo " export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
source /etc/profile
启动和停止Mysql:
mysql.server start
mysql.server stop
检测3306端口:
netstat -lnp
编辑 /etc/my.cnf:
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
log-bin=mysql-bin
expire_logs_days = 5
推荐阅读
-
linux下mysql5.5的安装 博客分类: mysql mysqllinux
-
linux下修改root密码 博客分类: mysql
-
centos6.5使用yum安装mysql5.6实现不同磁盘的表分区 博客分类: centosmysql centosmysql5.6
-
lamp的搭建 博客分类: linux apache mysql
-
linux下修改root密码 博客分类: mysql
-
lamp的搭建 博客分类: linux apache mysql
-
Linux下subversion的安装与配置 博客分类: Linux linuxsubversion配置安装新增版本库新增用户
-
linux下nginx安装,启动,停止,卸载,平滑升级,添加模块 博客分类: nginx nginx安装启动停止添加模块
-
kubernets: 和谐环境下的kubeadm安装 博客分类: kubernetes kubeadm
-
kubernets: 和谐环境下的kubeadm安装 博客分类: kubernetes kubeadm