二进制包安装MySQL数据库(2)

mysql> show databases;  ##查看数据库;
+--------------------+
| Database          |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test              |
+--------------------+
4 rows in set (0.00 sec)

mysql> drop database test;  ##删除test库;
Query OK, 0 rows affected (0.00 sec)

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

mysql> select user,host from mysql.user;  ##查看用户列表;
+------+---------------+
| user | host          |
+------+---------------+
| root | 127.0.0.1    |
| root | ::1          |
|      | Mysql\_server |
| root | Mysql\_server |
|      | localhost    |
| root | localhost    |
+------+---------------+
6 rows in set (0.00 sec)

mysql> drop user root@'::1';  ##删除无用用户
Query OK, 0 rows affected (0.00 sec)

mysql> drop user ''@'Mysql\_server';      ##对于大写、特殊字符删除不了,下面有介绍
Query OK, 0 rows affected (0.00 sec)

mysql> drop user ''@'localhost';   
Query OK, 0 rows affected (0.01 sec)

mysql> drop user 'root'@'Mysql\_server';  对于大写、特殊字符删除不了,下面有介绍
Query OK, 0 rows affected (0.00 sec)

mysql> select user,host from mysql.user;
+------+---------------+
| user | host          |
+------+---------------+
| root | 127.0.0.1    |
|      | Mysql\_server |
| root | Mysql\_server |
| root | localhost    |
+------+---------------+
4 rows in set (0.00 sec)
对于大写、特殊字符删除不了解决办法:
mysql> delete from mysql.user where user="" and host="Mysql\_server";
Query OK, 1 row affected (0.02 sec)

mysql> delete from mysql.user where user="root" and host="Mysql\_server";
Query OK, 1 row affected (0.00 sec)

mysql> select user,host from mysql.user;  ##将无用用户删除以后,查看用户列表                             
+------+-----------+
| user | host      |
+------+-----------+
| root | 127.0.0.1 |
| root | localhost |
+------+-----------+
2 rows in set (0.00 sec)
mysql> flush privileges;  ##最后使得权限生效
Query OK, 0 rows affected (0.00 sec)

创建用户sql语句:

mysql> grant all on *.* to 'root'@'localhost' identified by '123456' with grant option;flush privileges;

CentOS7编译安装MySQL 5.6.28和编译参数 

MySQL二进制日志操作  

Linux下MySQL 5.6.12数据库编译安装

CentOS 7下源码安装MySQL 5.6 

MySQL5.7.3.0安装配置图解教程

Ubuntu 14.04下安装MySQL

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/46e0fe76089f6cecd9bc545d4d36c0ee.html