在Linux下安装MySQL的二进制源代码包(三)

2014-11-24 17:32:02 · 作者: · 浏览: 8
or \g.
Your MySQL connection id is 4
Server version: 5.0.51a MySQL Community Server (GPL)


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql> //登录成功!
mysql> exit;
Bye
15.给新建的用户账户授权,如下:
//登录MYSQL(有ROOT权限)。我里我以ROOT身份登录.
[root@localhost local]# bin/mysql --port=3306 -u root -p -S /tmp/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51a MySQL Community Server (GPL)


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql>
//首先为用户创建一个数据库(django_demo)
mysql> create database django_demo;
Query OK, 1 row affected (0.41 sec)
//授权django用户拥有django_demo数据库的所有权限。
mysql> grant all privileges on django_demo.* to 'django'@'localhost' identified by 'django';
Query OK, 0 rows affected (0.13 sec)
//刷新系统权限表
mysql> flush privileges;
Query OK, 0 rows affected (0.09 sec)