mysql登录账号

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
softsword
帖子: 1
注册时间: 2012-04-23 20:19

mysql登录账号

#1

帖子 softsword » 2012-09-25 16:18

mysql实在ubuntu 12.04下通过sudo apt-get install mysql-server mysql-client安装的,安装时要求为root制定密码,已经指定-----

安装完成后,以当前用户身份在Terminal中敲mysql 竟然直接登入了数据库,敲mysql -u root -p 要求输入密码也登录成功,这是神马问题,非root用户直接敲mysql都能进,难道没密码?????????


=======================================================================================================================
~$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 46
Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2011, 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>
上次由 softsword 在 2012-09-25 16:33,总共编辑 1 次。
头像
qy117121
论坛版主
帖子: 50550
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: mysql登录账号

#2

帖子 qy117121 » 2012-09-25 16:23

$mysql
ERROR 1045 (28000): Access denied for user 'lengxx'@'localhost' (using password: NO)
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
benfeizhuzi
帖子: 43
注册时间: 2008-05-31 13:43

Re: mysql登录账号

#3

帖子 benfeizhuzi » 2012-10-02 11:52

在本地运行的mysql当然能够本地登录啦,不过能不能用数据库就另一个问题了
bluebirdshao
帖子: 186
注册时间: 2007-11-26 12:05

Re: mysql登录账号

#4

帖子 bluebirdshao » 2013-01-04 22:45

为什么你不先 hack 一下 MySQL 官方文档呢?
文档里面已经明确指出:
Some MySQL installations permit users to connect as the anonymous (unnamed) user to the server running on the local host.
If this is the case on your machine, you should be able to connect to that server by invoking mysql without any options:
http://dev.mysql.com/doc/refman/5.5/en/ ... cting.html
bluebirdshao
帖子: 186
注册时间: 2007-11-26 12:05

Re: mysql登录账号

#5

帖子 bluebirdshao » 2013-01-04 22:54

you should be able to connect to that server by invoking mysql without any options
biglinuxfans
帖子: 2
注册时间: 2013-01-04 23:32
系统: 2PF2

Re: mysql登录账号

#6

帖子 biglinuxfans » 2013-01-05 0:18

楼上的正解,你需要删除匿名用户,[url=http://www.zhetenger.com/mysql%E5%9F%BA ... E%E7%BD%AE]mysql基本安全设置/url]
回复