[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
1.服务的停止与启动
MySQL安装完毕之后,需要启动服务器进程,不然客户端无法连接数据库。
---以管理员身份运行windows命令提示符,否则会出现拒绝访问:
# 启动MySQL服务命令 net start MySQL服务名 # 停止MySQL服务命令 net stop MySQL服务名
1.MySQL服务处于已停止状态:
2.启动MySQL服务:
3.MySQL服务处于已启动状态:
start和stop后面的服务名应与之前配置环境变量时指定的服务名一致。
2.登陆与退出
格式:
mysql -h 主机名 -P 端口号 -u 用户名 -p密码
举例:
mysql -h localhost -P 3306 -u root -pabc123 # 之前设置的root用户的密码是abc123
登陆成功:
这里出现了警告,只需要改变密码输入的方法:
退出指令:
注意:
(1)-p与密码之间不能有空格,其他参数名与参数值之间可以有空格也可以没有空格。如:
mysql -hlocalhost -P3306 -uroot -pabc123
(2)密码建议在下一行输入,保证安全。
(3)客户端和服务器在同一台机器上,所以输入localhost或者IP地址127.0.0.1。同时,因为是连接本机:
-hlocalhost就可以省略,如果端口号没有修改:-P3306也可以省略。
登陆之前可以通过:
mysql -V
或者
mysql --version
的方式获取MySQL Server服务版本的信息。
登陆之后通过
select version();
查看当前版本信息。