这可能是一个愚蠢的问题,但我是否需要更改mysql.sys密码?
做完后:
SELECT User,Host,Authentication_String FROM mysql.user;
要显示mysql用户、主机和密码,我看到mysql.sys用户密码设置如下:
mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
Mysql version is 5.7.13在为其他用户找到更改密码的代码时遇到问题。(测试用户)。
显然,我可以连接到MySQL (至少从我的本地主机),而不必提供任何用户名或密码。我甚至可以把任何东西作为用户名,只要密码是空的。我可以访问information_schema和test数据库。我可以做桌子。如果运行SELECT USER(),它将返回适当的值随机字符串@localhost,其中随机字符串是我连接时用于用户名的任意字符串。
mysql.user表包含根@localhost、root@127.0.0.1、@localhost和pma@localhost。我手动将加密的密码设置为所有记录(UPDATE user SET password=...),只有root拥有任何特权,其他两个
当我是root用户时,即使设置了密码,"mysql“也不需要密码就可以连接:
# mysqladmin -u root password 'whatever'
# mysql -u root -p
Enter password: (typing the 'whatever' above)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.1.22-standard
Type 'h
我无法登录mysql,已经在mysql_secure_installation上做了多次尝试。 尝试直接从mysql.user表中更改密码,如下所示:https://linuxize.com/post/how-to-manage-mysql-databases-and-users-from-the-command-line/ 已经尝试删除密码插件:How do I turn off the mysql password validation?仍然不让我登录... 删除了密码插件,然后出现mysql_secure_installation错误1698 (28000):拒绝访问用户'ro
我不能用超级用户登录,我想超级用户的密码可能是changed.But,我也不能更改超级用户的密码。
Mysql版本为v8.0.16。
我已经使用--init-file在mysqld引导时指定了alter sql。
alter user 'root'@'localhost' identified by 'mynewpassword'
但它不起作用。
我使用了--skip-grant-tables --user=mysql,这样我就可以添加一个新用户,我的新用户就可以工作了。我尝试更改root,但它再次失败。
mysql> alter user
我正尝试在运行以下命令的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