ERROR 1044 (42000)Access denied for user @localhost to database
ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘demo’
不管输入什么都是提示权限不够
mysql> create database sufadi;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'sufadi'
原因
默认情况是匿名用户登陆,所以我们需要设置一个密码,然后每次需要登陆以下并进入
D:\python3-webapp-Su\www>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.6.24 MySQL Community Server (GPL)Copyright (c) 2000, 2015, 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.
设置密码
管理员身份运行
进入安装目录的bin文件,右键选择管理员身份运行mysql.exe
设置密码
UPDATE user SET Password=PASSWORD(‘123456’) WHERE user=’root’;
mysql> UPDATE user SET Password=PASSWORD('123456') WHERE user='root';
Query OK, 3 rows affected (0.03 sec)
Rows matched: 3 Changed: 3 Warnings: 0
刷新一下
flush privileges;
mysql> flush privileges-> ;
Query OK, 0 rows affected (0.01 sec)
cmd窗口重新登陆一下
mysql -u root -p
输入密码
C:\Users\admin>mysql -u root -p
Enter password:
登陆成功
C:\Users\admin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.6.24 MySQL Community Server (GPL)Copyright (c) 2000, 2015, 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>
建立一个数据库
mysql> create database pythondb;
Query OK, 1 row affected (0.01 sec)
show databases
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| demo |
| mysql |
| performance_schema |
| pythondb |
| sufadi |
| test |
+--------------------+
7 rows in set (0.00 sec)
ERROR 1044 (42000)Access denied for user @localhost to database相关推荐
- error 1044 (42000):access denied for user ''@'localhost' to database 'mysql' 解决方法
重新安装mariaDB数据库时,出现安装权限问题,中止安装发现居然能够登陆mysql,但是登陆时可以不填密码,操作数据库时会报错:ERROR 1044 (42000): Access denied f ...
- Mysql,ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql' 刚在服务器上装上mysql,发现以root加 ...
- ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
提示:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'.前两天也出现过这个问题,网上找了一个比 ...
- error 1044 (42000):access denied for user ''@'localhost' to database 'mysql'
重新安装mariaDB数据库时,出现安装权限问题,中止安装发现居然能够登陆mysql,但是登陆时可以不填密码,操作数据库时会报错:ERROR 1044 (42000): Access denied f ...
- 创建数据库 mysql 1044_mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database...
1. 问题描述: 在MySQL控制台下创建数据库出现以下信息: mysql> CREATE DATABASE python; ERROR 1044 (42000): Access denied ...
- 解决 ERROR 1044 (42000): Access denied for user ‘‘@‘localhost‘ to database ‘mysql‘
然后创建一个数据库,提示下图错误: 提示:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'.是 ...
- 解决忘记密码报错ERROR 1044 (42000): Access denied for user ‘‘@‘localhost‘ to database ‘mysql‘的办法
由于长时间没用登录mysql忘记密码报错,ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql',导 ...
- error 1044 mysql_mysql ERROR 1044 (42000): Access denied for user ''@'localhost' to database
1. 问题描述: 在MySQL控制台下创建数据库出现以下信息: mysql> CREATE DATABASE python; ERROR 1044 (42000): Access denied ...
- 终于解决 ERROR 1044(42000): Access denied for user ''@'localhost' to database,亲测有效
在 create database mytestsql 时出现错误: ERROR 1044(42000): Access denied for user ''@'localhost' to datab ...
最新文章
- 支持向量机(SVM)
- Spring Security 实战:自定义异常处理
- Linux中使用Linux的vim如何让代码高亮显示
- ArcGIS Server for Silverlight 之集群(Simple Clusterer)
- 51nod 2497 数三角形
- Make Games with Python Pygame (2)
- 在Ubuntu上安装RealPlayer的方法
- PHP-FPM 与 Nginx 的通信机制总结
- TellDontAsk的扩展
- Ui设计中的动画如何应用,你知道吗?
- iOS及Mac开源项目和学习资料【超级全面】
- Zigbee之旅(十):综合小实验——基于CC2430的温度监测系统(转)
- 呕心沥血大放血,今天小企鹅来给大家送福利了!!!Mac.Win.Lin虚拟机映像/资源超全[分享]
- larvel html转pdf文件,如何在Laravel中使用TCPDF从HTML生成PDF
- mac os操作系统如何降级
- python 爬取《延禧攻略》所有的演员参演的电视剧
- iOS 屏幕尺寸、分辨率、适配
- 昆石VOS3000_2.1.3.2完整安装包及安装脚本
- 【开发一个简单的音乐播放器+服务端】【一】
- 密码算法详解——AES