博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MySQL下查看用户和建立用户
阅读量:5050 次
发布时间:2019-06-12

本文共 1879 字,大约阅读时间需要 6 分钟。

启动数据库:

[root@server ~]# mysqld_safe &[1] 3289[root@server ~]# 130913 08:19:58 mysqld_safe Logging to '/usr/local/mysql/data/server.gao.err'.130913 08:19:58 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

连接到数据库:

[root@server ~]# mysql -uroot -pEnter password: Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.6.13 MySQL Community Server (GPL)Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

 

查看数据库列表:

mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || performance_schema || test               |+--------------------+4 rows in set (0.00 sec)mysql>

 

查看用户状态:

mysql> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> select host,user from mysql.user;+------------+------+| host       | user |+------------+------+| 127.0.0.1  | root || ::1        | root || localhost  |      || localhost  | root || server.gao |      || server.gao | root |+------------+------+6 rows in set (0.00 sec)mysql>

 

创建用户:

mysql> create user 'usrabc'@'%' identified by 'usrabc';Query OK, 0 rows affected (0.00 sec)mysql> select host,user from mysql.user;+------------+--------+| host       | user   |+------------+--------+| %          | usrabc || 127.0.0.1  | root   || ::1        | root   || localhost  |        || localhost  | root   || server.gao |        || server.gao | root   |+------------+--------+7 rows in set (0.00 sec)mysql>

 

转载于:https://www.cnblogs.com/exmyth/p/10486553.html

你可能感兴趣的文章
css3动画属性
查看>>
第九次团队作业-测试报告与用户使用手册
查看>>
Equal Sides Of An Array
查看>>
CentOS笔记-用户和用户组管理
查看>>
Mongodb 基本命令
查看>>
Qt中QTableView中加入Check列实现
查看>>
“富豪相亲大会”究竟迷失了什么?
查看>>
控制文件的备份与恢复
查看>>
返回代码hdu 2054 A==B?
查看>>
Flink独立集群1
查看>>
iOS 8 地图
查看>>
20165235 第八周课下补做
查看>>
[leetcode] 1. Two Sum
查看>>
iOS 日常工作之常用宏定义大全
查看>>
PHP的SQL注入技术实现以及预防措施
查看>>
MVC Razor
查看>>
软件目录结构规范
查看>>
Windbg调试Sql Server 进程
查看>>
linux调度器系列
查看>>
mysqladmin
查看>>