模具钢东莞网站建设,做动态效果的插件网站,衡水注册公司,南宁论坛建站模板解决Mysql忘记密码#xff1a;1、首先停止正在运行的MySQL进程#xff1a;[rootcml5 ~]# systemctl stop mysqld2、以安全模式启动MySQL#xff1a;[rootcml5 ~]# /usr/local/mysql/bin/mysqld_safe--skip-grant-tables ##或者在my.cnf文件下添加#xff0c;执行完后就…解决Mysql忘记密码1、首先停止正在运行的MySQL进程[rootcml5 ~]# systemctl stop mysqld2、以安全模式启动MySQL[rootcml5 ~]# /usr/local/mysql/bin/mysqld_safe--skip-grant-tables ##或者在my.cnf文件下添加执行完后就删除掉skip-grant-tables[rootcml5 ~]# cat /etc/my.cnf[mysqld]datadir/usr/local/mysql/mydatasocket/usr/local/mysql/mysql.socklog_bin/usr/local/mysql/mydata/mysql-binserver-id1skip-grant-tables然后重启mysql进入mysql(免密码)然后修改密码3、完成以后就可以免密进入MySQL了然后修改密码(3)运行 /usr/local/mysql/bin/mysql -u root -p 按Enter键进入[rootcml5 ~]# /usr/local/mysql/bin/mysql -u root -pmysql use mysql;mysql update user set passwordpassword(123) where userroot and hostlocalhost;##假如是mysql5.7之后的就password字段改成了authentication_stringmysql update user set authentication_stringpassword(redhat) where userrootand hostlocalhost;mysql5.7以上版本-- UPDATE user SET authentication_stringPASSWORD(root) WHERE Userroot;mysql flush privileges;mysql ALTER user rootlocalhost identified by redhat;Query OK, 0 rows affected (0.00 sec)mysqlmysql flush privileges;Query OK, 0 rows affected (0.00 sec)mysql show databases;--------------------| Database |--------------------| information_schema || mysql || performance_schema || sys |--------------------4 rows in set (0.00 sec)ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.今天在MySql5.6操作时报错You must SET PASSWORD before executing this statement解决方法需要的朋友可以参考下ERROR 1820 (HY000): You must SET PASSWORD before executing this statementmysql create database yan1;ERROR 1820 (HY000): You must SET PASSWORD before executing this statementmysql SET PASSWORD PASSWORD(123456);Query OK, 0 rows affected (0.03 sec)