首页 技术 正文
技术 2022年11月18日
0 收藏 731 点赞 3,707 浏览 912 个字

Linux 对mysql远程连接的授权操作

首先linux连接mysql数据库

授权:
grant all on *.* to 'root'@'%' identified by '' with grant option;
//允许账户root从任何主机连接到所有数据库(*.*)
grant all on test.* to 'user'@'%' identified by '' with grant option;
//允许账户user从任何主机连接到test数据库(test.*)释放远程授权:
revoke all on *.* from 'user'@'%';
//禁止用户user从任何主机访问所有数据库
revoke all on test.* from 'user'@'%';
//禁止用户user从任何主机访问test数据库flush privileges; //刷新系统授权表连接不上关闭防火墙

关闭防火墙命令:systemctl stop firewalld.service

开启防火墙:systemctl start firewalld.service

关闭开机自启动:systemctl disable firewalld.service

开启开机启动:systemctl enable firewalld.service

linux连接mysql数据库对数据库的操作的一些基本命令

/usr/local/mysql/bin/mysql -uroot -p             //连接mysql数据库mysql其他命令:show databases; //显示数据库create database name; //创建数据库 use databasename; //选择数据库drop database name //直接删除数据库,不提醒show tables; //显示表 describe tablename; //显示具体的表结构select 中加上distinct去除重复字段mysqladmin drop databasename //删除数据库前,有提示。//显示当前mysql版本和当前日期select version(),current_date;   

原创参考连接:https://www.cnblogs.com/cnteam/p/4091468.html

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,103
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,579
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,427
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,199
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,834
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,917