Centos7安装MySQL5.7

博客介绍了在配置好静态IP后,使用Xshell连接,通过rz命令将下载好的jar包上传到根目录,用ls命令查看上传的jar包,还提到输入命令创建文件,为后续解压做准备。
1.下载好jar包;链接:https://pan.baidu.com/s/1LrKqPt4lMPcPgW4oz7JnoA 
提取码:yi6m 
没有配置好静态IP参考此文章
文档:centos安装,mysql .doc
链接:http://note.youdao.com/noteshare?id=38b747d0fbcd64c683591419c5bba90d&sub=FF18945C486F400CADDE864134A9C76

2.配置好静态ip后,我是用的Xshell连接,成功后会出现这样
在这里插入图片描述
3.然后使用rz 命令 把刚才下载好的jar包上传到根目录下
在这里插入图片描述
4.然后输入ls 命令就能看到上传的jar 包,注意蓝色标注的地方,刚开始上传是没有的,是解压过后的,
输入以下命令创建 文件待会解压是要用 mkdir /usr/local
在这里插入图片描述

[root@localhost ~]# tar -zxvf mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz -C /usr/local/
实际生产环境:
[root@localhost ~]# mv /usr/local/mysql-5.7.26-linux-glibc2.12-x86_64/ /usr/local/mysql
新增mysql用户组:
[root@localhost ~]# groupadd mysql
新增用户
[root@localhost ~]# useradd -r -g mysql mysql
给mysql 目录权限
[root@localhost ~]# cd /usr/local/
[root@localhost local]# 	到初始化环境的目录
[root@localhost mysql]# mkdir log
[root@localhost mysql]# mkdir data
[root@localhost mysql]# chown -R mysql:mysql ../mysql
初始化数据和指定安装目录和数据目录
[root@localhost mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
2019-04-19T03:23:25.059135Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-04-19T03:23:25.422900Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-04-19T03:23:25.476253Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-04-19T03:23:25.578366Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 7e3573fb-6252-11e9-b2e0-000c2950fbf4.
2019-04-19T03:23:25.581778Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-04-19T03:23:25.584681Z 1 [Note] A temporary password is generated for root@localhost: We.#yr1?zbYS  (找一个地方保存这个,随机生成的mysql数据库密码)
复制启动文件
[root@localhost mysql]# cd support-files/
[root@localhost support-files]# cp mysql.server /etc/init.d/mysqld
[root@localhost support-files]# chmod +x /etc/init.d/mysqld
.修改启动路径
[root@localhost support-files]# vi /etc/init.d/mysqld 
     46 basedir=/usr/local/mysql
     47 datadir=/usr/local/mysql/data
增加环境变量 (最下面添加)
[root@localhost support-files]# vi /etc/profile
export PATH=$PATH:/usr/local/mysql/bin
[root@localhost support-files]# source /etc/profile
修改配置文件,输入以下命令是有可能什么都没有,如果没有,把下面这段内容辅助到该文件里面,如果有,请修改与之不同的地方
[root@localhost support-files]# vi /etc/my.cnf
[client]
port=3306
[mysqld]
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
#socket=/usr/local/mysql/mysql.sock
socket=/tmp/mysql.sock
user=mysql
#skip-grant-tables
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-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/mysql/log/mysqld.log
pid-file=/usr/local/mysql/data/mysqld.pid
#
# include all files from the config directory
#
#includedir /etc/my.cnf.d
添加开启自启
[root@localhost support-files]# chkconfig --add mysqld
[root@localhost support-files]# chkconfig mysqld on
启动
[root@localhost mysql]# /etc/init.d/mysqld start
Starting MySQL.2019-04-19T03:30:21.872260Z mysqld_safe error: log-error set to '/usr/local/mysql/log/mysqld.log', however file don't exists. Create writable for user 'mysql'.
 ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).
[root@localhost log]# touch mysqld.log
[root@localhost log]# chmod -R 777 /usr/local/mysql
[root@localhost data]# touch localhost.localdomain.pid
[root@localhost data]# /etc/init.d/mysqld start
Starting MySQL. SUCCESS! 
[root@localhost data]# lsof -i:3306
COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mysqld  49214 mysql   18u  IPv6  93463      0t0  TCP *:mysql (LISTEN)
修改密码:
[root@localhost ~]# mysql -uroot -p7yT*Q?.rs>H7
mysql>  set password=password("123456");
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
数据驱动的两阶段分布鲁棒(1-范数和∞-范数约束)的电热综合能源系统研究(Matlab代码实现)内容概要:本文围绕“数据驱动的两阶段分布鲁棒(1-范数和∞-范数约束)的电热综合能源系统研究”展开,提出了一种结合数据驱动与分布鲁棒优化方法的建模框架,用于解决电热综合能源系统在不确定性环境下的优化调度问题。研究采用两阶段优化结构,第一阶段进行预决策,第二阶段根据实际场景进行调整,通过引入1-范数和∞-范数约束来构建不确定集,有效刻画风电、负荷等不确定性变量的波动特性,提升模型的鲁棒性和实用性。文中提供了完整的Matlab代码实现,便于读者复现和验证算法性能,并结合具体案例分析了不同约束条件下系统运行的经济性与可靠性。; 适合人群:具备一定电力系统、优化理论和Matlab编程基础的研究生、科研人员及工程技术人员,尤其适合从事综合能源系统、鲁棒优化、不确定性建模等相关领域研究的专业人士。; 使用场景及目标:①掌握数据驱动的分布鲁棒优化方法在综合能源系统中的应用;②理解1-范数和∞-范数在构建不确定集中的作用与差异;③学习两阶段鲁棒优化模型的建模思路与Matlab实现技巧,用于科研复现、论文写作或工程项目建模。; 阅读建议:建议读者结合提供的Matlab代码逐段理解算法实现细节,重点关注不确定集构建、两阶段模型结构设计及求解器调用方式,同时可尝试更换数据或调整约束参数以加深对模型鲁棒性的理解。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值