MySQL重置密码,环境变量

MySQL重置密码,环境变量

重置密码

Access denied for user 'root'@'localhost' (using password: YES)

1.停止mysql服务。
service mysqld stop
2. 运行下面命令,后保留窗口。
mysqld_safe --user=mysql --skip-grant-tables --skip-networking
3.新开窗口会话,顺序执行下面命令。

mysql
update mysql.user set password=PASSWORD('password') where user='root';
flush privileges;
update mysql.user set host='%' where user='root' and host='localhost';
quit;
service mysqld restart

环境变量

/etc/profile中添加:
export PATH=$PATH:/usr/local/mysql/bin
使配置生效
source /etc/profile


 上一篇
Ajax加载数据加载中遮罩 Ajax加载数据加载中遮罩
Ajax加载数据加载中遮罩js方法,beforeSend内进行调用遮罩显示 $.ajax({ url: '${request.contextPath}/statistical/getData', type: 'post',
2020-08-09
下一篇 
MySQL建表执行初始化脚本 MySQL建表执行初始化脚本
MySQL建表执行初始化脚本create database `portal` default character set utf8mb4 collate utf8mb4_general_ci; \. /usr/local/mysql/por
2020-08-09
  目录