ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES
mysql Error for 39 user Using access
2023-09-27 14:23:51 时间
解决方法:
利用mysql安装时的默认用户名登录mysql后, 输入以下命令修改root密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
2. 授予用户权限
GRANT ALL PRIVILEGES ON *.* TO 'jiang'@'%' IDENTIFIED BY '1';
flush privileges;
下面的内容没有用到
一.有时可以直接输入命令: mysql进入数据库
启动数据库:# mysqld_safe &
二.查看用户命令:
mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select host,user from mysql.user;//show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec) mysql>
删除用户
mysql>Delete FROM user Where User='test' and Host='localhost'; mysql>flush privileges; mysql>drop database testDB; //删除用户的数据库 删除账户及权限:>drop user 用户名@'%'; >drop user 用户名@ localhost;
创建用户
mysql> create user 'root'@'%' identified by '1';# %代表所有端口 Query OK, 0 rows affected (0.07 sec) mysql> select host,user from mysql.user; +-----------+------------------+ | host | user | +-----------+------------------+ | % | root | | % | usrabc | | localhost | mysql.infoschema | | localhost | mysql.session | | localhost | mysql.sys | +-----------+------------------+ 5 rows in set (0.00 sec)
查看数据库列表:
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | +--------------------+ 1 row in set (0.00 sec) mysql>
相关文章
- 数据库-MySQL-基础(3)-DML操作
- 在mysql中使用group by和order by取每个分组中日期最大一行数据,亲测有效
- linux 服务器__MySQL远程连接 ERROR 2003 Can‘t connect to MySQL server (10060) 解决办法
- mysql学习笔记(三):unsigned理解以及特殊情况
- MySQL 启动日志报错:Starting MySQL. ERROR! The server quit without updating PID file
- ERROR 2013 (HY000): Lost connection to MySQL server at 'waiting for initial communication packet', system error: 2
- windows mysql 8.0 ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
- ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'mysql'
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/usr/local/mysql/tmp/mysql.sock'
- mysql join 的同时可以筛选数据
- [mysql]ERROR 1364 (HY000): Field 'ssl_cipher' doesn't have a default value
- 远程连接mysql数据库提示:ERROR 1130的解决办法
- Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/vm10-0-0-19
- Windows10系统下,彻底删除卸载MySQL
- Linux 下,mysql数据库报无法登陆错误:ERROR 1045 (28000): Access denied for use
- MySQL必知必会:简介undo log、truncate、以及undo log如何帮你回滚事务(二)
- mysql/lightdb uuid报错ERROR: invalid input syntax for type uuid: "-1"
- ubuntu下 mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))
- MySQL 8.0 修改root远程登录【ERROR 1410 (42000): You are not allowed to create a user with GRANT】