数据库安装
# 安装 mysql server 5.5.40








# 卸载数据库
net stop mysql 然后在控制面板中卸载。
删除 c:\ProgramData 下面的 MySQL 目录。
删除 c:\Program Files 目录下的 MySQL 目录。
# 查看 MySQL 服务
启动服务: net start mysql
停止服务: net stop mysql
C:\Windows\System32>net stop mysql
MySQL 服务正在停止.
MySQL 服务已成功停止。
C:\Windows\System32>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 登录数据库
- 本地登录(显示密码登录): mysql -uroot -p123456
C:\Users\ylxyx>mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.40 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
- 本地登录(隐藏密码登录): mysql -uroot -p 回车键 Enter password ******
C:\Users\ylxyx>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.40 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
- 退出登录: exit
mysql>exit
Bye
1
2
2
# cmd sql 中文乱码解决办法
mysql> set character_set_client = gbk;
Query OK, 0 rows affected (0.00 sec)
mysql> set character_set_results = gbk;
Query OK, 0 rows affected (0.00 sec)
1
2
3
4
5
2
3
4
5
# cmd sql 查询结果凌乱解决办法
mysql> charset gbk;
Charset changed
1
2
2
编辑 (opens new window)
上次更新: 2025/02/15, 13:42:25