意思是你要加个f参数
tar xvfz mysql.xx.tar.gz
这亏手前样解销清压
如果需要指定目录 后面薯毁加上路径 就可以了
B. linux下mysql解压后怎么安装
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
shell>cat my3309.cnf
#/usr/local/mysql3309下新建my3309.cnf配置文件,内容复制my3308.cnf
shell>mkdir /usr/local/mysql3309/logs
shell>mkdir /usr/local/mysql3309/bin-log
shell>chown -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)
shell>bin/mysqld_safe --defaults-file=/usr/local/mysql3309/my3309.cnf --user=mysql >/dev/null 2>&1 &
(进入mysql)
shell>bin/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
C. 如何在linux中安装mysql
你好,你可以到mysql官网下载mysql编译好的二进制安装软件,然后选择经典安装。
1、解压32位安装包:进入安装包所在目录。
2、复制解压后的mysql目录到系统的本地软件。
3、添加系统mysql组和mysql用户:执行命令。
D. 怎么在linux虚拟机上解压mysql5.1安装包显示权限
yum -y install mysql mysql-server mysql-devel
chkconfig --level 35 mysqld on
/etc/init.d/mysqld start
mysql_secure_installation 然后再粗略设置手搭下安唤薯宏全和册
E. 怎么在linux上安装mysql
怎么在linux上安装mysql1、下载安装包“mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz”(你可以去下其他版本的)#安装依赖yum-yinstallperlperl-develautoconflio2、把下载的安装包移动到/usr/local/下。3、解压tarzxvfmysql-5.6.33-linux-glibc2.5-x86_64.tar.gz4、复制解压后的mysql目录到系统的本地软件目录cpmysql-5.6.33-linux-glibc2.5-x86_64/usr/local/src-r
F. 在linux中怎么安装mysql
到mysql官网下载mysql编译好的二进制安装包
解压32位安陪裂装包芦颂闭:
进入安装包所在目录,执行命令:tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz
复制解压后的mysql目录到系统的本地软件目录:
执行命令:cp mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql -r
注意:目录结尾不要加/
添加系统mysql组和mysql用户:
执行命令:groupadd mysql和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
到此数据库安装完毕
G. linux 解压之后怎么安装mysql
http://dev.mysql.com/downloads/mysql/5.6.html#downloads
这是mysql官网地址,你可以根据你的内核版本下载相应的msyql版本安装包,如:
MySQL-client-5.6.31-1.el7.x86_64.rpm
MySQL-server-5.6.31-1.el7.x86_64.rpm
下载好上述两个安装包后执行安装命令就可以了:
rpm -ivh MySQL-client-5.6.31-1.el7.x86_64.rpm
rpm -ivh MySQL-server-5.6.31-1.el7.x86_64.rpm
注意:安装之前要确认你的主机目前有没有默认安装的mysql版本,如果有,先删除就可以了。
H. Linux下MySql免安装
解压 /usr/local/mysql noinstall linux tgz
之前自己制作或者从下个tar gz包
修改 f
端口 及 basedir datadir
返旦销迟毕 制作启动脚本
cp mysql/share/mysql/mysql erver /etc/init d/mysql
修改其中的 basedir datadir
理论上就可以正常启动服漏游务了
设置mysql客户端
如有需要指定mysql socket
lishixin/Article/program/MySQL/201311/29515
I. linux中mysql怎么安装
安装环境:系统是 centos6.5
1、下载
下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads
下载版本:我这里选择的5.6.33,通用版,linux下64位
也可以直接复制64位的下载地址,通过命令下载:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
2、解压
1
2
3
4
#解压
tar -zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
#复制解压后的mysql目录
cp -r mysql-5.6.33-linux-glibc2.5-x86_64 /usr/local/mysql
3、添加用户组和用户
1
2
3
4
#添加用户组
groupadd mysql
#添加用户mysql 到用户组mysql
useradd -g mysql mysql
4、安装
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cd /usr/local/mysql/<br>mkdir ./data/mysql
chown -R mysql:mysql ./
./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
cp support-files/my-default.cnf /etc/my.cnf
#修改启动脚本
vi /etc/init.d/mysqld
#修改项:
basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/mysql
#启动服务
service mysqld start
#测试连接
./mysql/bin/mysql -uroot
#加入环境变量,编辑 /etc/profile,这样可以在任何地方用mysql命令了
export PATH=$PATH:/usr/local/mysql//bin<br>source /etc/profile
#启动mysql
service mysqld start
#关闭mysql
service mysqld stop
#查看运行状态
service mysqld status
5、错误
5.1 sqlyog连接时,报1130错误,是由于没有给远程连接的用户权限问题
解决1:更改 ‘mysql’数据库‘user’表‘host’项,从‘localhost’改成‘%’。
use mysql;
select 'host' from user where user='root';
update user set host = '%' where user ='root';
flush privileges;
解决2:直接授权
GRANT ALL PRIVILEGES ON *.* TO ‘root’@'%’ IDENTIFIED BY ‘youpassword’ WITH GRANT OPTION;
5.2 安装时的一些错误
-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: 没有那个文件或目录
解决: yum -y install perl perl-devel
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: lio.so.1: cannot open shared object file: No such file or directory
解决:yum -y install lio-devel
6、其他
6.1 配置环境变量
vi + /etc/profile
export PATH=....:/usr/local/mysql/bin