首页 > 编程知识 正文

如何查看oracle的用户名和密码,cmd查看数据库的用户名密码

时间:2023-05-06 04:59:53 阅读:19215 作者:4815

匿名用户

一级

2017-07-06答复

今天主要谈谈Linux的mysql忘记密码的处理方法。 下面提供5种Linux的mysql忘记密码恢复方法哦。

方法1 :

# /etc/init.d/mysql stop

# mysqld _ safe-- user=MySQL-- skip-grant-tables-- skip-networking

# mysql -u root mysql

mysqlupdateusersetpassword=password (新密码) where user=root;

MySQL flush权限;

mysql quit

# /etc/init.d/mysql restart

# mysql -uroot -p

enter password:

mysql

方法2 :

直接使用/etc/mysql/debian.cnf文件的“客户端”部分中指定的用户名和密码:

# MySQL-u设备- sys-maint-p

enter password:

mysqlupdateusersetpassword=password (新密码) where user=root;

MySQL flush权限;

mysql quit

# mysql -uroot -p

enter password:

mysql

方法3 :

我没有测试过这个方法。 root用户的默认密码已更改。 那个人有时间测试。 请告诉我结果。 谢谢你。

# mysql -uroot -p

enter password:

方法4 :

方法: 1、退出mysql服务/etc/init.d/mysqld stop 2,使用-skip-grant-tables选项启动mysql服务,然后单击/etc/inin.d/mysqld VI

方法如下。

1,退出mysql服务

/etc/init.d/mysqld stop

2,-使用-skip-grant-tables选项启动mysql服务后,可以更改/etc/inin.d/mysqld脚本的启动位置并添加此选项。

vi /etc/init.d/mysqld

将--skip-grant-tables添加到要执行启动的以下语句中

/usr/bin/mysqld _ safe-- skip-grant-tables-- datadir=' $ datadir '-- socket=' $ socket file '

- log-error=' $ errogfile '-- PID-file=' $ my pidfile '

加入--skip-grant-tables意味着在启动mysql服务时跳过权限表认证。 启动后,连接mysql的root不需要密码

3,重新启动mysql服务

/etc/init.d/mysqld start

更改根用户的密码

mysqlupdatemysql.userset password=password (123456 ) where user=root;

MySQL flush权限;

mysql quit

重新启动mysql后,可以使用新密码登录。

mysql

MySQL-u路由p

输入密码: 123456

6,退出mysql服务

/etc/init.d/mysqld stop

7、将步骤2中修改的/etc/init.d/mysqld保留原样,即修改为取消--skip-grant-tables语句

8,重新启动mysql服务

/etc/init.d/mysqld start

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。