我有一个全新的MySQL安装在Ubuntu20.04上。
在安装过程中,我为root选择了一个密码。安装之后,我执行了以下操作:
sudo mysql -u root
它没问我密码就登录了。然后:
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
我以为这样做会在下一次登录时询问我的密码。但是,现在当我尝试登录时,它给了我如下信息:
您好,我正在尝试直接在Dockerfile文件中使用mysql_config_editor工具:
FROM mysql
RUN mysql_config_editor set --login-path=local --user=root --password
但是这个命令要求用户输入密码。知道不能直接在命令行中设置密码的情况下,有没有办法直接从Dockerfile设置密码。
root@d80484a3177f:~# mysql_config_editor set --login-path=local --user=root --password
Enter
我已经在MySQL 6.x服务器上运行了CentOS服务器5.1.73。我已经为root用户设置了密码。当我指定以下命令时,它会将我记录到mysql。
[root@sandbox ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 60384
我正在检查主机名
mysql> SELECT @@hostname;
+-------------------------+
| @@hostname
我执行了以下步骤在Ubuntu中使用MySQL:
sudo aptitude install php5-mysql mysql-server
sudo service mysql stop
sudo mysqld_safe --skip-grant-tables &
sudo mysql -u root mysql
更改根密码:
mysql> UPDATE mysql.user SET Password=PASSWORD('SecurePassword') WHERE
User='root';
mysql> FLUSH PRIVILEGES;
我在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 -
在检查用户数据时,我的MySQL版本是5.7.19
SELECT User, Host, HEX(authentication_string) FROM mysql.user;
我发现"root“没有密码,但我知道它有密码。
现在我尝试给它分配密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'this is my password xxxxxxx';
结果发现这个命令不起作用。但是这个命令起作用了
UPDATE mysql.user SET authentication_string = PA
当我是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 -uroot test # all fine
我想用sqlalchemy访问它。我试着用这些网址:
mysql+mysqldb://root@localhost/test
mysql+mysqldb://root:@localhost/test
但这两种方法都因错误而失败:
sqlalchemy.exc.OperationalError: (OperationalError)
(1045, "Access denied for user
'root'@'localhost&
我目前正在尝试安装mysql,并且我正在尝试恢复密码,因为我不知道我的超级用户密码,而我得到了这些说明
sudo /etc/init.d/mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
mysql>UPDATE user SET Password=PASSWORD('PASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
sudo killall mysqld
sudo /etc/init.d/mysql st
当我是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
我已经从apache.Then在我的linux上安装了MYSQL,我从以下命令启动mysql:sudo /opt/lampp/bin/mysql -u root.I在MYSQL中使用以下命令更改了密码:
use mysql
UPDATE user
SET Password=PASSWORD('something')
WHERE user='root';
但是当我退出mysql,然后使用上面的命令输入它时,当我输入以下命令时,它没有要求我输入password.And:sudo /opt/lampp/bin/mysql -u root --password=some