MYSQL几个常用命令使用

一. mysql 修改密码
1.mysql -u root -p root 输入原密码登录命令行
2.use mysql;
3.update user set password=password('root123') where 'user' = 'root'; 5.7版本 update user set authentication_string=password('root123') where 'user' = 'root';
4.flush privileges; 提交应用.
5.You must reset your password using ALTER USER statement before executing this statement必须修改临时密码,命令:alter user user() identified by '@Juaner521';
  
二. mysql 修改远程连接
1.mysql -u root -p root
2.use mysql;
3.select host,user,password from user;查看是否允许远程连接
4.grant all privileges on *.* to root@'%' identified by "password"; , 如果 报错,可换个方法
#创建一个新的账户
CREATE USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'xxxxxx';
#给这个账户所有权限

> GRANT ALL PRIVILEGES ON *.* TO'username'@'%';

1.flush privileges;
三. win 添加mysql服务:
1.进入mysql\bin文件夹:mtsqld --install;
2.如果提示:install/remove of the service denide,以管理员身份运行cmd。
四. 报错Ignoring the redo log due to missing... :
删除 mysql/data/目录下ib_logfile0``ib_logfile1重启就好。

源码附件已经打包好上传到百度云了,大家自行下载即可~

链接: https://pan.baidu.com/s/14G-bpVthImHD4eosZUNSFA?pwd=yu27
提取码: yu27

百度云链接不稳定,随时可能会失效,大家抓紧保存哈。

如果百度云链接失效了的话,请留言告诉我,我看到后会及时更新~

开源地址

码云地址:
http://github.crmeb.net/u/defu

Github 地址:
http://github.crmeb.net/u/defu

{{o.name}}
{{m.name}}

猜你喜欢

转载自my.oschina.net/u/5168284/blog/5533982
今日推荐