ubuntu下一个rootusername入口mysql,如何查看username和password,如何改变rootpassword
2015-06-29 12:11
681 查看
mysql -u root -p 按Enter键,提示时输入密码access denied......ues password YES/NO错误。
第一步:
然后,你需要输入/etc/mysql夹。然后sudo vim/vi debian.cnf里面查看username和password。然后使用这个文件里的username和password进入mysql,假如debian.cnf中的username为debian-sys-maint,则:
mysql -u debian-sys-maint -p按回车,这时须要你输入password。复制debian.cnf中的password(不要手动输入,由于easy产生错误)。
此时你能进入到mysql里面了。
第二步:
改动人rootpassword
依据上一步登录mysqlclient
mysql> use mysql;
Database changed
mysql> update user set password=password('new password') where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
第三步:
随着新改革root和password登录查看。
第一步:
然后,你需要输入/etc/mysql夹。然后sudo vim/vi debian.cnf里面查看username和password。然后使用这个文件里的username和password进入mysql,假如debian.cnf中的username为debian-sys-maint,则:
mysql -u debian-sys-maint -p按回车,这时须要你输入password。复制debian.cnf中的password(不要手动输入,由于easy产生错误)。
此时你能进入到mysql里面了。
第二步:
改动人rootpassword
依据上一步登录mysqlclient
mysql> use mysql;
Database changed
mysql> update user set password=password('new password') where user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
第三步:
随着新改革root和password登录查看。
相关文章推荐
- PL/SQL Developer连接本地Oracle 11g 64位数据库(转)
- shopnc b2b2c初次运行提示Class Error: mysqli.isn't exists!的解决方法
- [转载] 运维角度浅谈:MySQL数据库优化
- Office Tips 2 - 如何备份oracle sql developer的connection
- Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
- instantclient_11_2与PLSQL Developer的配置
- sqlplus登录Oracle时ORA-01017: invalid username/password; logon denied的错误
- [Postgresql] drop 和 delete 命令的区别
- 利用(Tcmalloc) google-perftools优化Nginx和MySQL性能
- 执行测试操作contentprovider时,说cn.bjoracle.mq.providers.sqlite/person是无效的contentprovider
- 闪回drop恢复表后sql执行计划异常
- Django+MySQL安装配置详解(Linux)[更新为1.8.2版]
- win7下PL/SQL Developer的安装
- 黄聪:Mysql数据库还原备份提示MySQL server has gone away 的解决方法(备份文件数据过大)
- MySQL主从架构配置案例
- SQL Developer显示多个工作表
- DayDayUP_Linux运维学习_mysql安装(源码编译安装)
- 探索MySQL高可用架构之MHA(9)
- zabbix使用自带模板监控mysql
- windows 8下配置PLSQLDeveloper