一、启动 C:/mysql/bin>mysqld-nt -install Service successfully installed. C:/mysql/bin>net start mysql MySQL服务已经启动成功。 C:/mysql/bin>mysql -u root Welcome to the MySQL monitor... 二、查看所有用户 mysql> select user,host,password from mysql.user; +-----------+-----------+-------------------------------------------+ | user | host | password | +-----------+-----------+-------------------------------------------+ | root | localhost | | | notepress | % | *BCB5DC87FD828DF207979672104EC528C0A0340E | | notepress | localhost | *BCB5DC87FD828DF207979672104EC528C0A0340E | +-----------+-----------+-------------------------------------------+ 3 rows in set (0.01 sec) 三、创建库和用户 create database testdb; -- 先赋予用户对testdb库下所有权限,然后一个个移出楼主禁止其操作的权限 -- 建用户的时候赋予权限,用户名为test,密码test,只能以localhost的主机登录。 grant all on testdb.* to 'test'@'localhost' identified by 'test';