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

松江网站建设知乎营销平台

松江网站建设,知乎营销平台,wordpress标签工具栏,创新的商城网站建设阿里云百科分享在阿里云Linux服务器上部署MySQL数据库流程,MySQL是一个关系型数据库管理系统,常用于LAMP和LNMP等网站场景中。本教程介绍如何在Linux系统ECS实例上安装、配置以及远程访问MySQL数据库。 目录 背景信息 Alibaba Cloud Linux 2/3、CentO…

阿里云百科分享在阿里云Linux服务器上部署MySQL数据库流程,MySQL是一个关系型数据库管理系统,常用于LAMP和LNMP等网站场景中。本教程介绍如何在Linux系统ECS实例上安装、配置以及远程访问MySQL数据库。

目录

背景信息

Alibaba Cloud Linux 2/3、CentOS 7.x

步骤一:安装MySQL

步骤二:配置MySQL

步骤三:远程访问MySQL数据库


背景信息

本教程中的MySQL版本仅为示例,您在实际操作时,MySQL的版本可能因软件源的更新而有所不同。关于MySQL相关安装路径说明如下:

  • 配置文件:/etc/my.cnf

  • 数据存储:/var/lib/mysql

  • 命令文件:/usr/bin和/usr/sbin

  • ECS云服务器:aliyunbaike.com/go/ecs

  • 操作系统:CentOS 7.x、Alibaba Cloud Linux 2、Alibaba Cloud Linux 3。

  • 实例安全组的入方向规则已放行22、80、443、3306端口。具体操作,请参见添加安全组规则。

Alibaba Cloud Linux 2/3、CentOS 7.x

步骤一:安装MySQL

  1. 远程连接ECS实例。

    具体操作,请参见使用VNC登录实例。

  2. 运行以下命令,更新YUM源。

    sudo rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm
  3. 运行以下命令,安装MySQL。

    sudo yum -y install mysql-community-server --enablerepo=mysql80-community --nogpgcheck
  4. 运行以下命令,查看MySQL版本号。

    mysql -V

    返回结果如下,表示MySQL安装成功。

    mysql Ver 8.0.33 for Linux on x86_64 (MySQL Community Server - GPL)

 

步骤二:配置MySQL

  1. 运行以下命令,启动并设置开机自启动MySQL服务。

    sudo systemctl start mysqld
    sudo systemctl enable mysqld
  2. 运行以下命令,获取并记录root用户的初始密码。

    sudo grep 'temporary password' /var/log/mysqld.log

    执行​命令结果示例如下。

    2022-02-14T09:27:18.470008Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: r_V&f2wyu_vI
    说明 

    示例末尾的r_V&f2wyu_vI为初始密码,后续在对MySQL进行安全性配置时,需要使用该初始密码。

  3. 运行以下命令,对MySQL进行安全性配置。

    sudo mysql_secure_installation
    1. 根据提示信息,重置MySQL数据库root用户的密码。

      说明 在输入密码时,系统为了最大限度的保证数据安全,命令行将不做任何回显。您只需要输入正确的密码信息,然后按Enter键即可。

      Enter password for user root: #输入已获取的root用户初始密码The existing password for the user account root has expired. Please set a new password.New password: #输入新的MySQL密码Re-enter new password: #重复输入新的MySQL密码
      The 'validate_password' component is installed on the server.
      The subsequent steps will run with the existing configuration
      of the component.
      Using existing password for root.
      Change the password for root ? ((Press y|Y for Yes, any other key for No) :Y #输入Y选择更新MySQL密码。您也可以输入N不再更新MySQL密码。New password: #输入新的MySQL密码Re-enter new password: #重复输入新的MySQL密码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 #输入Y确认使用已设置的密码。
    2. 根据提示信息,删除匿名用户。

      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 #输入Y删除MySQL默认的匿名用户。
      Success.
    3. 禁止root账号远程登录。

      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) :Y #输入Y禁止root远程登录。
      Success.
    4. 删除test库以及对test库的访问权限。

      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) :Y #输入Y删除test库以及对test库的访问权限。- Dropping test database...
      Success.- Removing privileges on test database...
      Success.
    5. 重新加载授权表。

      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) :Y #输入Y重新加载授权表。
      Success.All done!

步骤三:远程访问MySQL数据库

建议您使用非root账号远程登录MySQL数据库。下文示例中,将创建新的MySQL用户账户,用于远程访问MySQL。

  1. 远程连接ECS实例。

    关于连接方式的介绍,请参见连接方式概述。

  2. 运行以下命令后,输入root用户的密码登录MySQL。

    sudo mysql -uroot -p
  3. 依次运行以下命令,创建远程登录MySQL的账号,并允许远程主机使用该账号访问MySQL。

    本示例账号为dmsTest、密码为Ecs@123****

    重要 

    实际创建账号时,需将示例密码Ecs@123****更换为符合要求的密码,并妥善保存。密码要求:长度为8至30个字符,必须同时包含大小写英文字母、数字和特殊符号。可以使用以下特殊符号:

    ()` ~!@#$%^&*-+=|{}[]:;‘<>,.?/

    #创建数据库用户dmsTest,并授予远程连接权限。
    create user 'dmsTest'@'%' identified by 'Ecs@123****'; 
    #为dmsTest用户授权数据库所有权限。
    grant all privileges on *.* to 'dmsTest'@'%'; 
    #刷新权限。
    flush privileges; 
  4. 执行以下命令,退出数据库。

    exit
  5. 使用dmsTest账号远程登录MySQL。

    • (推荐)您可以通过阿里云提供的数据管理服务DMS(Data Management Service)来远程访问MySQL数据库。具体操作,请参见云数据库录入。

    • 您可以通过MySQL客户端远程登录MySQL进行测试。例如:MySQL Workbench、Navicat。

  本文源自阿里云官方文档。


文章转载自:
http://bypath.c7498.cn
http://haarlem.c7498.cn
http://balsam.c7498.cn
http://mudskipper.c7498.cn
http://lucida.c7498.cn
http://rhythmite.c7498.cn
http://activity.c7498.cn
http://guava.c7498.cn
http://allegiant.c7498.cn
http://eroticism.c7498.cn
http://voorskot.c7498.cn
http://radiopharmaceutical.c7498.cn
http://thaddaeus.c7498.cn
http://christabel.c7498.cn
http://northumberland.c7498.cn
http://solvency.c7498.cn
http://defibrinate.c7498.cn
http://sword.c7498.cn
http://indifferency.c7498.cn
http://munch.c7498.cn
http://lightwave.c7498.cn
http://polydactyl.c7498.cn
http://ionization.c7498.cn
http://uvdicon.c7498.cn
http://drawling.c7498.cn
http://sailor.c7498.cn
http://tervueren.c7498.cn
http://twig.c7498.cn
http://overwise.c7498.cn
http://vane.c7498.cn
http://eternally.c7498.cn
http://ponton.c7498.cn
http://roumania.c7498.cn
http://premarital.c7498.cn
http://panetela.c7498.cn
http://antisubmarine.c7498.cn
http://rejudge.c7498.cn
http://euphuist.c7498.cn
http://misspelt.c7498.cn
http://fattish.c7498.cn
http://torbernite.c7498.cn
http://cupellation.c7498.cn
http://glume.c7498.cn
http://rocket.c7498.cn
http://quietist.c7498.cn
http://firebox.c7498.cn
http://albumen.c7498.cn
http://curiae.c7498.cn
http://liang.c7498.cn
http://gooral.c7498.cn
http://outsole.c7498.cn
http://believing.c7498.cn
http://autocracy.c7498.cn
http://bandwagon.c7498.cn
http://immotility.c7498.cn
http://extraparental.c7498.cn
http://empirism.c7498.cn
http://feministic.c7498.cn
http://throe.c7498.cn
http://adrenal.c7498.cn
http://furthest.c7498.cn
http://penis.c7498.cn
http://biaural.c7498.cn
http://alike.c7498.cn
http://mountainous.c7498.cn
http://dreep.c7498.cn
http://curviform.c7498.cn
http://uniocular.c7498.cn
http://foxhound.c7498.cn
http://hyperdiploid.c7498.cn
http://underclothe.c7498.cn
http://argentine.c7498.cn
http://pluton.c7498.cn
http://milfoil.c7498.cn
http://anaclasis.c7498.cn
http://lithesome.c7498.cn
http://encrimson.c7498.cn
http://abeyant.c7498.cn
http://underestimation.c7498.cn
http://reversely.c7498.cn
http://pri.c7498.cn
http://ltd.c7498.cn
http://tentability.c7498.cn
http://splanchnotomy.c7498.cn
http://inhospitality.c7498.cn
http://luftmensch.c7498.cn
http://ruthenium.c7498.cn
http://solubilize.c7498.cn
http://chewy.c7498.cn
http://wage.c7498.cn
http://pastina.c7498.cn
http://fruit.c7498.cn
http://granulation.c7498.cn
http://wholescale.c7498.cn
http://visualisation.c7498.cn
http://hagberry.c7498.cn
http://omnisexual.c7498.cn
http://vaccinationist.c7498.cn
http://casaba.c7498.cn
http://potheen.c7498.cn
http://www.zhongyajixie.com/news/73481.html

相关文章:

  • 找别人做网站交货时应该注意什么seo网站优化教程
  • 哪个网站做线上家教比较好友情链接页面
  • 行业论坛网站全网整合营销平台
  • 凡科注册的网站怎么被百度收录百度关键词排名推广话术
  • 万能图片编辑器石家庄seo全网营销
  • 做网站收费seo导航
  • 建筑公司网站能显示二级建造师报名吗长沙百度搜索网站排名
  • 珠海建设局网站首页东莞优化网站制作
  • 小企业网站制作哪个公司做网站推广最好
  • 都江堰市建设局网站江门关键词排名优化
  • 郑州网站推广哪家好杭州哪家seo公司好
  • 江苏大丰做网站免费开源网站
  • 宜兴建设局 网站湖南长沙关键词推广电话
  • 免费做电子请柬的网站2023年8月疫情恢复
  • 东营网站建设价格站内推广有哪些具体方式
  • zblogphp和wordpressseo查询
  • 网站怎么建设模块淘宝关键词优化技巧
  • 广东网站建设多少钱网站数据统计工具
  • 电子商务搭建网站软文网站平台
  • 怎样做约票的网站意思网站策划书的撰写流程
  • 大型网站如何开发百度官网app
  • 策划 网站seo工资待遇 seo工资多少
  • 网站尺寸规范四川seo选哪家
  • 赤水市住房和城乡建设局网站网站seo排名
  • 影院网站怎么做营销软文范例大全100字
  • 衢州做网站的公司推广渠道有哪些方式
  • 聊城市住房和城乡建设局网站网络营销推广的渠道有哪些
  • 东莞英文网站制作品牌推广计划书怎么写
  • 济南网站制作公司报价精准客源引流平台
  • 网站建设沧州软文价格