mysql登录失败
2016-01-02 12:29
531 查看
启动服务:
1.启动服务时遇到安全问题:
[root@bogon init.d]# ./mysqld
2016-01-02T03:05:31.522149Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-01-02T03:05:31.674951Z 0 [Note] ./mysqld (mysqld 5.7.10) starting as process 2756 ...
2016-01-02T03:05:32.035580Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2016-01-02T03:05:32.038039Z 0 [ERROR] Aborting
2016-01-02T03:05:32.052689Z 0 [Note] Binlog end
2016-01-02T03:05:32.082019Z 0 [Note] ./mysqld: Shutdown complete
解决办法指定root用户启动。
[root@bogon init.d]# ./mysqld --user=root
2.执行 mysqladmin 失败
[root@bogon init.d]# mysqladmin -u root -p 123456
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
[root@bogon init.d]#
[root@bogon init.d]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
解决办法:
--skip-grant-tables。 顾名思义,就是在启动mysql时不启动grant-tables,授权表。有什么用呢?当然是忘记管理员密码后有用。
[root@bogon init.d]#./mysqld --user=root --skip-grant-tables
3.修改密码
mysql>use mysql;
mysql>update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost';
mysql>flush privileges;
mysql>exit
1.启动服务时遇到安全问题:
[root@bogon init.d]# ./mysqld
2016-01-02T03:05:31.522149Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-01-02T03:05:31.674951Z 0 [Note] ./mysqld (mysqld 5.7.10) starting as process 2756 ...
2016-01-02T03:05:32.035580Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2016-01-02T03:05:32.038039Z 0 [ERROR] Aborting
2016-01-02T03:05:32.052689Z 0 [Note] Binlog end
2016-01-02T03:05:32.082019Z 0 [Note] ./mysqld: Shutdown complete
解决办法指定root用户启动。
[root@bogon init.d]# ./mysqld --user=root
2.执行 mysqladmin 失败
[root@bogon init.d]# mysqladmin -u root -p 123456
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
[root@bogon init.d]#
[root@bogon init.d]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
解决办法:
--skip-grant-tables。 顾名思义,就是在启动mysql时不启动grant-tables,授权表。有什么用呢?当然是忘记管理员密码后有用。
[root@bogon init.d]#./mysqld --user=root --skip-grant-tables
3.修改密码
mysql>use mysql;
mysql>update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost';
mysql>flush privileges;
mysql>exit
相关文章推荐
- 用OneProxy部署MySQL数据库的读写分离
- mysql 简单练习
- MySQL Fabric实验(三)HA与Sharding
- Ubuntu 14.04 安装 64位的 MySQL 5.7.9
- 阿里云服务器Ubuntu安装mysql
- MySQL安装报2503错误
- 多种方法修改Mysql root密码
- navicat for mysql 10.1.7注册码
- 在mysql中创建索引,提升获取数据库数据效率
- MYSQL 内部 一个故事@MySQL DBA
- mysql主从复制详解
- mysql触发器
- mysql游标
- Mysql笔记——DQL
- Mysql笔记——DCL
- Mysql笔记——DML
- Mysql笔记——DDL
- Mysql笔记——触发器简单实例
- mysql技能点
- MySQL的存储引擎造成的事务无法回滚