MySql连接

使用命令提示符(管理员)连接

实例

打开cmd命令提示符(管理员)连接,开启mysql 服务

C:Windowssystem32>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

命令行中连接mysql

C:Windowssystem32>mysql -u root -p
Enter password: *********

登录成功,输出

Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.6.24 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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>

密码错误,登录失败

C:Windowssystem32>mysql -u root -p
Enter password: *********
ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

退出

mysql>quit
Bye

文章来源于互联网:MySql___(2) MySQL 连接

发表评论