MySQL基础语句
------------------------------------------------ mysql启动不了使用: 1. 先把启动程序kill了 mysqld 2. 重启mysql服务 service mysql restart ------------------------------------------------- 用户相关操作 注:以下命令均需先以root身份登录mysql:mysql -uroot -p 1.添加新用户 (1)创建新用户:> insert into mysql.user(Host,User,Password) values("localhost","user1",password("password1")); (2)为用户分配权限: 设置用户可以在本地访问mysql:grant all privileges on *.* to username@localhost identified by "password" ; 设置用户只能访问指定数据库:grant all privileges on 数据库名.* to username@localhost identified by "password" ; (3)刷新系统权限表:>flush privileges; 2.查看MySql当前所有的用户:>SELECT DISTINCT