You can reinit the password :

1.stop mysql

/etc/init.d/mysql stop

2.start mysql safe :

mysqld_safe --skip-grant-tables &

3.connect to mysql

mysql -u root

4.change the password

mysql> use mysql;
mysql> update user set password=PASSWORD(”YOUR_PASSWORD”) where user=’root’;
mysql> flush privileges;
mysql> quit

5.stop mysql

/etc/init.d/mysql stop

6.start mysql

/etc/init.d/mysql start

Then you can connect to mysql with login root and the new password.

answered Aug 23 '16 at 12:11
Seb3W

1464
 
    
Trying to use mysqld_safe resulted in SOCKET file errors. I was able to fix these by manually making the directory and then giving it to the mysql user. See this answer. (Mint 18, mysql 5.7) – Deleet Sep 20 '17 at 10:33

mysql: reinit the password的更多相关文章

  1. MySQL 改动用户password及重置rootpassword

    为数据库用户改动password是DBA比較常见的工作之中的一个.对于MySQL用户账户的password改动,有几种不同的方式.推荐的方式使用加密函数来改动password. 本文主要描写叙述了通过 ...

  2. windows下新安装的mysql修改root password问题

    常用步骤: 1. 在my.ini中的mysqld下添加一行 skip-grant-tables 2.重启mysql后直接进入后,用SQL直接修改password列: C:\> net stop ...

  3. mysql forget root password

    http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password MySQL - ...

  4. Mysql找回管理员password

    我们使用MYSQL的时候有可能由于种种原因忘记ROOTpassword,假设是那样数据库可能就废掉了.可是今天给大家分享下找回ROOTpassword的方法或者说是在不知道rootpassword的情 ...

  5. MYSQL更改root password时遇到Access Denied的解决办法

    今天在公司虚拟机上装MYSQL之后需要修改root password,然而遇到这样的错误: Access denied for user 'root'@'localhost' (using passw ...

  6. mysql改动用户password

    登录root用户 用root用户登录控制台. use mysql use mysql,mysql是mysql数据库自己主动创建的一个数据库. 改动user表的数据 update user set pa ...

  7. MySQL:Your password has expired. To log in you must change it using a client that supports expired passwords

    MySQL:V5.6.37 安装后发现没远程权限,为了方便,就直接把hostname@root修改为%@root,密码修改为和localhost@root一样 然后尴尬的事情发生了,本地登陆正常,远程 ...

  8. ERROR 1045 (28000): Access denied for user 'mysql'@'localhost' (using password: YES

    一.有时可以直接输入命令: mysql进入数据库 启动数据库:# mysqld_safe & 二.查看用户命令: mysql> use mysql; Reading table info ...

  9. How to set a MySQL root user password in MAC OSX

    https://www.youtube.com/watch?v=sFT9tGL54sI

随机推荐

  1. iOS Programming Subclassing UITableViewCell

    iOS Programming Subclassing UITableViewCell  1.Creating BNRItemCell UITableViewCell is a UIView subc ...

  2. VB6程序中NULL注意事项

    VB6中从数据库中取出栏位值进行操作,若栏位值为Null,则必须小心处理,否则极易导致程序出错退出. 通常我们从recordset中取出栏位值采用Fields方法,加上栏位名称,如 rsMoney.F ...

  3. [小记]Android缓存问题

    今天晚上,产品经理打电话说我们的Android App除了问题,问题很简单就是一个缓存问题,由于这个程序是前同事写的,我也只能呵呵一笑,有些事你就得扛.还是回到正题吧,这个缓存问题,实在有点奇葩,所以 ...

  4. php从mysql数据库中取数据

    php从数据库中取数据  面向过程 <?php $server_name="localhost:3306"; //数据库服务器名称 $username="root& ...

  5. 大写URL转小写

    添加LowercaseRoutesMVC.dll引用.通过“管理—NuGet程序包”搜索LowercaseRoutesMVC,然后点击安装.安装成功后会自动引用LowercaseRoutesMVC.d ...

  6. 迅为iMX6开发板支持单核,双核,四核处理器,为客户产品选择提供灵活性

    本文转自迅为:http://topeetboard.com 店铺:https://arm-board.taobao.com 处理器:Freescale Cortex-A9 四核 i.MX6Q 主频 1 ...

  7. Vue的模板语法

    基本语法 <body> <script src="vue.js"></script> <div id="app"> ...

  8. js 异步提交文件

    <form method="POST" action="${ctx}/statement/manage/upload" name="form&q ...

  9. UIWebView中javascript与Objective-C交互、获取摄像头

    UIWebView是iOS开发中常用的一个视图控件,多数情况下,它被用来显示HTML格式的内容. 支持的文档格式 除了HTML以外,UIWebView还支持iWork, Office等文档格式: Ex ...

  10. js+flash(as3)实现复制文字内容到剪切板实例

    /* SWFObject v2.2 swfobject.js */ var swfobject=function(){var D="undefined",r="objec ...