mysql以noinstall方式部署

     部署过程中,将用mysqld命令配置好配置文件*.ini的位置,>mysqld --defaults-file=c:\sdk\mysql\my-default.ini --initialize;

     编辑my.ini的基本配置,主要是basedir和datadir;

     然后使用mysqld 命令初始化生成data文件夹,注意自动生成密码方式或者以无密码的方式初始化;

     然后第一次运行mysql服务,可以在mysqld --console模式下,这样可以看到控制台的输出,>mysqld --console。注意运行成功的提示是Version: '5.7.10'  socket: ''  port: 3306  MySQL Community Server (GPL)。

     打开新的cmd窗口,连接服务端,测试连接和服务端是否正常,使用自动生成的密码连接,时间间隔比较久会出现如下密码过期限制连接提示:

      C:\sdk\mysql\bin>mysqlshow -u root
       Enter password: ************
       mysqlshow: Your password has expired.  To log in you must change it using a client that supports expired passwords.

       可以通过这样的方式更改密码:

         C:\sdk\mysql\bin>mysqladmin -u root -p password
          Enter password: ************
          New password: ****
          Confirm new password: ****
          Warning: Since password will be sent to server in plain text, use ssl connection
          to ensure password safety.

       如果能连接mysql,也可以用这种方式更改密码:

       mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password'

         更改了密码,再测试mysql数据库服务连接如下,就成功了:

          C:\sdk\mysql\bin>mysqlshow -u root -p

          Enter password: ****
          +--------------------+
          |     Databases      |
           +--------------------+
          | information_schema |
          | mysql              |
          | performance_schema |
          | sys                |
          +--------------------+


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值