3月8
很多MySQL程序都会带有匿名登录的功能。
在刚刚安装完MySQL之后,就能够登录数据库啦。
这对于平时使用MySQL来说也基本没有什么,可是假设我们想部署数据库的时候。这样的登录方式式绝对不能存在的!试想一下,假设你的数据库随便就能够进入的话,我想你一定会在半夜收到电话,说数据出问题啦!
以下介绍一下删除匿名用户的方式:
首先使用命令进入数据库
[root@localhost raul]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution
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
在刚刚安装完MySQL之后,就能够登录数据库啦。
这对于平时使用MySQL来说也基本没有什么,可是假设我们想部署数据库的时候。这样的登录方式式绝对不能存在的!试想一下,假设你的数据库随便就能够进入的话,我想你一定会在半夜收到电话,说数据出问题啦!
以下介绍一下删除匿名用户的方式:
首先使用命令进入数据库
[root@localhost raul]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution
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





