分页: 1 / 1

mysql登录账号

发表于 : 2012-09-25 16:18
softsword
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>

Re: mysql登录账号

发表于 : 2012-09-25 16:23
qy117121
$mysql
ERROR 1045 (28000): Access denied for user 'lengxx'@'localhost' (using password: NO)

Re: mysql登录账号

发表于 : 2012-10-02 11:52
benfeizhuzi
在本地运行的mysql当然能够本地登录啦,不过能不能用数据库就另一个问题了

Re: mysql登录账号

发表于 : 2013-01-04 22:45
bluebirdshao
为什么你不先 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

Re: mysql登录账号

发表于 : 2013-01-04 22:54
bluebirdshao
you should be able to connect to that server by invoking mysql without any options

Re: mysql登录账号

发表于 : 2013-01-05 0:18
biglinuxfans
楼上的正解,你需要删除匿名用户,[url=http://www.zhetenger.com/mysql%E5%9F%BA ... E%E7%BD%AE]mysql基本安全设置/url]