mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))
mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))
解决步骤:
[====>>https://www.cnblogs.com/leolztang/p/5094930.html
.sudo mysql -u root -p
.select user, plugin from mysql.user;
.update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root';
.flush privileges;
.exit6.重启进入
1. 删除mysql
a. sudo apt-get autoremove --purge mysql-server-5.0
b. sudo apt-get remove mysql-server
c. sudo apt-get autoremove mysql-server
d. sudo apt-get remove mysql-common (非常重要)上面的其实有一些是多余的,建议还是按照顺序执行一遍
2. 清理残留数据
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
3. 安装 mysql
a. sudo apt-get install mysql-server
b. sudo apt-get install mysql-client
c. sudo apt-get install php5-mysql(安装php5-mysql是将php和mysql连接起来 )一旦安装完成,MySQL服务器应该自动启动。您可以在终端提示符后运行以下命令来检查 MySQL 服务器是否正在运行:
4. 检查Mysql是否正在运行
sudo netstat -tap | grep mysql
当您运行该命令时,您可以看到类似下面的行:
root@ubuntu:~# sudo netstat -tap | grep mysql
tcp localhost.localdo:mysql *:* LISTEN
/mysqld如果服务器不能正常运行,您可以通过下列命令启动它:
sudo /etc/init.d/mysql restart
打开mysql:
sudo mysql
本文主要摘自:https://blog.csdn.net/wsywb111/article/details/78901889
mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))的更多相关文章
- ERROR 1698 (28000): Access denied for user 'root'@'localhost' 解决方法
之前MySQL服务端本机上使用密码登陆root账号是没有问题的,但是今天不知道是因为动了哪里,登陆失败并有这个错误代码: ~$ mysql -u root -p Enter password: ERR ...
- Ubuntu下使用mysqli-connect连接mysql时报错:ERROR 1698 (28000): Access denied for user 'root'@'localhost'
LNMP安装好后,写了个index.php文件,里面的内容很简单,就是想测试php与mysql的通信是否正常,代码如下: <?php $host = 'localhost'; $user = ' ...
- Ubuntu16.04 ERROR 1698 (28000): Access denied for user 'root'@'localhost' 解决流程
mysql版本 5.7.22 安装完成后出现问题 ERROR 1698 (28000): Access denied for user 'root'@'localhost' 可能是因为初始密码为空:按 ...
- MySQL使用普通用户访问返回ERROR 1698 (28000): Access denied for user 'root'@'localhost'
这个问题最开始查资料都说要改密码,密码不对.其实不是这个样子都. 解决方法 修改/etc/mysql/my.cnf,添加以下内容 [mysqld] skip-grant-tables 重启mysql服 ...
- MySQL5.7使用错误解决:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)【取消或重设root密码】
解决方法: 最简单方法: ⑴打开mysql中的my.ini(如果没有就将my-default.ini复制一份,并修改为my.ini): ⑵在[mysqld]下面空白行直接添加skip-grant-ta ...
- ubuntu下 mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))
1. 删除mysql sudo apt-get autoremove --purge mysql-server-5.0 sudo apt-get remove mysql-server sudo ap ...
- MySQL ERROR 1698 (28000): Access denied for user 'root'@'localhost'
今天在安装MySQL的过程中竟然没有让我输入密码,登录的时候也不需要密码就能进入,这让我很困惑. 进了数据库就设置密码,用了各种方式都不行. 虽然我这数据库没啥东西但也不能没有密码就裸奔啊,有点丢人是 ...
- 解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)【亲测有效】
文件转自:https://blog.csdn.net/hua1011161696/article/details/80666025 问题:(MySQL 5.6社区版windows版) 忘记密码或其他一 ...
- mysql 安装完毕后登陆不了mysql的 shell 即mysql>遇到:ERROR 1045 (28000): Access denied for user 'root'@'localhost‘
[root@hzswtb2-mpc ~]# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using pas ...
随机推荐
- 从零开始,学习web前端之HTML5开发
什么是HTML5 HTML5是HTML最新的修订版本,2014年10月由万维网联盟(W3C)完成标准制定.是下一代 HTML 标准. 为什么要学习HTML5 HTML5定义了一系列新元素,如新语义标签 ...
- IllegalStateException: Unable to find a @SpringBootConfiguration
此处需要改掉包名和类名
- 【面试题】整理一下2018年java技术要领
整理一下2018年java技术要领 基础篇 基本功 面向对象的特征 final, finally, finalize 的区别 int 和 Integer 有什么区别 重载和重写的区别 抽象类和接口有什 ...
- BotBuilder Nodejs示例查看
关于Bot Framework知识,可以参考<Nodejs Bot学习> 本文是根据bot framework官方示例<https://github.com/Microsoft/Bo ...
- 【转载】LinearLayout 源码分析
原文地址:https://github.com/razerdp/AndroidSourceAnalysis/blob/master/LinearLayout/android_widget_Linear ...
- 345. Reverse Vowels of a String【Easy】【双指针-反转字符串中的元音字符】
Write a function that takes a string as input and reverse only the vowels of a string. Example 1: In ...
- NBUT 1220 SPY
$map$,简单模拟. #include<cstdio> #include<cstring> #include<cmath> #include<algorit ...
- EL使用技巧
☞控制页面元素显示与否 实现效果: 实现方案: ...... <div style="display:${empty param.hideTitle ? 'auto' : 'none' ...
- 【stl小记】list
list相当于双向链表,所以快插快删比较方便(链式数据结构的性质),但是随机读取较慢 用一道luogu的水题做一做list,code如下 #include <cstdio> #includ ...
- BaseLoadDataForNetFragment
/** * Fragment 加载网络请求 */ public abstract class BaseLoadDataForNetFragment extends Fragment { // 视图是否 ...