mysql:用 cmd 运行 mysql 数据库,及测试 mysql 是否安装成功。
Windows + R 打开搜索框,再输入 cmd 回车。
进入命令提示符,通过以下操作连接 mysql 。
mysql -uroot -p (运行)
然后输入密码,显示以上内容便是成功连接。
其次,root 是 mysql 用户名,我没有更改所以用原始的 root 。
如有更改,便把 root 换成你的用户名就可以了。
show databases; (运行)
查看 database 所有数据库,注意运行时记得加上英式分号。
其次 database 系统上显示不加 s ,但我们运行时要加上 s 。
这个 database 数据库是 mysql 自带,显示如上则视为成功。
use sys; (运行)
sys 是数据库名称,存在于 database 中。
注意数据库需存在 database 里,才会显示 Database changed 。
否则报错:ERROR 1049 (42000): Unknown database 'hhh'
报错译为:错误 1049 (42000):未知数据库“hhh”
quit; (运行)
显示 Bye 则是成功退出 mysql ,注意不要输入错误。
否则报错:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'qiut' at line 1.
报错译为:错误 1064(42000):您的 SQL 语法有误;请查阅 MySQL 服务器版本的手册,以获取第 1 行中“qiut”的正确语法。
。。。
下次更新 mysql 文章提示:
报错1: MySQL server on ‘localhost:3306‘ (10061)
报错2:Access denied for user 'root'@'localhost'
已更文章路径:
mysql:Can‘t connect to MySQL server on ‘localhost:3306‘ (10061) 或 (using password: YES)-CSDN博客
作者:、花无将