关于MySQL的多用户问题
来源:互联网 发布:阿里云 马云 王坚 编辑:程序博客网 时间:2024/05/21 14:04
1)进入控制台
方法一:通过安装的MySQL Commond Line Client输入密码进入控制台
方法二:通过Dos命令提示符进入
1. 找到MySQL的安装目录下的bin文件夹,复制路径。
2. 在命令提示行中使用cd命令,切换到MySQL的bin目录
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Windows\system32>cd../../
C:\>cd C:\Program Files\MySQL\MySQL Server 5.6\bin
2)登陆
1、输入登陆的命令:mysql -h 主机名 -u 用户名 -p
2、系统提示输入密码
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -h localhost -u root -p
Enter password: ***
3、登陆成功
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.13-enterprise-commercial-advanced MySQL Enterprise Server -
Advanced Edition (Commercial)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
3)创建数据库
使用root用户创建数据
mysql> create database zhuyanli;
Query OK, 1 row affected (0.34 sec)
4)添加用户:
使用root用户添加其他用户
1、添加用户
mysql> insert into mysql.user(host,user,password,ssl_cipher,x509_issuer,x509_sub
ject,authentication_string)values('localhost','zhuyanli',password('123'),'y','y'
,'y','y');
Query OK, 1 row affected (0.53 sec)
1、给用户授权
mysql> grant all privileges on zhuyanli.* to lijiantao identified by"123";
Query OK, 0 rows affected (0.20 sec)
5)用新添加的用户登陆
mysql> \q
Bye
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -h lijiantao -u zhuyanli -p
Enter password: ***
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.6.13-enterprise-commercial-advanced MySQL Enterprise Server -
Advanced Edition (Commercial)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| student |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> \q
Bye
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -h 172.22.64.26 -u lijiantao -
p
Enter password: ***
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.6.13-enterprise-commercial-advanced MySQL Enterprise Server -
Advanced Edition (Commercial)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| student |
| test |
+--------------------+
3 rows in set (0.00 sec)
- 关于MySQL的多用户问题
- 关于 win7 远程桌面的多用户问题
- 关于多用户时hadoop的权限问题
- 关于mysql如何创建多用户
- 关于linux多用户修改同一文件的问题
- win7 远程桌面的多用户问题
- 关于Linux上SAMBA服务的权限问题(多用户挂载)
- 关于mysql的问题
- 多用户情况下的Mysql设置
- HDFS多用户时的权限问题
- MYSQL 关于中文的问题
- 关于MySql字符集的问题
- 关于mysql的统计问题
- 关于MySQL的读法问题。
- 关于Mysql字符集的问题
- 关于mysql字符集的问题
- 关于MySql字符集的问题
- 关于MySql字符集的问题
- Android EditText显示图片的两种方法
- 雪中送炭:十大前沿移动应用开发工具
- 银行业务调度系统II
- 许留山导入到SQL “文本被截断,或者一个或多个字符在目标代码页中没有匹配项”错误的解决
- 总结六年的嵌入式软件研发
- 关于MySQL的多用户问题
- String相关的面试题
- uva 437 - The Tower of Babylon(DP)
- U-Boot移植(二)——U-Boot编译过程分析(3)
- DIV+CSS来布局网站
- C++引用与指针的关系
- samba 4.0.7 devel 编程之用户管理篇
- ubuntu快速配置网卡bonding
- ASP.NET MVC