# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql>UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’
mysql>FLUSH PRIVILEGES
mysql>quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
方法二:
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql -udebian-sys-maint -p
Enter password: <输入[client]节的密码>
mysql>UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’
mysql>FLUSH PRIVILEGES
mysql>quit
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
转自 淮安互联
另一个方法
Windows:
1. 管理员登陆系统,停止mysql服务或者结束mysqld-nt进程
2. 进入命令行,来到mysql的安装目录.假设安装目录为 d:\mysql\ , CMD进入命令行
3. 运行 d:\mysql\bin\mysqld-nt --skip-grant-tables 启动mysql,关闭权限的检查
4. 运行 d:\mysql\bin\mysqladmin -u root flush-privileges password "newpassword" 重设root密码
5. 重新启动mysql服务
第4步也可以直接修改mysql表,所用到的SQL语句同linux部分,这里就不再重复了.
转自 淮社网
在windows下安装Mysql系统日志出现 max_open_files: 2048 max_connections: 510 table_cache: 764 类似错误是因为 max_connections 最大连接数和max_open_files、table_cache 不匹配。适当的降低max_connections 或调整其他两个数值解决办法在 mysql bin >中输入 mysql-nt --table_cache=764
mysql-nt --innodb_open_files=2048 即可!!
table_cache和max_connections 在my.ini 里可调
Changed limits: max_open_files: 2048 max_connections: 1024 table_cache: 507
max_connections=1024
table_cache=500
OK,问题解决
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)