bet36体育在线备用_bet36备用地址_bet36中国网站-中国人民大学官网

首页

AD联系:507867812

bet36体育在线备用_bet36备用地址_bet36中国网站

时间:2019-11-12 16:06:49 作者:豪门国际娱乐备用 浏览量:43890

bet36体育在线备用_bet36备用地址_bet36中国网站

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录,见下图

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录,见下图

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录,如下图

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

如下图

MySQL 'root'@'localhost'无法登录,如下图

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux,见图

bet36体育在线备用_bet36备用地址_bet36中国网站MySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录。

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

bet36体育在线备用_bet36备用地址_bet36中国网站

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录。

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

1.

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

MySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

2.MySQL 'root'@'localhost'无法登录。

MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

3.MySQL 'root'@'localhost'无法登录。

MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录

4.

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linuxMySQL 'root'@'localhost'无法登录MySQL 'root'@'localhost'无法登录

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux。bet36体育在线备用_bet36备用地址_bet36中国网站

展开全文
相关文章
365体育投注 平板_体育彩票365_365体育台湾备用

MySQL 'root'@'localhost'无法登录

ceo娱乐备用网址

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux....

ts彩娱乐备用打不开

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux....

mobile365体育投注备用_大陆365体育投注网址_365体育投注+365.

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux....

高登娱乐备用网址

MySQL 'root'@'localhost'无法登录....

相关资讯
明升88最新备用

今天早上同事说MySQL root账号登录不上了。我试了一下 #mysql -u root -p 提示”Access denied for user ‘root’@’localhost’ (using password: YES)”

因为年后有同事离职,我第一反应是谁修改了root密码?按照忘记root密码来重置一下密码: #/etc/init.d/mysql stop #mysqld_safe –skip-grant-tables & #mysql -uroot -p mysql>update mysql.user set password=password(‘mypassword’) where user=’root’; mysql>flush privileges; mysql>quit

用新密码还是无法登录,提示跟上面一样。换一个非root账号登录,查看一下user表: mysql> select user,host from user; +———–+———+ | user | host | +———–+———+ | root | 127.0.0.1 | | night | % | +———–+———+

怀疑默认的localhost没有映射到127.0.0.1?试试#mysql -u root -p xxxx -h 127.0.0.1,果然可以登录。 之前配置数据库的同学没有给’root’@’localhost’和’root’@’ip’授权。 grant all privileges on . to ‘root’@’localhost’ identified by ‘mypassword’ with grant option; grant all privileges on . to ‘root’@’118.192.91.xxx’ identified by ‘mypassword’ with grant option;

再查询一下用户表: 这里写图片描述 然后#mysql -u root -p xxxx,登录成功!

查了一下mysql -h localhost和mysql -h 127.0.0.1的区别,通过localhost连接到mysql是使用UNIX socket,而通过127.0.0.1连接到mysql是使用TCP/IP。看看状态: mysql -h localhost > status Connection id: 639 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: Localhost via UNIX socket

mysql -h 127.0.0.1 > status Connection id: 640 Current database: mysql Current user: root@localhost SSL: Not in use Current pager:stdout Using outfile: ” Using delimiter: ; Server version: 5.6.15-log Source distribution Protocol version:10 Connection: 127.0.0.1 via TCP/IP

--------------------------------------分割线 --------------------------------------

Ubuntu 14.04下安装MySQL http://www.linuxidc.com/Linux/2014-05/102366.htm

《MySQL权威指南(原书第2版)》清晰中文扫描版 PDF http://www.linuxidc.com/Linux/2014-03/98821.htm

Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm

Ubuntu 14.04下搭建MySQL主从服务器 http://www.linuxidc.com/Linux/2014-05/101599.htm

Ubuntu 12.04 LTS 构建高可用分布式 MySQL 集群 http://www.linuxidc.com/Linux/2013-11/93019.htm

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb http://www.linuxidc.com/Linux/2013-08/89270.htm

Windows下忘记MySQL root密码的解决方法 http://www.linuxidc.com/Linux/2015-03/114881.htm

--------------------------------------分割线 --------------------------------------

linux....

热门资讯