linux(ubuntu)Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'解决方法
2014-08-07 19:01
495 查看
今天在自己的机子上部署vj的时候上不去mysql数据库,通过以下两行命令轻松解决:
问题:
ttop@ttop-Lenovo:~$ mysql -u root -prootpass
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解决:
root@ttop-Lenovo:/home/ttop# /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
mysql stop/waiting
root@ttop-Lenovo:/home/ttop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 5598
root@ttop-Lenovo:/home/ttop# 140807 18:54:42 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
140807 18:54:42 mysqld_safe Logging to '/var/log/mysql/error.log'.
140807 18:54:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
root@ttop-Lenovo:/home/ttop#
root@ttop-Lenovo:/home/ttop# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.38-0ubuntu0.12.04.1 (Ubuntu)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
问题:
ttop@ttop-Lenovo:~$ mysql -u root -prootpass
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
解决:
root@ttop-Lenovo:/home/ttop# /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
mysql stop/waiting
root@ttop-Lenovo:/home/ttop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 5598
root@ttop-Lenovo:/home/ttop# 140807 18:54:42 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
140807 18:54:42 mysqld_safe Logging to '/var/log/mysql/error.log'.
140807 18:54:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
root@ttop-Lenovo:/home/ttop#
root@ttop-Lenovo:/home/ttop# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.38-0ubuntu0.12.04.1 (Ubuntu)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
相关文章推荐
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- ubuntu14.10下解决"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"
- Linux 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题。
- Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题的解决
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)解决方法
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO))
- ubuntu mysql问题 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YSE)解决
- 在linux系统中安装mysql服务器详细步骤并解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passw
- 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- ERROR 1045 (28000): Access denied for user'root'@'localhost'(using password:YES)最近解决方法在!
- 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YSE)
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决MySQL 报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- #1045 - Access denied for user 'root'@'localhost' (using password: NO) 解决方法