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
相关文章
- 10-18ubuntu系统安装mysql登陆提示 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
- 10-18ubuntu下 mysql安装以后无法登陆的的解决方法((ERROR 1698 (28000): Access denied for user 'root'@'localhost'))
- 10-18密码正确 mysql无法登陆 red7.3 上安装mysql5.6后登录报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passswd :yes)
- 10-18mysql出现ERROR1698(28000):Access denied for user root@localhost错误解决方法【转】
- 10-18MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的解决办法和原因
- 10-18安装mysql因为/tmp权限不足而导致ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)的解决方案
- 10-18MySQL5.5出面ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法
- 10-18mac os x 安装mysql遇到 Access denied for user 'root'@'localhost' (using password: YES)的解决方法
- 10-18mac系统中搭建apache+mysql+php的开发环境,安装mysql后,登录报错:mac ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- 10-18mysql8.x 出现不能登录的情况(ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password:YS)