数据库使用

1.启动数据库服务器

win + r 

services.msc

数据库使用数据库使用

找到mysql 右键启动

 

以管理员身份运行cmd

数据库使用

 

2.启动:   net start mysql

数据库使用

 

3.关闭:net stop mysql

4.登录: mysql -h ip -P 端口 -u 用户名 -p

C:\Windows\system32>mysql -h localhost -P 3306 -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.31 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

数据库使用