您现在的位置是:首页 > 编程 > 

Linux下修改mysql的密码

2025-07-27 20:07:19
Linux下修改mysql的密码 [root@hadoop01 bin]# schematool -initSchema -dbType mysqlSLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/usr/local/hive-2.1.1/lib/log4j-slf4j-imp

Linux下修改mysql的密码

[root@hadoop01 bin]# schematool -initSchema -dbType mysql

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/local/hive-2.1.1/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/]

SLF4J: Found binding in [jar:file:/usr/local/hadoop-2.8.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/]

SLF4J: See .html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]

Metastore connection URL: jdbc:mysql://hadoop01:06/hive?createDatabaseIfotExist=true

Metastore Connection Driver : jdbc.Driver

Metastore connection User: root

org.apache.hadoop.HiveMetaException: Failed to get schema version.

Underlying cause: java.sql.SQLException : Access denied for user 'root'@'hadoop01' (using password: YES)

SQL Error code: 1045

Use --verbose for detailed stacktrace.

*** schemaTool failed ***

一、拥有原来的myql的root的密码;

方法一:

在mysql系统外,使用mysqladmin

# ​mysqladmin -u root -p password "test12"

Enter password: 【输入原来的密码】

方法二:

通过登录mysql系统,

# ​mysql -uroot -p

Enter password: 【输入原来的密码】

mysql>​use mysql;

mysql> ​update user set password=passworD("test") where user='root';

mysql> ​flush privileges;

mysql> ​exit;

二、忘记原来的myql的root的密码;

首先,你必须要有操作系统的root权限了。要是连系统的root权限都没有的话,先考虑root系统再走下面的步骤。

类似于安全模式登录系统,有人建议说是​pkill mysql​,但是我不建议哈。因为当你执行了这个命令后,会导致这样的状况:

/etc/init.d/mysqld status

mysqld dead but subsys locked

这样即使你是在安全模式下启动mysql都未必会有用的,所以一般是这样​/etc/init.d/mysqld stop​,如果你不幸先用了pkill,那么就start一下再stop咯。

# ​mysqld_safe --skip-grant-tables &

&,表示在后台运行,不再后台运行的话,就再打开一个终端咯。

# ​mysql

mysql> ​use mysql;

mysql> ​UPDATE user SET password=password("test12") WHERE user='root';

mysql> ​flush privileges;

mysql> ​exit;

##本来mysql是不分大小写的,但是这个是修改的mysql中的mysql数据库的具体的值,要注意到。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。 原始发表:2022-0-01,如有侵权请联系 cloudcommunity@tencent 删除系统linux安全mysql登录

#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格

本文地址:http://www.dnpztj.cn/biancheng/1244431.html

相关标签:无
上传时间: 2025-07-27 07:31:35
留言与评论(共有 7 条评论)
本站网友 涵江二手房
23分钟前 发表
因为当你执行了这个命令后
本站网友 神秘的财富卡
28分钟前 发表
1045Use --verbose for detailed stacktrace.*** schemaTool failed ***​一
本站网友 百思买中国
6分钟前 发表
Found binding in [jar
本站网友 世界癫痫病日
11分钟前 发表
表示在后台运行
本站网友 过个么
26分钟前 发表
如果你不幸先用了pkill
本站网友 旅游投诉
14分钟前 发表
要是连系统的root权限都没有的话