...Access denied for user 'root'@'localhost' (using password: NO)
MySQL安装时默认的用户是root,这里的root是指数据库的用户,root密码一般在初始化MySQL时存放在你的日志文件中,日志文件的存放路径可以通过my.cnf文件进行自定义。
使用如下方法即可解决,本人已验证可行。
#1.停止mysql数据库/etc/init.d/mysqld stop#2.执行如下命令mysqld_safe --user=mysql --skip-grant-tables --skip-networking .使用root登录mysql数据库mysql -u root mysql#4.更新root密码mysql>UPDATE user SET Password=PASSWORD('newpassword') where USER='root';#最新版MySQL请采用如下SQL:mysql>UPDATE user SET authentication_string=PASSWORD('newpassword') where USER='root';#5.刷新权限 mysql>FLUSH PRIVILEGES;#6.退出mysqlmysql>quit#7.重启mysql/etc/init.d/mysqld restart#8.使用root用户重新登录mysqlmysql -uroot -p Enter password:
...#1045
刚使用mysql, 就老是碰到这个问题,真是郁闷, 终于找到原因..C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: N O) 解决方法:Step 1:C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 28 to server version: 5.0.24a-community-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer.Step 2:C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql mysql>status 正常使用....-------------------------------------------------- 我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:# mysql -uroot -p Enter password:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 使用网上介绍的方法修改root用户的密码:# mysqladmin -uroot -p password 'newpassword' Enter password:mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)' 现在终于被我找到了解决方法,如下(请先测试方法三,谢谢!):方法一:# /etc/init.d/mysql stop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &# mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root'; mysql> FLUSH PRIVILEGES; mysql> quit# /etc/init.d/mysql restart# mysql -uroot -p Enter password: mysql> 方法二:直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:# mysql -udebian-sys-maint -p Enter password: mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root'; mysql> FLUSH PRIVILEGES; mysql> quit# mysql -uroot -p Enter password: mysql> 方法三:这种方法我没有进行过测试,因为我的root用户默认密码已经被我修改过了,那位有空测试一下,把结果告诉我,谢谢!!# mysql -uroot -p Enter password: 至此,困惑多时的问题解决了!Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1683765
phpadmin因忘记密码无法登陆数据库的问题
我原来都是正确的,然后重启可能能好用还有就是用http://localhost/而不用127.0.0.1看一下下面的文章安装 phpMyAdmin 下载得到 phpMyAdmin-2.10.0.2-all-languages.zip,将其解压到 你网站根目录下并重命名为phpMyAdmin,找到并打开 libraries/config.default.php (有些版本是当前目录的 config.inc.php或者 config.defaut.php)做以下修改: 1 查找 password 有如下两行$cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = ''; 把你的mysql密码填到$cfg['Servers'][$i]['password'] = ''; 单引号里边 2 搜索 $cfg['PmaAbsoluteUri'],将其设置为 phpMyAdmin 目录路径,如:http://localhost/phpMyAdmin/ ; 3 搜索 $cfg['DefaultLang'],将其设置为 zh-gb2312 ;下面这项根据自己需要的编码修改(如果对数据库编码不是很熟悉的建议不要修改)4 搜索 $cfg['DefaultCharset'],将其设置为 自己所要的编码.打开浏览器,输入:http://localhost/phpMyAdmin/,Apache 和 MySQL 均已启动,如果没有错误.证明好用了
...Access denied for user 'root'@'127.0.0.1' (using password: NO)
如果密码没有错误,那就是你没有开通访问权限,要去mysql库中的user表中增加相应的权限。
用mysql 账号连接>mysql -uroot -proot //使用超级管理员账号连接mysql数据库>use mysql //切换到mysql数据库>select host from user; //查看user用户表中host字段是否是%,如果不是,改成%>update user set host='%';进入mysql的安装的bin目录我的是:C:\Program Files\MySQL\MySQL Server 5.0\bin
NAVICAT远程访问错误1045 别人电脑能连 我的不行我自己电脑ip是...
会碰到使用Navicat for mysql 远程连接 mySql数据库会提示10061、1045错误或 2003-Can't connect to MySQL on '192.168.1.2'(10061),这个原因是因为MySQL不准许远程连接。
最简单的办法是MySQL远程配置代码如下 复制代码 GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'your paaaword'; %表示多有机器。
打开3306端口,为防火墙设置例外,放行3306.但你必须有root权限了,还可以如下方法修改:1:在服务端MySQL文件夹下找到my.ini文件。
修改bind-address=127.0.0.1 为 bind-address=0.0.0.0 (在MySQL 5的my.ini中未发现此项)2:重新启动MySQL服务。
测试连接情况:如果没有给远程登录用户添加所有机器都能访问的权限,将会出现“1045-Access denied for user root@IT(using password:NO)”,这表明需要添加权限;添加命令如下:代码如下 复制代码 1)grant all on *.* to 用户名@"%" identified by "密码";2)flush privileges;完成以上步骤,就可以远程访问MySQL数据库了。
permitrootlogin no 后为什么root还是可以远程登录
PermitRootLogin如果不设置,默认是yes,也就是root可以登录如果设置without-password 那么root可以登录,但是不允许通过密码ssh登陆如果设置no, root不许登陆如果设置forced-commands-only,则可以登录,但是登陆后不能进入交互,而是执行指定的命令后 自动退出,指定的命令在authorized_keys里面列出例如/bin/dateman的描述如下PermitRootLoginSpecifies whether root can log in using ssh(1). The argument must be “yes”,“without-password”, “forced-commands-only”, or “no”. The default is “yes”.If this option is set to “without-password”, password authentication is disabled for root.If this option is set to “forced-commands-only”, root login with public key authenticationwill be allowed, but only if the command option has been specified (which may be useful fortaking remote backups even if root login is normally not allowed). All other authentica‐tion methods are disabled for root.If this option is set to “no”, root is not allowed to log in.
转载请注明出处51数据库 » useing password no