我是CentOS的新手。
我想在一台机器上设置Mysqlfabric和多台mysql服务器。
首先,我想设置Mysql实例。随后执行了以下步骤,但我无法启动单个mysql服务器实例。
步骤1.全新安装centos 7
setp 2.添加mysql-community-server.version.noarch.rpm所需的Yum存储库。
setp 3.安装yum mysql-community-server (安装mysql 5.7.10版本)
步骤4.使用systemctl状态mysqld检查mysqld状态。
步骤5. systemctl启动mysqld.services
步骤6.现在我要检查mysql shell。
步骤7.我已经检查了mysql客户端,它已经安装,同时mysql commuinty服务器已经安装。
步骤8.对于mysql root用户,没有提示输入密码,所以我尝试了使用默认密码。如mysql -u根-p mysql
It is asking Enter password .
tried with different password but i am getting the error like
ERROR 1045 (28000) : Access denied for user 'root'@'localhost' (using password: YES).
Another way also tried with mysql_secure_installation but i am getting the same error. i dont know how to resolve this.
Mysqladmin -u root password = 'newpassword' also tried. But i am getting the access denied error. 尚未设置根密码,但访问被拒绝。我不知道如何解决这个问题。请帮我解决。提前谢谢。
在第一个实例成功运行后,我只能继续处理多个实例,并且需要配置mysqlfabric。请帮帮我。
我引用了mysql安装链接http://sharadchhetri.com/2014/07/31/how-to-install-mysql-server-5-6-on-centos-7-rhel-7/。
发布于 2016-01-30 11:20:53
最后,我用mysqlserver5.7.10在centos7上解决了这个问题。
背后的原因是mysql server 5.7.10为mysql生成随机密码。
因此,下面的命令将解决我的问题。
步骤1.以root用户身份登录
步骤2. grep‘临时密码’/var/log/mysqld.log
步骤3.它将显示密码。
步骤4.复制密码并执行以下操作:
4.1Mysql -u根-p
4.2输入临时密码
4.3 mysqlserver 5.7.10有安全性,需要您更新密码,以便在mysql shell中进一步处理。
因此,请执行以下操作
ALTER USER 'root'@'localhost' identified by 'your new password';
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;4.4现在所有的过程都在mysql shell中完成。
感谢所有人。
发布于 2019-06-01 01:23:00
systemctl stop mysqld
使用刚才设置的选项进行systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
以不带口令的超级用户身份使用systemctl start mysqld
mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
对MySQL环境选项执行systemctl stop mysqld
systemctl unset-environment MYSQLD_OPTS
systemctl start mysqld
尝试使用新密码登录:
mysql -u root -p
https://stackoverflow.com/questions/35078234
复制相似问题