Linux主机Percona5.7.11安装(直接解压初始化方式)

主机Percona安装(直接解压初始化方式)

下载版本:Percona-Server-5.7.11-4-Linux.x86_64.ssl101.tar.gz
解压:

	tar -zxvf Percona-Server-5.7.11-4-Linux.x86_64.ssl101.tar.gz

(以下方式不使用mysql默认的路径/usr/local/mysql;使用自定义路径)

前提条件:确保创建有效的basedir,datadir,socket路径目录

1、初始化数据库:

./mysql_install_db --user=jfshop --basedir=/app/soft/Percona-Server-5.7.11 --datadir=/app/soft/perdata

启动mysql数据库

./mysqld --defaults-file=/app/soft/conf/my.cnf --basedir=/app/soft/Percona-Server-5.7.11

登陆数据库

./mysql -u root -p --socket=/app/soft/log/per.sock

补充:
如果直接使用命令./mysql -u root -pmysql默认会找/tmp/mysql.sock因此若是为了方便可以在my.cnf中直接这样写socket= /tmp/mysql.sock


my.cnf文件的最后添加一下内容跳过密码验证

skip-grant-tables

进入mysql面板后修改密码:

UPDATE user SET Password = PASSWORD('password') WHERE user = 'root';

修改以后删除my.cnf 中的跳过验证
重启mysql服务
进入mysql面板后需进行一下操作:

ALTER USER USER() IDENTIFIED BY 'password';

自定义目录下的my.cnf

# 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. It's 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]

# 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.
user = jfshop
basedir = /app/soft/Percona-Server-5.7.11
datadir = /app/soft/perdata
port = 3306
server_id = 63306
socket = /app/soft/log/per.sock
log-bin = /app/soft/log/mysql-bin.log
# 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

修改mysql使其允许被远程访问:

	root用户的 host 属性 改为 %  即可

刷新权限:

flush privileges ;
‘./mysql-bin.index’ not found (Errcode: 13) 的解决方法

将文件系统复制到PC机上,然后再拷贝到别的SD卡后,发现mysql无法启动了,首先检查了一下mysql的错误日志,发现最后出现以下错误:

/usr/local/mysql/libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)

提示./mysql-bin.index无法找到(由于mysql开启了bin日志功能),到数据库根目录查看该文件是存在的,可能是文件权限的问题,查看了数据库根目录的权限是700,所有者和用户组都是root,可能是上次转移数据库的时候不小心修改了文件夹的权限。
解决方法:

chgrp -R mysql /app/soft/log && chown -R mysql /app/soft/log

重新启动mysql [OK]

要在Linux安装Percona,可以按照以下步骤进行操作: 1. 首先,使用以下命令安装Percona的软件源: ``` # yum -y install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm ``` 2. 然后,使用以下命令查看可用的Percona工具包: ``` # yum list | grep percona-toolkit ``` 3. 接下来,使用以下命令安装Percona工具包: ``` # yum install percona-toolkit -y ``` 4. 安装完成后,可以通过以下命令来验证是否安装成功: ``` # pt-query-digest --help # pt-table-checksum --help ``` 如果你想安装Percona Server数据库,可以按照以下步骤进行操作: 1. 首先,下载Percona Server的版本,例如: ``` # wget https://www.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.11-4/binary/tarball/Percona-Server-5.7.11-4-Linux.x86_64.ssl101.tar.gz ``` 2. 然后,解压下载的文件,例如: ``` # tar -zxvf Percona-Server-5.7.11-4-Linux.x86_64.ssl101.tar.gz ``` 这样,你就可以在Linux上成功安装Percona了。 #### 引用[.reference_title] - *1* *2* [(一)Linuxpercona-toolkit工具包的安装和使用](https://blog.csdn.net/chj_1224365967/article/details/107838042)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Linux主机Percona5.7.11安装(直接解压初始化方式)](https://blog.csdn.net/qq_38928944/article/details/85251873)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值