当前位置: 首页 > wzjs >正文

西宁做网站公司开通微商城要多少钱

西宁做网站公司,开通微商城要多少钱,旅行网站开发需求说明书,丽水建设网站目录 一、检查系统是否安装其他版本Mariadb数据库二、安装 MySQL三、配置 MySQL四、修改默认存储路径五、开放防火墙端口六、数据备份七、生产环境优化八、常用命令 一、检查系统是否安装其他版本Mariadb数据库 # 查看已安装的 Mariadb 数据库版本 [rootopeneuler ~]# rpm -qa…

目录

    • 一、检查系统是否安装其他版本Mariadb数据库
    • 二、安装 MySQL
    • 三、配置 MySQL
    • 四、修改默认存储路径
    • 五、开放防火墙端口
    • 六、数据备份
    • 七、生产环境优化
    • 八、常用命令

一、检查系统是否安装其他版本Mariadb数据库

# 查看已安装的 Mariadb 数据库版本
[root@openeuler ~]# rpm -qa|grep -i mariadb
# 卸载已安装的 Mariadb 数据库
[root@openeuler ~]# rpm -qa|grep mariadb|xargs rpm -e --nodeps

二、安装 MySQL

2.1 安装 MySQL

# 创建用于存放 MySQL Yum 源配置文件的目录
[root@openeuler ~]# sudo mkdir -p /etc/yum.repos.d/mysql# 下载 MySQL 官方的 Yum 源配置文件
[root@openeuler ~]# sudo wget -P /etc/yum.repos.d/mysql https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm# 安装下载的 repo 文件
[root@openeuler ~]# sudo rpm -ivh /etc/yum.repos.d/mysql/mysql57-community-release-el7-11.noarch.rpm# 查看可用的 mysql 安装文件
[root@openeuler ~]# dnf repolist all | grep mysql# 非常重要:防止GPG key报错,执行这个命令
[root@openeuler ~]# rm /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
rm:是否删除普通文件 '/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql'[root@openeuler ~]# rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022# 安装 MySQL 服务
[root@openeuler ~]# sudo dnf install -y mysql-community-server# 检查mysql是否安装成功
[root@openeuler ~]# rpm -qa | grep mysql

2.2 启动服务

# 启动服务
[root@openeuler ~]# sudo systemctl start mysqld
# 查看服务状态
[root@openeuler ~]# sudo systemctl status mysqld
# 设置开机自启
[root@openeuler ~]# sudo systemctl enable mysqld
# 获取初始临时密码,为root用户随机生成了一个密码
[root@openeuler ~]# sudo grep 'temporary password' /var/log/mysqld.log
2025-04-29T21:23:11.322498Z 1 [Note] A temporary password is generated for root@localhost: XXXXXX(临时密码)

2.3 运行安全配置向导
设置内容如下:
1.为root用户设置密码
2.删除匿名账号
3.取消root用户远程登录
4.删除test库和对test库的访问权限
5.刷新授权表使修改生效

[root@openeuler ~]# sudo mysql_secure_installationSecuring the MySQL server deployment.Enter password for user root: ##<– 输入mysqld.log里的临时密码The existing password for the user account root has expired. Please set a new password.New password: ##<– 输入新密码。要求:大小写字母、数字、特殊字符组合Re-enter new password: ##<– 输入新密码。要求:大小写字母、数字、特殊字符组合
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.Estimated strength of the password: 100 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : Y ##<– 选择是New password: ##<– 输入新密码。要求:大小写字母、数字、特殊字符组合Re-enter new password: ##<– 输入新密码。要求:大小写字母、数字、特殊字符组合Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y ##<– 是否删除匿名用户,生产环境建议删除,所以直接回车
Success.Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.Disallow root login remotely? (Press y|Y for Yes, any other key for No) : N ##<– 是否禁止root远程登录,根据需求选择,建议禁止... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.Remove test database and access to it? (Press y|Y for Yes, any other key for No) : N ##<– 是否删除test数据库,直接回车... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.Reload privilege tables now? (Press y|Y for Yes, any other key for No) : ##<– 是否重新加载权限表,直接回车... skipping.
All done! 

2.4 配置 my.cnf

# 备份my.cnf文件
[root@openeuler ~]# sudo cp -a /etc/my.cnf /etc/my_back.cnf
# 编辑my.cnf文件
[root@openeuler ~]# sudo vi /etc/my.cnf# 修改以下内容:
[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
#
# 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
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid#############      分割线  从下面开始修改      #############
# 默认端口3306
# 注意:此处修改后,一定要更新 SELinux 端口策略
port=3366# 设置编码
# character-set-server=utf8
# collation-server=utf8_general_ci
character-set-server=utf8mb4
collation-server=utf8mb4_general_ci# 1.默认采用InnoDB存储引擎
default-storage-engine=INNODB# 2.设置大小写敏感
lower_case_table_names=1# 3.sql_mode定义了支持的sql语法、数据校验等
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION# 最大并行连接数
max_connections=100000[mysql]
# default-character-set = utf8
default-character-set = utf8mb4[mysql.server]
# default-character-set = utf8
default-character-set = utf8mb4[mysqld_safe]
# default-character-set = utf8
default-character-set = utf8mb4[client]
# default-character-set = utf8
default-character-set = utf8mb4

2.5 重启服务

# 如果/etc/my.cnf修改了默认端口,此处一定要更新 SELinux 端口策略
[root@openeuler ~]# sudo semanage port -a -t mysqld_port_t -p tcp 3366
# 重启
[root@openeuler ~]# sudo systemctl daemon-reload
[root@openeuler ~]# sudo systemctl restart mysqld

三、配置 MySQL

# 登录 MySQL
[root@openeuler ~]# mysql -u root -p
Enter password:     ## 在【运行安全配置向导】设置的密码# 重置密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码';
# 授权远程访问权限
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你的新密码' WITH GRANT OPTION;
# 刷新策略
mysql> FLUSH PRIVILEGES;#修改密码长度限制策略
mysql> set global validate_password_policy=0;   #--表示将密码安全等级设置为low
mysql> set global validate_password_length=1;   #--表示将密码长度设置为最小6位
mysql> FLUSH PRIVILEGES;# 查看服务编码UTF8
mysql> SHOW VARIABLES LIKE 'character%';
# 查看最大连接数
mysql> SHOW VARIABLES LIKE 'max_connections';
# 查看存储路径
mysql> SHOW VARIABLES LIKE '%datadir%';# 退出
mysql> exit

四、修改默认存储路径

修改 Mysql 5.7 默认数据库存储路径

五、开放防火墙端口

# 查询端口是否开放
[root@openeuler ~]# sudo firewall-cmd --query-port=3306/tcp
[root@openeuler ~]# sudo firewall-cmd --query-port=3366/tcp
# 开放端口(TCP协议)
[root@openeuler ~]# sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent
[root@openeuler ~]# sudo firewall-cmd --zone=public --add-port=3366/tcp --permanent
# 重新加载防火墙规则
[root@openeuler ~]# sudo firewall-cmd --reload
# 验证端口是否开放
[root@openeuler ~]# sudo firewall-cmd --zone=public --list-ports
# 查看所有端口
[root@centosServer ~]# sudo netstat -nlpt

六、数据备份

Linux 环境下 Mysql 5.7 数据定期备份

七、生产环境优化

生产环境优化 Mysql 5.7

八、常用命令

# 启动服务
sudo systemctl start mysqld
# 查看服务状态
sudo systemctl status mysqld
# 重启服务
sudo systemctl restart mysqld
# 停止服务
sudo systemctl stop mysqld#开启开机启动
sudo systemctl enable mysqld
#关闭开机启动
sudo systemctl disable mysqld
#查看开机启动
sudo systemctl list-unit-files | grep mysqld查看版本:mysql -V查看进程:ps -ef | grep mysqld
如果有mysqld_safe和mysqld两个进程,说明MySQL服务当前在启动状态

文章转载自:

http://u3K92SG0.yhtnr.cn
http://sGilVauJ.yhtnr.cn
http://Y6LolQGo.yhtnr.cn
http://TPVOPHET.yhtnr.cn
http://K9TyAR6c.yhtnr.cn
http://gtZcEaNQ.yhtnr.cn
http://wjNUTtOB.yhtnr.cn
http://LrRl7qHu.yhtnr.cn
http://j9nEIfAw.yhtnr.cn
http://LsZgAspF.yhtnr.cn
http://ohvgAkoq.yhtnr.cn
http://Rt7D6sr1.yhtnr.cn
http://ILhoGOMk.yhtnr.cn
http://4n9CHMA6.yhtnr.cn
http://eoaVY4xD.yhtnr.cn
http://BFvTt8T6.yhtnr.cn
http://92C8pLIA.yhtnr.cn
http://q7a2NaNf.yhtnr.cn
http://u3P9IPiz.yhtnr.cn
http://iJfFUt2i.yhtnr.cn
http://6tAUhDgb.yhtnr.cn
http://vvO6F5bA.yhtnr.cn
http://0O1tiY2e.yhtnr.cn
http://c0ZPH8IA.yhtnr.cn
http://xTmsiUOX.yhtnr.cn
http://EEKv6id2.yhtnr.cn
http://Po5fx3rI.yhtnr.cn
http://xswptDFO.yhtnr.cn
http://8jvkxqxK.yhtnr.cn
http://E3vWPGAM.yhtnr.cn
http://www.dtcms.com/wzjs/682371.html

相关文章:

  • 品牌网站运营云南测绘公司最新排名
  • 安平县建设局网站网站域名选择
  • 旅游网站的导航栏目设计腾讯企点官网
  • 八面通网站建设react怎么做pc网站
  • 珠海建设工程备案网站关键词优化收费标准
  • githup网站建设游戏公司排行榜前十名
  • 双喜常州网站建设怎么用手机做抖音上最火的表白网站
  • 网站后台如何设计北京文化墙设计公司
  • 怎么选择徐州网站开发北京旅游外贸网站建设
  • 织梦可以做微网站吗附近有没有学电脑的培训机构
  • 沧州高端网站制作wordpress安装权限设置
  • 做网站如何选域名国内做的好的电商网站有哪些方面
  • 校园官方网站如何制作网站开发 html
  • 网站建设有哪些关键细节wordpress类
  • 茂名网站建设托管手机网站生成小程序
  • 建材网站开发淘宝网店模板
  • 江苏省住房保障建设厅网站首页服务器租用多少钱一月
  • 做刷单网站犯法吗百度搜索引擎营销如何实现
  • 互联网网站定位建站公司的服务内容
  • 网站建设公司选哪家仿站在线
  • 怎么注册网站软文范例500字
  • 十大接单网站做网站的证书
  • 西丽网站建设国际购物网站排名
  • 永州网站建设gwtcms网站建设全包专业定制
  • 网站制作的困难与解决方案做网站建设给人销售
  • 阿里云1m服务器可以搭建网站西安3d效果图制作公司
  • 用手机做网站的软件搭建网站免费空间
  • 合肥做网站推荐 晨飞网络100m网站注册
  • 网站一直没收录外贸网站打开速度
  • 品牌网站建设必在大蝌蚪wordpress多榜单查询