1.CREATEUSER 语法: CREATEUSER ' username'@'host 'IDENTIFIEDBY'password'; 例子:CREATEUSER'dog'@'localhost'IDENTIFIEDBY'123456'; CREATEUSER'pig'@'192.168.1.101_'IDENDIFIEDBY'123456'; CREATEUSER'pig'@'%'IDENTIFIEDBY'123456'; CREATEUSER'pig'@
1. CREATE USER
语法:
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
例子: CREATE USER 'dog'@'localhost' IDENTIFIED BY '123456';
CREATE USER 'pig'@'192.168.1.101_' IDENDIFIED BY '123456';
CREATE USER 'pig'@'%' IDENTIFIED BY '123456';
CREATE USER 'pig'@'%' IDENTIFIED BY '';
CREATE USER 'pig'@'%';
实例1:
mysql> create user jss;
这样创建的用户,可以从任意安装了mysql客户端,并能够访问目标服务器的机器上创建连接,无须密码.例如,从ip:10.0.0.99的客户端执行连接:
mysql -ujss -h 172.16.1.110
查看该用户:
mysql> select user,host,password from user where user='jss';
SELECT USER(); //显示当前用户
实例2:
mysql> create user jss_ps identified by 'jss';
用户连接时,必须指定密码,那就可以在创建用户时,通过指定identified by子句来设定密码
用密码登陆:
mysql -ujss_ps -p -h 172.16.1.110
如果希望指定的用户只能从某台指定的域(domain)或主机访问,可以在创建用户时指定host,例如,指定用户只能从10.0.0.99访问
mysql> create user jss_ip@10.0.0.99 identified by password '123456';
2. 使用GRANT语句
语法:mysql> grant 权限1,权限2,...权限n on 数据库名称.表名称 to 用户名@用户地址 identified by '连接口令';
权限1,权限2,...权限n代表
select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file等14个权限
实例:
mysql>grant select,insert,update,delete,create,drop on vtdc.employee to joe@10.163.225.87 identified by '123';
给来自10.163.225.87的用户joe分配可对数据库vtdc的employee表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
mysql>grant all privileges on vtdc.* to joe@10.163.225.87 identified by '123';
给来自10.163.225.87的用户joe分配可对数据库vtdc所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@10.163.225.87 identified by '123';
给来自10.163.225.87的用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
mysql>grant all privileges on *.* to joe@localhost identified by '123';
给本机用户joe分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
3. 直接向mysql.user表插入记录:
mysql> insert into user (host,user,password) values ('%','jss_insert',password('jss'));
mysql>flush privileges; //刷新系统权限表
4. 修改mysql用户密码方式:
a. 使用mysqladmin语法:mysqladmin -u用户名 -p旧密码 password 新密码
例如:mysqladmin -u root -p 123 password 456;
b. 直接修改user表的用户口令:
语法:update mysql.user set password=password('新密码') where User="phplamp" and Host="localhost";
实例:update user set password=password('54netseek') where user='root';
flush privileges;
c. 使用SET PASSWORD语句修改密码:语法:
SET PASSWORD FOR 'username'@'host' = PASSWORD('newpassword');
如果是当前登陆用户用SET PASSWORD = PASSWORD("newpassword");
实例:
set password for root@localhost=password('');
SET PASSWORD FOR name=PASSWORD('new password');
SET PASSWORD FOR 'pig'@'%' = PASSWORD("123456");
5. 删除用户和撤销权限:
a. 取消一个账户和其权限
Drop USER user;
drop user username@'%'
drop user username@localhost
b. 取消授权用户:
语法:REVOKE privilege ON databasename.tablename FROM 'username'@'host';
例子: REVOKE SELECT ON *.* FROM 'pig'@'%';
REVOKE SELECT ON test.user FROM 'pig'@'%';
revoke all on *.* from sss@localhost ;
revoke all on user.* from 'admin'@'%';
SHOW GRANTS FOR 'pig'@'%'; //查看授权
c. 删除用户:
语法: Delete from user where user = "user_name" and host = "host_name" ;
例子:delete from user where user='sss' and host='localhost';
二、数据库表
1.查看所有数据库: 数据库目录:/usr/local/mysql/data
mysql> SHOW DATABASES; //显示数据库
mysql> USE abccs //进入数据库
mysql> SHOW TABLES; //显示表
mysql> DESCRIBE mytable; //显示表结构
mysql> CREATE DATABASE abccs; //创建一个数据库
mysql> CREATE TABLE mytable (name VARCHAR(20), sex CHAR(1), birth DATE, birthaddr VARCHAR(20)); //创建表
mysql> insert into mytable values (‘abccs’,‘f’,‘1977-07-07’,‘china’); //插入表数据
使用文本方式插入数据:
{
mysql.txt内容:abccs f 1977-07-07 china
mary f 1978-12-12 usa
tom m 1970-09-02 usa
mysql> LOAD DATA LOCAL INFILE "mytable.txt" INTO TABLE pet; //导入TXT文件数据
}
2.删除数据库:
mysql> drop database drop_database; //删除一个已经确定存在的数据库
alter table 表名 ENGINE=存储引擎名; //修改表的存储引擎
alter table 表名 drop 属性名; //删除字段
alter table 旧表名 rename to 新表名; //修改表名
alter table 表名 modify 属性名 数据类型; //修改字段数据类型
alter table 表名 change 旧属性名 新属性名 新数据类型; //修改字段名
alter table 表名 drop FOREING KEY 外键别名; //删除子表外键约束
增加表字段:
{ alter table example add phone VACGAR(20); //增加无约束的字段
alter table example add age INT(4) NOT NULL; //增加万增约束的字段
alter table example add num INT(8) PRIMARY KEY FIRST; //表的第一个位置增加字段
alter table example add address VARCHAR(30) NOT NULL AFTER phone; //表的指定位置之后增加字段
alter table example modify name VARCHAR(20) FIRST; //把字段修改到第一位
alter table example modify num INT(8) ATER phone;//把字段修改到指定字段之后
}

IP地址冲突,这还算是比较常见的网络问题,最近被还在使用Win7系统的用户遇到了,当同一网络上的两台或多台设备分配了相同的IP地址时,就会发生IP地址冲突,这篇文章是本站给大家带来的解决IP地址冲突问题方法。方法一:1、按【Win+R】组合键,打开运行,并输入【cmd】命令,按【确定或回车】,可以快速打开命令提示符窗口(建议使用管理权限创建此任务);2、管理员命令提示符窗口中,输入【ipconfig/release】命令,可以用来释放当前的IP地址,而输入【ipconfig/renew】命令,可

10代cpu支持win7系统。10代cpu搭配的400、500系列主板可以安装win7,安装的前提条件是必须关闭“安全启动”和有独显的情况开启csm兼容模式;但有些主板己经没有支持传统模式以及兼容模式的选项了,此时还需要更换主板。

相信有用户遇到这么一个问题了,win7系统却找不到摄像头快捷在哪,只能从程序里面调出摄像头功能,不知道内情的人还以为是摄像头的驱动没有安装呢,因此给有需要的win7用户在使用摄像头的时候制造了不小的麻烦。下面,小编就来给大家带来了Win7摄像头的打开教程了。使用笔记本电脑的用户都晓得笔记本自带有摄像头功能,不像台式电脑需要连接摄像头,在笔记本win7系统中直接打开摄像头就可以使用,非常方便。不过有用户一般的情况下都没有去摸索,尝试很多方法还是失败,下面,小编就来跟大家说说Win7摄像头的打开方法

win7电脑喇叭显示红叉的解决办法:1、在电脑桌面上找到“计算机”图标,单击鼠标右键选择“管理”;2、在左侧系统工具中单击选择“设备管理器”选项;3、在中间设备管理器选项中,单击展开“声音、视频和游戏控制器”选项;4、选中“Realtek High Definition Audio”,单击鼠标右键选择“启用”即可。

win7电脑没有NVIDIA控制面板的解决办法:1、打开电脑;2、打开“控制面板”,然后找到“NVIDIA控制面板”;3、打开“NVIDIA控制面板”设置中的“添加桌面上下文菜单”这个选项即可。

win7检测不到第二个显示器的解决办法:1、打开“控制面板”并选择“硬件和声音”;2、点击“设备打印机”中的“设备管理器”;3、通过“监视器”来查看是否有第二部显示器连接;4、回到桌面,右击鼠标,选择“屏幕分辨率”;5、选择合适自己显示器的刷新频率,再点击“应用”;6、重新对第二个显示器进行检测或显示即可。

win7可以通过使用系统配置实用程序、注册表编辑器和任务管理器来关闭开机自启动软件。详细介绍:1、系统配置实用程序,点击“开始”菜单,输入“msconfig”并按回车键,打开“系统配置”窗口,在“系统配置”窗口中,切换到“启动”标签,取消选中想要关闭的软件前面的复选框,然后点击“应用”和“确定”按钮保存更改即可。2、注册表编辑器等等。

罗技驱动在最新的系统Win11中兼容良好。对于一些用户好奇的老旧系统Win7,也可以放心使用,因为罗技驱动同样兼容Win7系统。罗技驱动win7能用吗:答:罗技驱动win7能用。罗技驱动无论什么系统都可以兼容,罗技是国际知名品牌,它的驱动非常全面。罗技驱动的主要界面:1、软件主界面在左边,三个按钮依次是灯光,按键,灵敏度设置。在灯光界面的设置中,特效比较常规,而音频视觉效果是亮点。它可以根据声音频率变色,根据高、中、低音频段进行不同的颜色和效果设置。3、按键设置中,用户可以根据自己有什么特殊要求


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.