本文目录一览:
- 1、如何在linux下安装mysql
- 2、linux上如何安装mysql5.5
- 3、linux怎么安装mysql5.5
- 4、mysql解压后怎么安装 linux
- 5、如何安装mysql-5.5.56-linux-glibc2.5-x86
如何在linux下安装mysql
第一步:安装:
tarmysql-5.5.48-linux2.-x86_64.tar.gz
Copy到指定的路径下:
cpmysql-5.5.48-linux2.6-x86_64 /usr/local/mysql -r
添加系统mysql组合mysql用户:
执行命令:groupaddmysql和useradd -r -g mysql mysql
安装数据库:
进入安装mysql软件目录:执行命令 cd/usr/local/mysql
修改当前目录拥有者为mysql用户:执行命令chown -R mysql:mysql ./
安装数据库:执行命令./scripts/mysql_install_db --user=mysql
修改当前目录拥有者为root用户:执行命令chown -R root:root ./
修改当前data目录拥有者为mysql用户:执行命令chown -R mysql:mysql data
到此数据库安装完毕
启动mysql服务和添加开机启动mysql服务:
添加开机启动:执行命令cpsupport-files/mysql.server /etc/init.d/mysql,把启动脚本放到开机初始化目录
启动mysql服务:执行命令servicemysql start
linux上如何安装mysql5.5
如果是基于Redhat的版本可以以ROOT身份在命令行界面输入:yum install mysql
如果是基于Debian的版本可以以ROOT身份在命令行界面输入:apt-get install mysql
你可以提前更新YUM库:yum update
并不定非要mysql5.5 如果你真要安装这个版本就下载rpm包 然后 rpm -ivh mysql5.5.rpm 来安装
linux怎么安装mysql5.5
你好,Linux下安装MySQL方法如下,供参考,具体安装方式以你是用Linux版本不同有微笑的差异,但大致安装方法和思路不会变,
mysql解压后怎么安装 linux
shell groupadd mysql
shell useradd -r -g mysql mysql
shell cd /usr/local
shell tar zxvf mysql-5.5.32-linux2.6-x86_64.tar.gz
shell mv mysql-5.5.32-linux2.6-x86_64 /usr/local/mysql3309
shell cd /usr/local/mysql3309
shell chown -R mysql .
shell chgrp -R mysql .
2
shellcat my3309.cnf
#/usr/local/mysql3309下新建my3309.cnf配置文件,内容复制my3308.cnf
shellmkdir /usr/local/mysql3309/logs
shellmkdir /usr/local/mysql3309/bin-log
shellchown -R mysql.mysql .
shell scripts/mysql_install_db --user=mysql --defaults-file=/usr/local/mysql3309/my3309.cnf
-----------------------my3309.cnf内容--------------------------------------
[client]
#password = your_password
port = 3307
socket = /tmp/mysql3307.sock
[mysql]
socket = /tmp/mysql3307.sock
# The MySQL server
[mysqld]
port = 3309
socket = /tmp/mysql3307.sock
basedir =/usr/local/mysql3307
datadir =/usr/local/mysql3307/data
skip-external-locking
skip-host-cache
skip-name-resolve
max_connection =1000
key_buffer_size = 600M
max_allowed_packet = 10M
table_open_cache = 1024
sort_buffer_size = 6M
read_buffer_size = 6M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 64
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
log-error=/usr/local/mysql3307/logs/mysqld3307.log
server-id = 1
log_slave_updates = 1
auto_increment_increment=2
auto_increment_offset=2
read-only
log_bin =/usr/local/mysql3307/binlog/mysql-bin.log
#log-bin-index = mysql-bin.index
max_binlog_size =1G
max_relay_log_size =1G
expire_logs_days = 30 #超过30天的binlog删除
replicate-do-db =test #只复制某个库
replicate-do-db =fab
replicate-do-db =fat
replicate-do-db =thca
replicate-do-db =fab_innodb
replicate-ignore-db=mysql #不复制某个库
3
(启动mysql)
shellbin/mysqld_safe --defaults-file=/usr/local/mysql3309/my3309.cnf --user=mysql /dev/null 21
(进入mysql)
shellbin/mysql --defaults-file=/usr/local/mysql3309/my3309.cnf
4
无法启动或进入:
查看日志shell tail -f /usr/local/mysql3309/logs/mysql3309.log
END
注意事项
解压缩版的mysql可直接运行,执行时需指定my.cnf文件
注意添加--defaults-file=/usr/local/my3309.cnf命令
由于在my.cnf文件中指定了mysql.sock的位置,为了避免多个mysql同时读取/tmp/mysql.sock文件,在启动时指定读取的sock文件位置: --socket=/tmp/mysql3307.sock
如何安装mysql-5.5.56-linux-glibc2.5-x86
大体有3种安装方法:现在常用的方式就是网络安装例如centos 用yum --install mysql 下载rpm包,然后rpm -ivh mysql名; 源码安装,下载tar包,解压然后install安装。 不知道你什么linux系统,详细的安装方法你的百度一下,很多很多。