连接数据库
命令行连接!
net start mysql
mysql -u root -p123456 --连接数据库
update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost' -- 修改用户密码
flush privileges; --刷新权限
----------------------------------------------------
-- 所有的语句都使用;结尾
show databases; -- 查看所有的数据库
mysql> use school -- 切换数据库 use + 数据库名
Database changed
show tables; -- 查看数据库中所有的表
describe student; -- 显示数据库中所有的表的信息
create database westos; -- 创建一个名为westos的数据库
exit; -- 退出连接
-- 单行注释(SQL本来的注释)
/* (SQL的所行注释)
*/