MySQL常用 *** 作

MySQL常用 *** 作,第1张

概述介绍《MySQL常用 *** 作》开发教程,希望对您有用。

《MysqL常用 *** 作》要点:
本文介绍了MysqL常用 *** 作,希望对您有用。如果有疑问,可以联系我们。

创建MysqL用户和数据表

create database testcom;

grant all on testcom.* to 'cxf'@'localhost' IDentifIEd by 'cxf';

MysqL的密码重置

设置root密码为123456

MysqL -uroot password '123456'

vim /etc/my.cnf

在最后面加一条

skip-grant

不去授权

登录MysqL重置密码,重置后要把skip-grant去掉

use MysqL;

update user set password=password('123456') where user='root';

刷新磁盘:flush privileges(也可以重启)

MysqL登录

MysqL -uroot -h127.0.0.1 -P3306 -p123456

授权192.168.31.101远程登录数据库

grant all on *.* to 'root'@'192.168.31.101' IDentifIEd by '123456' with grant option (授权为超级用户)

MysqL -uroot -h192.168.31.101 -P3306 -p123456

MysqL -uroot -S /tmp/MysqL.sokt

MysqL的备份与恢复

库备份命令

MysqLdump -uroot -p123456 discuz > /www/MysqL_bak/discuz.sql

库恢复命令

MysqL -uroot -p123456 discuz < /www/MysqL_bak/discuz.sql

表备份命令

MysqLdump -uroot -p123456 discuz pre_forum_post > /www/MysqL_bak/pre_forum_post.sql

表恢复命令

MysqL -uroot -p123456 discuz < /www/MysqL_bak/pre_forum_post.sql

指定字符集备份恢复

MysqLdump -uroot --default-character-set=utf8 -p123456 discuz > /www/MysqL_bak/discuz.sql

MysqL -uroot --default-character-set=utf8 -p123456 discuz < /www/MysqL_bak/pre_forum_post.sql

欢迎参与《MysqL常用 *** 作》讨论,分享您的想法,内存溢出PHP学院为您提供专业教程。

总结

以上是内存溢出为你收集整理的MySQL常用 *** 作全部内容,希望文章能够帮你解决MySQL常用 *** 作所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1157777.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存