mysql 5.5 linux 安装

Posted whm-blog

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 5.5 linux 安装相关的知识,希望对你有一定的参考价值。

# 启动 mysql (指定 默认 的 配置文件)
./mysqld --defaults-file=my.cnf

# 后台 启动 mysql
./mysqld --defaults-file=my.cnf &

/lyc/mysql-5.5.62/tmp/mysql.sock

 

# 安装 一定要指定 basedir 和 datadir !

./mysql_install_db --basedir=/lyc/mysql-5.5.62 --datadir=/lyc/mysql-5.5.62/mysql-data

 

一份配置 如下- (详情参考 https://dev.mysql.com/doc/refman/5.5/en/)

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. Its a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.



[mysqld]
port=3307
socket = /lyc/mysql-5.5.62/tmp/mysql.sock  # socket 名称,如果一个服务器有多个 mysql 请务必指定此值
max_allowed_packet=2G  # 最大文件导入限制 防止 导入数据过大时出错
wait_timeout=2880000   # 防止 导入数据过大时出错 
interactive_timeout = 2880000   # 防止 导入数据过大时出错
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

basedir=/lyc/mysql-5.5.62  # mysql 目录
datadir=/lyc/mysql-5.5.62/mysql-data  # mysql 数据目录

character-set-server=utf8  # 编码
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
user=root
[client]
default-character-set=utf8
port = 3307
socket = /lyc/mysql-5.5.62/tmp/mysql.sock  # 同上

[mysql]
default-character-set=utf8

 

以上是关于mysql 5.5 linux 安装的主要内容,如果未能解决你的问题,请参考以下文章

mysql的5.5版本的安装

Centos-6.6源码安装MySQL-5.5

MySQL 5.5 通用二进制格式安装

MYSQL-5.5二进制包安装

MySQL 5.5单实例 编译安装

杂记整理二:linux与程序安装