mysql 易错

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 易错_第1张图片


你可能感兴趣的:(sql,c,mysql,server,user)