[root@centos yum.repos.d]# /etc/init.d/mysqld stop
停止 mysqld: [确定]
[root@centos yum.repos.d]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 8307
[root@centos yum.repos.d]# 130531 01:08:38 mysqld_safe Logging to '/var/log/mysqld.log'.
130531 01:08:38 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
^C
[root@centos yum.repos.d]# ^C
[root@centos yum.repos.d]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.69 Source distribution
Copyright (c) 2000, 2013, 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> select host, user from user;
Empty set (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
mysql> select host, user from user;
Empty set (0.00 sec)
mysql> use mysql;
Database changed
mysql> select host, user from user;
Empty set (0.00 sec)
mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
mysql> desc user;
ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_20d3_0.MYI' (Errcode: 13)
mysql> desc USER;
ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_20d3_0.MYI' (Errcode: 13)
mysql> insert into user(user,password) values('root',PASSWORD('123456'));
Query OK, 1 row affected, 3 warnings (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@centos yum.repos.d]# /etc/init.d/mysqld restart
130531 02:00:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
停止 mysqld: [确定]
正在启动 mysqld: [确定]
[1]+ Done mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[root@centos yum.repos.d]# ps -ef | grep mysql
root 8452 1 0 02:00 pts/4 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql 8554 8452 0 02:00 pts/4 00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root 8563 7506 0 02:00 pts/4 00:00:00 grep mysql
[root@centos yum.repos.d]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.69 Source distribution
Copyright (c) 2000, 2013, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
1 row in set (0.00 sec)
相关推荐
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 解决: 1.打开在创建mysql容器时挂载的conf目录下的mysqld.cnf(如下文件) 我创建docker的姿势 2.进入mysqlId.cnf文件中在...
前言 最近学习linux,然后将win换成了ubuntu。之前安装的mysql也不能用了,现在将在ubuntu18.0.4上安装mysql并将...登录时出现ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’。这应该时我们之前
MySQL密码忘了,可以进行重置设置。安全模式的进入,操作。
首先是不知道怎么忽然mysql用命令行,workbench都登录不了,都提示’Access denied for user ‘root’@’localhost’。 数据库卸载重装了几次都不行。好像感觉数据清理不干净。解决的过程遇到的坑,这里记录分享下。...
Unhandled rejection SequelizeAccessDeniedError: Access denied for user 'lupeng'@'localhost' (using password: YES) 这是Node在使用Sequlize连接Mysql数据时报的错,关键看冒号后面的错误:访问拒绝,关键是...
ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘python’ 2. 解决方法: 执行以下命令进入控制台: mysql –user=root -p 输入root用户的密码即可进入mysql控制台: 创建数据库: ...
新装MySQL后,首次执行 mysql -uroot -p 后会发现root密码不为空,要重置root密码请参考以下步骤。...这时候在cmd里面输入mysql -u root -p就可以不用密码登录了,出现password:的时候直接回车可以进入,不会出现ERROR
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) 第一步:编辑mysql安装目录中的配置文件my.ini,在[mysqld]这个条目下加入 skip-grant-tables 如下图: 保存退出后 第二...
昨天连数据库没有问题,但是今天连接数据库就报这个错误了,网上也搜了不少的方法,有一个方法解决了我的问题。我的环境是Linux 步骤:首先需要跳过密码认证,在Linux环境中找到/etc/my.cnf文件,在文件中找到...
MySQL ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO) 的解决办法和原因 这两天下载了MySQL5.7.11进行安装,发现到了初次使用输入密码的时候,不管怎样都进不去,即使...
主要介绍了Linux下数据库报ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)实用解决方案,希望能对大家有帮助。
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) mysql版本为:Ver 14.14 Distrib 5.7.10, for Linux(X86_64) using EditLine wrapper 然而实际上并没有进行过root密码设置...
主要介绍了ubuntu18.0.4安装mysql并解决ERROR 1698 (28000): Access denied for user 'root'@'localhost',现在将ubuntu18.0.4上安装mysql并将碰到的问题记录下来,感兴趣的朋友一起看看吧
解决办法 1.打开/etc/mysql/debian.cnf文件,修改其只读属性 chmod 777 debian.cnf 可以看到里面存储了系统管理员的密码。 ...mysql -udebian-sys-maint -p ...3.进入控制台后....mysql -u root -p Go· again
主要给大家介绍了如何解决mysql在创建数据库后出现:Access denied for user 'root'@'%' to database 'xxx'的错误提示,文中介绍的非常详细,需要的朋友可以参考借鉴,下面来一起看看吧。
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 提示的是用户访问被拒绝,原因是密码不正确,但是我们明明配置的是正确的密码,原因就在yml中: spring: datasource: ...
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES) 解决方法: 1、在启动mysql的参数中加入跳过密码问题方式,如下: vim /etc/my.cnf 并在[mysql]下面加上skip-grant-...
主要介绍了MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 的原因分解决办法的相关资料,需要的朋友可以参考下
主要介绍了mysql登录错误:'Access denied for user 'root'@'localhost',本文给出了操作过程及注意事项,需要的朋友可以参考下
本文分析了mysql登录报错提示:ERROR 1045 (28000)的解决方法。...ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 二、原因:数据库中存在空用户所致 三、解决方