mysql在linux上出现Access denied for user 'root'@'localhost' (using password: NO)解决方案
来源:互联网 发布:sqlserver添加数据 编辑:程序博客网 时间:2024/06/05 04:49
在linux上安装mysql遇到的
mysql版本(mysql-5.7.13-linux-glibc2.5-i686.tar.gz)
安装时参考的文章:http://blog.163.com/ji_1006/blog/static/106123412015104103948782/
安装完成后启动:sudo /etc/init.d/mysqld start
打开mysql: mysql -uroot -p
则提示:
http://img.blog.csdn.net/20160727221323161?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center
解决了好久,大家都说
1../mysqld_safe --user=root --skip-grant-tables --skip-networking &
2.update user set password=password('12345') where user='root' ;可是新版的mysql里没有password这个字段了
最终解决问题如下:
1.查看当前密码:sudo cat /root/.mysql_secret
2.登陆:mysql -uroot -p 提示密码时输入上条命令cat出来的密码,成功登陆mysql
3.通过mysql命令修改密码:alter user 'root'@'localhost' identified by ’登陆进来的密码’;
4.update mysql.user set authentication_string=password('您的密码') where user='root' and Host='localhost';
5.写入:flush privileges;
6.退出quit
编码问题
创建数据库:
mysql> create database dbname if not exists dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci设置utf8编码
;
为确保 create database dbname 命令创建的数据库编码集为utf8, 我们可对mysql的配置文件进行修改windows下的mysql配置文件为my.ini, my.ini存在于mysql的安装目录下linux下的mysql配置文件为my.cnf, mysql.cnf存在于mysql的安装目录下或/etc/下在my.cnf或my.ini下找到[mysqld], 在其下方添加一行:
character_set_server=utf8
然后保存退出, 并重启mysql服务即可。
查看字符编码:
mysql> show variables like '%character%';
或
mysql> show variables like 'character_set_%';
- mysql在linux上出现Access denied for user 'root'@'localhost' (using password: NO)解决方案
- mysql Access denied for user 'root'@'localhost' (using password:NO)解决方案
- mysql 出现 Access denied for user 'root'@'localhost' (using password: NO)
- Centos 安装mysql 出现'Access denied for user 'root'@'localhost' (using password: NO)'
- JSP连接MySQL时出现--错误:Access denied for user 'root'@'localhost' (using password: YES)'解决方案
- mysql登录 出现Access denied for user 'root'@'localhost' (using password:YES) 解决方案
- mysql登录出现Access denied for user 'root'@'localhost' (using password:YES) 解决方案l
- [linux][mysql]ERROR 1045 (28000) : Access denied for user 'root'@'localhost' (using password:No)错误
- Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- linux 安装 mysql Access denied for user root@localhost (using password: NO)
- Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- Linux下mysql出错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- Linux下连接Mysql出现:Access denied for user 'root'@'localhost' (using password:YES)的解决方法
- linux下使用mysql数据库出现 “Access denied for user 'root'@'localhost' (using password: YES)”
- linux安装MySQL出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- 总结linux下使用mysql数据库出现 “Access denied for user 'root'@'localhost' (using password: YES)”
- linux下使用mysql数据库出现 “Access denied for user 'root'@'localhost' (using password: YES)”
- #1045 - Access denied for user 'root'@'localhost' (using password: NO)
- UVa 1630 太难了惭愧啊。
- 实习笔记(三)
- 前端使用FormData实现上传文件
- 图片转化成base64字符串
- UVALive 6442 Coins on a Ring (思维题)
- mysql在linux上出现Access denied for user 'root'@'localhost' (using password: NO)解决方案
- hdu 1068 Girls and Boys(最大独立集模板)
- 数据结构之线段树
- java wait()和sleep()区别
- 存储引擎和索引
- Zookeeper.NET Client(二)【官方驱动 开发入门】
- Apache Mesos 底层网络通信库 libprocess 分析
- Linux 系统 /usr 介绍
- Hadoop-HDFS(一)读流程