发布于 2015-06-02 10:56:56 | 1670 次阅读 | 评论: 1 | 来源: PHPERZ

这里有新鲜出炉的Mysql教程,程序狗速度看过来!

Mysql关系型数据库管理系统

MySQL是一个开放源码的小型关联式数据库管理系统,开发者为瑞典MySQL AB公司。MySQL被广泛地应用在Internet上的中小型胜博发888手机平台中。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,许多中小型胜博发888手机平台为了降低胜博发888手机平台总体拥有成本而选择了MySQL作为胜博发888手机平台数据库。


问题描述

新装的mysql,访问mysql数据库是遇到问题:ERROR 1044 (42000): Access denied for user ''@'localhost'to database 'mysql',

[[email protected]www mysql-5.1.61]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61 Source distribution

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> use mysql
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

mysql>

解决方案

打开my.ini,在

[mysqld]
skip-external-locking
skip-name-resolve
#skip-grant-tables

其中skip-grant-tables跳过权限验证是被注释掉的,去掉注释,重新启动mysql:

[[email protected] libexec]# /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/data0/mysqldata --user=mysql --log-error=/data0/mysqldata/mysql-error.log --open-files-limit=20000 --pid-file=/data0/mysqldata/dzwww.com-B15-5-3-36.pid --socket=/tmp/mysql.sock --port=3306

[[email protected] mysql-5.1.61]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61-log Source distribution

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> use mysql
Database changed
mysql>grant all privileges on *.* to [email protected] identified by 'mysql'

然后重新登录 ok,成功!



相关阅读 :
mysql错误ERROR 1044 (42000): Access denied for user ''@'localhost'to database 'mysql',的解决办法
mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database
解决mysql创建数据库后出现:Access denied for user 'root'@'%' to database 'xxx'的问题
MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决
MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的原因分解决办法
ubuntu系统中Mysql ERROR 1045 (28000): Access denied for user [email protected] localhost问题的解决方法
mysql错误:Access denied for user 'root'@'localhost' (using password: YES)解决方法
新装MySql后登录出现root帐号提示mysql ERROR 1045 (28000): Access denied for use的解决办法
mysql Access denied for user ‘root’@’localhost’ (using password: YES)解决方法
linux mysql忘记密码的多种解决或Access denied for user 'root'@'localhost'
Can't connect to MySQL server的解决办法
MySQL ERROR 1045 (28000) 错误的解决办法
最新网友评论  共有(1)条评论 发布评论 返回顶部
wbmid 发布于2016-03-29 05:34:03
转来的能不能尊重一下作者!!
支持(0)  反对(0)  回复
月排行榜

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  服务