Centos系统mysql 忘记root用户的密码:
第一步:(停掉正在运行的mysql)
Stopping MySQL: [ OK ]
[root@mcy400 ~]# mysqld_safe --skip-grant-tables
[root@cy400 ~]# Starting mysqld daemon with databases from /var/lib/mysql
[root@cy400 ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.77 Source distribution
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> update user set password=password('root123') where user='root';
mysql> flush previleges;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'previleges' at line 1
mysql> quit
Bye
[root@cy400 ~]# service mysqld restart;
Starting MySQL: [ OK ]
[root@cy400 ~]# mysql -u root -p
Enter password: admin123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.77 Source distribution
Bye
[root@cy400 ~]#
加入如下自动启动命令 /etc/rc.d/init.d/mysqld start
Centos系统mysql 忘记root用户的密码:的更多相关文章
- Centos系统mysql 忘记root用户的密码
Centos系统mysql 忘记root用户的密码: 第一步:(停掉正在运行的mysql) [root@maomao ~]# /etc/init.d/mysqld stop Stopping MySQ ...
- MySQL忘记root用户密码修改方法
一般来说在MySQL修改用户密码有好几种方法: 1.修改自己的密码可用: set password=password('123456'); 2.修改其它用户的密码可用: set password fo ...
- mysql忘记root用户密码找回步骤
修改或找回root密码步骤1.修改MySQL的登录设置: # vi /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 保存并且退出vi. 2.重新启动mys ...
- CentOS中对MySql的root用户重置密码
由于一般的修改ini文件来完成无密码登录数据库容易造成较大风险,所以使用修改启动服务参数的方式来更新user表,达到无密码登陆的目的. 1.关闭系统下运行的mysql服务 (1)杀掉进程号达到关闭目的 ...
- MySQL 的“root”用户修改密码
MySQL 的“root”用户默认状态是没有密码的,所以在 PHP 中您可以使用 mysql_connect("localhost","root"," ...
- linux mysql为root用户初始化密码和改变root密码
初始化密码: 由于安装MySQL完后,MySQL会自动提供一个不带密码的root用户,为了安全起见给root设置密码: #mysqladmin -u root password 123 (123为密码 ...
- Linux忘记root用户的密码
问题: 由于长时间没有操作过自己安装的虚拟机,导致连root用户的密码都忘了,也真是没谁了. 我使用的是centos6.5,今天就记录一下,如何重置root用户的密码. 操作步骤: 步骤一: 当开机启 ...
- linux(centos)下mysql忘记root密码
1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL数据库. 重新设置MySQL的root密码的期间,MySQL数据库完全出于没有密码保护的 状态下,其他的用户也可以任意地登录和修 ...
- CentOS下MySQL忘记root密码解决方法【转载】
1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL数据库. 因为在重新设置MySQL的root密码的期间,MySQL数据库完全出于没有密码保护的 状态下,其他的用户也可以任意地登录 ...
随机推荐
- leetcode Combination Sum II python
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in ...
- $.browser.msie jq解析不出来的原因及解决方法
检查是否为 IE6:// Oldif ($.browser.msie && 7 > $.browser.version) {}// Newif ('undefined' == t ...
- src 和 href 的区别
因为理解不深,到写外部加载Javascript文件或者css文件的时候总是需要去找个例子,这样可不好.现在总结下 href 属性规定被链接文档的位置(URL). href是hyperrefresh的缩 ...
- zendstudio -chinese
http://archive.eclipse.org/technology/babel/index.php http://www.eclipse.org/babel/downloads.php 注册码 ...
- scrapy中运行爬虫时出现twisted critical unhandled error错误
1. 试试这条命令: twisted critical unhandled error on scrapy tutorial python python27\scripts\pywin32_posti ...
- mongodb or操作与连接池
mongodb # 类似于sql中的in或者or操作 mulites field query: db.cool.find({$or:[{field1:'val'},{'field2':'val'}-] ...
- 求一个int型整数的两种递减数之和(华为2015笔试题及答案)
给出一个整数(负数使用其绝对值),输出这个整数中的两种递减数(1.最大递减数:2.递减数中各位数之和最大的数)之和. 递减数:一个数字的递减数是指相邻的数位从大到小排列的数字,不包含相邻的数位大小相同 ...
- QT连接mysql中文显示问题
亲测OK! #vim /etc/mysql/my.cnf [mysqld]下面加入: default-character-set=utf8 重启mysql /etc/init.d/mysql rest ...
- Orchard 源码探索(Module,Theme,Core扩展加载概述)
参考: http://www.orchardch.com/Blog/20120830071458 1. host.Initialize(); private static IOrchardHost H ...
- 【Chromium中文文档】多进程资源加载
多进程资源加载(需要更新) 转载请注明出处:https://ahangchen.gitbooks.io/chromium_doc_zh/content/zh//General_Architecture ...