Mysql二进制安装

Mysql安装

安装步骤

1、新建用户

groupadd mysql

useradd -r -g mysql mysql

cd /usr/local/----------------------------注意路径

chown -R mysql:mysql  mysql

chmod -R 775  mysql

2、安装依赖包

yum install libai* -y

yum install ncurses-devel -y

yum -y install bison

yum install zlib zlib-devel -y

yum install zlib -y

yum instlal libxml libjpeg freetype libpnggd  curl libiconv  zlib-devel

yum install libxml2-devel libjpeg-develfreetype-devel libpng-devel gd-devel curl-devel -y

yum install gcc  -y

3、解压并将包放置在/usr/local下以mysql

tar -xvf mysql-5.5.28-linux2.6-i686.tar.gz

mv mysql-5.5.28-linux2.6-i686 /usr/local/mysql

5、初始化实例

cd  /usr/local/mysql/scripts

mkdir  /data

chown mysql:mysql  /data

chmod 775 mysql:mysql data

./mysql_install_db  --user=mysql  --basedir=/usr/local/mysql/   --datadir=/data/

basedir------------mysql软件安装路径

datadir------------------数据文件存放路径

WARNING: The host ‘mysql01‘ could not belooked up with resolveip.

This probably means that your libclibraries are not 100 % compatible

with this binary MySQL version. The MySQLdaemon, mysqld, should work

normally with the exception that host nameresolving will not work.

This means that you should use IP addressesinstead of hostnames

when specifying MySQL privileges !

Installing MySQL system tables...

OK

Filling help tables...

OK

To start mysqld at boot time you have tocopy

support-files/mysql.server to the rightplace for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THEMySQL root USER !

To do so, start the server, then issue thefollowing commands:

/usr/local/mysql//bin/mysqladmin -u rootpassword ‘new-password‘

/usr/local/mysql//bin/mysqladmin -u root -hmysql01 password ‘new-password‘

Alternatively you can run:

/usr/local/mysql//bin/mysql_secure_installation

which will also give you the option ofremoving the test

databases and anonymous user created bydefault.  This is

strongly recommended for productionservers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd /usr/local/mysql/ ;/usr/local/mysql//bin/mysqld_safe &

You can test the MySQL daemon withmysql-test-run.pl

cd /usr/local/mysql//mysql-test ; perlmysql-test-run.pl

Please report any problems with the/usr/local/mysql//scripts/mysqlbug script!

6、初始化配置文件修改

cp  /usr/local/mysql/support-files/my-small.cnf  /etc/my.cnf

[client]

port            = 3306

socket          = /data/mysql.sock

[mysql]

no-auto-rehash

[mysqld]

user   = mysql

port   = 3306

socket = /data/mysql.sock

basedir = /usr/local/mysql

datadir = /data

open_files_limit    = 1024

back_log = 600

max_connections = 800

max_connect_errors = 3000

table_cache = 614

external-locking = FALSE

max_allowed_packet =8M

sort_buffer_size = 1M

join_buffer_size = 1M

thread_cache_size = 100

thread_concurrency = 2

query_cache_size = 2M

query_cache_limit = 1M

query_cache_min_res_unit = 2k

#default_table_type = InnoDB

thread_stack = 192K

#transaction_isolation = READ-COMMITTED

tmp_table_size = 2M

max_heap_table_size = 2M

long_query_time = 1

#log_long_format

#log-error = /data/error.log

#log-slow-queries = /data/slow.log

pid-file = /data/mysql.pid

log-bin = /data/mysql-bin

relay-log = /data/relay-bin

binlog_cache_size = 1M

max_binlog_cache_size = 1M

max_binlog_size = 2M

expire_logs_days = 7

key_buffer_size = 16M

read_buffer_size = 1M

read_rnd_buffer_size = 1M

bulk_insert_buffer_size = 1M

#myisam_sort_buffer_size = 1M

#myisam_max_sort_file_size = 10G

#myisam_max_extra_sort_file_size = 10G

#myisam_repair_threads = 1

#myisam_recover

lower_case_table_names = 1

skip-name-resolve

slave-skip-errors = 1032,1062

replicate-ignore-db=mysql

server-id = 1

innodb_additional_mem_pool_size = 4M

innodb_buffer_pool_size = 32M

innodb_data_file_path =ibdata1:128M:autoextend

innodb_file_io_threads = 4

innodb_thread_concurrency = 8

innodb_flush_log_at_trx_commit = 2

innodb_log_buffer_size = 2M

innodb_log_file_size = 4M

innodb_log_files_in_group = 3

innodb_max_dirty_pages_pct = 90

innodb_lock_wait_timeout = 120

innodb_file_per_table = 0

[mysqldump]

quick

max_allowed_packet = 2M

[mysqld_safe]

log-error=/data/mysql_oldboy3306.err

pid-file=/data/mysqld.pid

Mysql启动

1、配置环境变量

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin

2、启停数据库

mysqld_safe   --defaults-file=/etc/my.cnf  --user=mysql &

--defaults-file 表示配置文件路径

--user指定用那个用户启动

Mysql基本管理与维护

登录mysql

本地服务器多实例登录mysql

mysql  -u  -p      --socket=/data/mysql.sock

时间: 2024-12-16 23:19:09

Mysql二进制安装的相关文章

LAMP环境部署:Apache源码安装+MySQL二进制安装+PHP源码安装+Nginx源码安装

Apache 版本:2.2.27 MySQL 版本:5.5.54-linux2.6-x86_64PHP 版本:5.3.27一.源码安装Apache1.首先安装上传工具2.上传LAMP环境所需安装包3.解压所有安装包4.安装Apache依赖包5.创建安装目录6.配置安装文件./configure \ #./configure 是用来生成Makefile文件用于编译安装 --prefix=/application/apache-2.2.27 \ #指定安装目录--enable-deflate \ #

mysql二进制安装启动的问题

二进制安装后,启动时出现问题(mysql安装在/application/msyql下): [[email protected] bin]# /etc/init.d/mysqld startStarting MySQL.170320 22:21:51 mysqld_safe The file /usr/local/mysql/bin/mysqlddoes not exist or is not executable. Please cd to the mysql installationdirec

mysql二进制安装,升级,多实例部署

目标 理解线上部署考虑的因素 学会编译安装以及二进制安装mysql 学会升级mysql 学会多实例部署mysql数据库 学会合理部署mysql线上库 考虑因素: 版本选择,5.1,5.5还是5.6? 分支选择,官方社区版?percona server?mariadb? 推荐官方版,简单易上手 安装方式,包安装?二进制包安装?源码安装? 线上推荐二进制包安装 路径配置,参数配置(尽量模板化,标准化) 一个实例多个库,or多个实例单个库? 二进制安装mysql 下载软件安装包 解压放到指定目录(比如

mysql二进制安装的问题

二进制安装后,启动时出现问题(mysql安装在/application/msyql下): [[email protected] bin]# /etc/init.d/mysqld startStarting MySQL.170320 22:21:51 mysqld_safe The file /usr/local/mysql/bin/mysqlddoes not exist or is not executable. Please cd to the mysql installationdirec

Mysql二进制安装过程

Msyql介绍 MySQL是一个关系型数据库管理系统,由瑞典的MySQl AB公司开发,目前属于Oracle旗下公司.MySql是最流行的关系型数据库,在WEB应用方面Mysql是最好的RDBMS应用软件之一. Mysql关联的数据库将数据保存在不同的表中,这样增加了速度并提高了灵活性:使用SQL语言用于访问数据库的最常用标准化语言,它体积小,总体拥有成本地,开源等特点是中小型企业的首选. MySQL的安装 在Mysql官网下载稳定的社区版本.它的安装方式有yum 安装.二进制安装已经源码安装.

MYSQL 二进制安装+XFS

1. 准备分区 yum install  xfsprogs [[email protected] yum.repos.d]# mkfs.xfs -f -i attr=2 -l lazy-count=1,sectsize=4096 -b size=4096 -d sectsize=4096 -L data /dev/sdb meta-data=/dev/sdb               isize=256    agcount=4, agsize=1966080 blks =          

MySQL二进制安装部署

1 #使用二进制包安装mysql 2 cp mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz /data/ 3 tar -xf /data/mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz -C /data/ 4 mv /data/mysql-5.6.29-linux-glibc2.5-x86_64 /data/mysql 5 6 #创建mysql数据存储目录 7 mkdir /data/mysqldata 8 9 #添加mys

mysql 二进制安装文件 下载

在linuex环境下安装mysql,二进制安装包是最合适的方式,下载下来不用编译就可用了. 官方说明文档:http://dev.mysql.com/doc/refman/5.1/en/binary-installation.html 这里也有类似的说明:http://blog.csdn.net/kk185800961/article/details/44118323 http://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.6/mysql-5.6.2

Mysql 二进制安装

前提 version mysql-5.5 platform centos6.x 添加用户 useradd -M -s /sbin/nologin mysql 安装需要的包 yum -y install compat-libstdc++-33.x86_64 libaio.x86_64 安装 tar xzvf mysql-5.5.43-linux2.6-x86_64.tar.gz mv -f mysql-5.5.43-linux2.6-x86_64 /storage/server/ ln -sf /