使用root用户可以直接建,其他用户要先用root授权。 把你的bin目录添加到环境变量path里,然后就可以用控制台进行操作了。 [root用户] C:\>mysql -uroot -p Enter password: **** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.24a-community-nt-logType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> create database db1; Query OK, 1 row affected (0.05 sec)mysql> ====================== create database db1;这句就是建立数据库的,注意以分号结束。--------------------------------- [其他用户] 假设用户alin想创建一数据库yanlin。则首先用root身份运行命令: mysql> GRANT ALL ON yanlin.* TO alin@localhost; 然后以alin的身份执行相关的SQL语句: mysql> CREATE DATABASE yanlin;
把你的bin目录添加到环境变量path里,然后就可以用控制台进行操作了。
[root用户]
C:\>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.24a-community-nt-logType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> create database db1;
Query OK, 1 row affected (0.05 sec)mysql>
======================
create database db1;这句就是建立数据库的,注意以分号结束。---------------------------------
[其他用户]
假设用户alin想创建一数据库yanlin。则首先用root身份运行命令:
mysql> GRANT ALL ON yanlin.* TO alin@localhost;
然后以alin的身份执行相关的SQL语句:
mysql> CREATE DATABASE yanlin;