1、服务未打开
C:\Users\zz>mysql -uroot -p
Enter password: *****
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:\Users\zz>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
2、语句后不加;或\g
mysql> use test;
Database changed
mysql> use test
Database changed
mysql> slect * form user
-> select * form user
-> select * from user;
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 'slect
* form user
select * form user
select * from user' at line 1
mysql> select * from user;
+----+----------+----------+------+
| Id | Username | Password | Age |
+----+----------+----------+------+
| 1 | 张泽 | mysql | 22 |
+----+----------+----------+------+
1 row in set (0.08 sec)
mysql 易错
最新推荐文章于 2024-07-26 03:47:23 发布