Centos 7 安装mysql5.7.24二进制 版本的方法及解决办法
发表于:2025-11-09 作者:千家信息网编辑
千家信息网最后更新 2025年11月09日,Mysql 二进制安装方法下载mysqlhttps://dev.mysql.com/downloads/mysql/1.解压包tar xf mysql-5.7.24-linux-glibc2.12-x
千家信息网最后更新 2025年11月09日Centos 7 安装mysql5.7.24二进制 版本的方法及解决办法
Mysql 二进制安装方法
下载mysql
https://dev.mysql.com/downloads/mysql/
1.解压包
tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
2.实际生产环境
mv mysql-5.7.24-linux-glibc2.12-x86_64 /usr/local/mysql5.7
a.新增Mysql用户组
groupadd mysql
b. 新增用户
opt]# useradd -r -g mysql mysql
C.给mysql 目录权限
chown -R mysql:mysql mysql5.7
3. 到初始化环境的目录
Cd /home/usr/local/mysql5.6/mkdir datamkdir logchown -R mysql:mysql mysql5.7
4.初始化数据和指定安装目录和数据目录
./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql5.7/ --datadir=/usr/local/mysql5.7/data/
6复制启动文件
cp mysql.server /etc/init.d/mysqldchmod +x /etc/init.d/mysqld
7.修改启动路径
vi /etc/init.d/mysqldbasedir= /usr/local/mysql5.7datadir= /usr/local/mysql5.7/data
8.增加环境变量 (最下面添加)l
vi /etc/profileexport MYSQL_HOME=" /usr/local/mysql5.7"export PATH="$PATH:$MYSQL_HOME/bin"
9.刷新配置文件
source /etc/profile
修改配置文件
vi /etc/my.cnf[client]port=3306[mysqld]basedir=/usr/local/mysql5.7datadir=/usr/local/mysql5.7/data#socket=/usr/local/mysql5.7/mysql.socksocket=/tmp/mysql.sockuser=mysql#skip-grant-tables# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0# Settings user and group are ignored when systemd is used.# If you need to run mysqld under a different user or group,# customize your systemd unit file for mariadb according to the# instructions in http://fedoraproject.org/wiki/Systemd[mysqld_safe]log-error=/usr/local/mysql5.7/log/mysqld.logpid-file=/usr/local/mysql5.7/data/mysqld.pid## include all files from the config directory#!includedir /etc/my.cnf.d
11.添加开启自启
chkconfig --add mysqld chkconfig mysqld on
12.启动mysqld
service mysqld start netstat -anpt
13.修改密码(密码初始化的时候有个密码)
2018-11-02T02:07:44.574468Z 1 [Note] A temporary password is generated for root@localhost: lXyB0%fi#9-S (这个就是密码)mysql> help contentsERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> help contentsERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
解决办法
1、 修改用户密码
mysql> alter user 'root'@'localhost' identified by 'youpassword';
或者
mysql> set password=password("youpassword");2、刷新权限
mysql> flush privileges;mysql> help contents
总结
以上所述是小编给大家介绍的Centos 7 安装mysql5.7.24二进制 版本的方法 ,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
密码
目录
文件
环境
用户
二进制
方法
数据
权限
配置
办法
版本
变量
实际
就是
时候
用户组
疑问
网站
路径
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
什么是sap客户主数据库
java数据库连接本地地址
pg数据库密码
阿里云转移服务器在哪确认
服务器本机地址
数据库更新日志怎么写
软件开发项目经理收入高吗
高斯数据库查询所有数据
福州龙猫互联网科技加QQ
奉贤区市场软件开发销售方法
数据库包括哪三种故障
京东刷单服务器
手机正常网络安全
网络安全不够
网络安全三管三监测题
江苏自动网络技术参考价格
楹腾互联网科技有限公司
婵妈妈软件开发者
数据库服务安全有哪两种
软件开发 首付款
数据库技术中采用分级方法讲
网络安全公需科目考试
湖南城市学院软件开发分数线
2022年网络安全法法律法规
江苏智慧社区软件开发公司
破解psv无法连接服务器
如何进行网络安全防御
海宁鹃湖科技城互联网产业
进一步做好网络安全
华为数据库调研报告