mysql使用简介

yjg0827 2012-11-07 09:07:54

mysql如何查看my.cnf的位置

命令行输入:
./mysqld --verbose --help | grep -A 1 'Default options'

Default options are read from the following files in the given order:
/etc/my.cnf

修改Mysql访问权限

use mysql

select Host,User,password from user;

grant all on *.* to root@'%' identified by '密码';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

root表示用户名,主机名是%表示全部

flush privileges; //更新

mysql客户端连接数据库

mysql -h127.0.0.1 -u用户名 -p密码 -P端口

显示是否支持中文

show variables like '%char%';

...全文
180 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yh0123123 2012-11-09
  • 打赏
  • 举报
回复
谢谢楼主,拿走了
Jordan37 2012-11-09
  • 打赏
  • 举报
回复
lz英明,分享好东西

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧