Home > Database > Mysql Tutorial > body text

mysql 中use mysql denied_MySQL

WBOY
Release: 2016-06-01 13:11:03
Original
1279 people have browsed it

mysql -u root -p 提示:

mysqladmin: CREATE DATABASE failed; error: 'Access denied for user ''@'localhost' to database 'cacti''

原因是mysql的密码有问题

用mysql匿名用户可以进入数据库,但是看不见mysql数据库.

解决办法:

具体操作步骤:
关闭mysql:
# service mysqld stop
然后:
# mysqld_safe --skip-grant-tables
启动mysql:
# service mysqld start
mysql -u root
mysql> use mysql
mysql> UPDATE user SET Password=PASSWORD('xxx') WHERE user='root';
mysql> flush privileges;
mysql>/q

到这里密码已经修改成功,

mysql -u root -p


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!