拓展博文:
https://www.cnblogs.com/wanggang2016/p/10425780.html windows下Mysql安装启动及常用操作
https://blog.csdn.net/weixin_30834783/article/details/99818876 mysql doc命令 windows
★ 数据导出命令
D:Program FilesMySQLMySQL Server 5.6.39in
导出: mysqldump -u root -p cela_sub > D:/database20171025.sql (出错时try: mysql_upgrade -u root -p --force)
示例:mysql -h localhost -u root -p phpcms< D:mysqlphpcms.sql
远程导入:
source D:/mysql/phpcms.sql;
★
exit
net stop mysql
D:Program FilesMySQLMySQL Server 5.5in
mysqld.exe --skip-grant-tables
完成以后就可以不用密码进入MySQL了
mysql -u root -p
不输入直接enter
use mysql
show databases;
use xhkdb;
非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