我正在尝试重置root用户的密码,并且我已经成功地执行了以下命令
service mysql stop
mysqld_safe --skip-grant-tables
mysql -u root
现在,当我在user表中查找user时,我会得到一个empty set
mysql> select * from user where User regexp 'root';
Empty set (0.00 sec)
怎么可能没有root帐户,我仍然可以以mysql -u root的身份登录
使用什么命令来更新root密码?
我使用的是MySQL版本5.6
(对不起,我的英语不好)
这是我的控制台日志:
anton@anton-X451CA:~$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
anton@anton-X451CA:~$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
我已经安装了mysql 5.7.18。安装后,root用户的密码为null。我已经尝试过mysql_secure_instattation和下面的查询来重置密码。
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyPassword';
和
UPDATE mysql.user
SET authentication_string = PASSWORD('MyPassword'), password_expired = 'N'
WHERE User = '
我在Linux上安装了phpMyAdmin,步骤如下:
安装mysql-服务器第一
sudo apt-get install mysql-server
sudo nano /etc/mysql/my.cnf
已添加
bind-address = 0.0.0.0
sudo service mysql restart
mysql -p -u root
mysql> CREATE DATABASE ha_test;
mysql> GRANT ALL PRIVILEGES ON ha_test.* TO 'maxg'@'%' IDENTIFIED BY &
我已经试了很多想摆脱这一切。但我该怎么解决呢?
sudo mysql_secure_installation
输出:
Securing the MySQL server deployment.
Enter password for user root:
Error: Access denied for user 'root'@'localhost' (using password: YES)
sudo mysql -u root -p
同样的结果。不能重置密码。
当试图进入mysql时,给出以下错误:
sudo mysql
ERROR 1045 (28000
实际上它是mariadb,但是要启动它的客户端,我需要在命令行中输入"mysql“。
不管怎么说,进入之后
mysql --user=root
注意,此时"root“没有密码,所以我成功登录,然后:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('my_pass');
它工作了,从现在开始,我必须使用"my_pass“登录。
但后来我做到了:
sudo service mysql restart
从现在开始,root的密码再次被重置为“根本没有密码”。
再说一次,要登录,我
当我尝试从MySQL工作台输入根用户并手动输入它时,我会得到以下错误:
您的用户根连接尝试失败到mysql服务器访问拒绝用户' root '@'localhost‘(使用密码:是)
当我想通过cmd连接到-u root时,我正在使用mysql MySQL代码,其中有一个错误:
mysql: Unknown operating system character set 'cp857'.
mysql: switch to the default character set of 'utf8mb4'.
ERROR 1045 (28000):
我正在做一个项目,我一直在尝试使用MySQL而不是SQLite。因此,我下载了MySQL并尝试用mysql_secure_installation设置根密码,但是当我提交这两个密码时,会出现以下错误:
... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please co
我在Ubuntu上使用MySQL遇到了一些困难。刚刚安装了Apache、MySQL、PHP和phpMyAdmin。phpMyAdmin给出:
#1045 Cannot log in to the MySQL server
每一次登录尝试。我试过用户名'root‘和空密码,用户名'root’和密码'root',用户名'mysql‘和密码'mysql',用户名'mysql’和密码'root‘。
当我试图在终端中运行Access denied for user root@x.x.x.x时,也会得到mysql错误:
mysql -
在一个shell (.sh文件)中,我试图为用户"root“更新MYSQL密码。
现在我有这个,这是安全的和正确的方法吗?我不想要提示。
我还想知道"mysqladmin“和"mysql”的帐户是否相同。
#Variables for User and Pass
USER="root"
PASS="test"
mysqladmin -u root password $PASS
#Set Root User Password for all Local domains
sudo mysql --user=$USER --password=
这是我的密码。
var mysql = require('mysql');
var pool = mysql.createPool({
Host : 'localhost',
user : 'root',
password : 'root',
database : 'guess'
});
mysql.createpool函数是同步的还是异步的?
我忘了我的根密码..。然后我停止mysql服务器并使用skip-grant-tables;重新启动它,我通过以下方式更改了根密码
mysql>update mysql.user set password='12345' where user='root';
mysql> select user,password from mysql.user;
我得到的是::
+------+-------------------------------------------+
| user | password
我正尝试在运行以下命令的aws linux实例上首次安装mysql
sudo yum install mysql-server
sudo mysql_secure_installation
只要我运行第二个命令,我就会得到
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the pass
我在mysql网站上安装了“MacOSX10.9 (x86,64位),DMG存档”,我不能以超级用户身份访问("mysql -uroot -p"),因为我不知道密码。有没有默认密码之类的?因此,我以匿名身份访问mysql,以便在命令行上使用“ud./mysqld_safe --skip-grant-tables”。我试过了
update user set password=PASSWORD("mynewpassword") where User='root';
用于重置root密码的查询。然而,有趣的是密码字段被弃用了。但是,还有另一个命令可以使
这不是无法通过socket‘/var/lib/mysql.sock连接到本地MySQL服务器的副本
那里的问题是磁盘空间不足。这里没有这样的问题。
我在Redhat Centos 5.5系统上安装了mysql,该系统在重新启动之前运行良好。
该网络应用程序发出:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
当你试图连接它的时候。
我跑不了
root@server [~]# /usr/bin/mysql_secure_installation
.
我忘记了我的MySQL密码。我在谷歌上随心所欲。但我仍然无法更改MySQL密码。我正确地写了命令。这是怎么回事?我真的不知道。ERROR 1064 (42000)这个错误代码让我很生气。
下面是我使用的命令:
mysql> use mysql;
Database changed
mysql> update user set password=password('xxxx') where user='root';
ERROR 1064 (42000): You have an error in your SQL syntax; check the ma