mysql 本机ip连接不上问题处理

bingo 2023年05月30日 25次浏览

mysql 本机ip连接不上问题处理

 1. create user root@'{ip}' identified by 'sf123456'; 其中%为你的IP地址
 2. grant all privileges on *.* to root@'{ip}' with grant option;
 3. flush privileges;刷新权限
 4. net stop mysql;
 5. net start mysql;

修改mysql 本机数据存储目录

1. 找到配置文件my.ini和mysql原本数据存放位置

   比如我的电脑数据存放的默认路径为:C:\ProgramData\MySQL\MySQL Server 8.0

2.关闭数据库服务
   net stop  mysql80

3. 修改路径
   datadir=G:/target_dir/Data
   secure-file-priv="G:/target_dir/UPLOADS"
  
4. 重新开启数据库服务
   net start mysql80