★ 数据导出命令
D:\Program Files\MySQL\MySQL Server 5.6.39\bin
导出: mysqldump -u root -p cela_sub > D:/database20171025.sql (出错时try: mysql_upgrade -u root -p --force)
示例:mysql -h localhost -u root -p phpcms< D:\mysql\phpcms.sql
远程导入:
source D:/mysql/phpcms.sql;
★
exit
net stop mysql
D:\Program Files\MySQL\MySQL Server 5.5\bin
mysqld.exe --skip-grant-tables
完成以后就可以不用密码进入MySQL了
mysql -u root -p
不输入直接enter
use mysql
非5.7版本: update user set Password=password('buzhidao') where User='root';
5.7版本: update user set authentication_string = password('buzhidao'), password_expired = 'N', password_last_changed = now() where user = 'root';
flush privileges;
在任务管理器里关闭所有MySQL的进程,使用下面的命令启动:
net start mysql