您的位置:首页 > 数据库 > MySQL

mysql 远程权限 以及主键 索引等创建

2017-12-22 11:35 281 查看
只要这两句就可以

grant all privileges on *.* to 'root'@'%'  with grant option;  

flush privileges;

use mysql;

update db set host = '%' where user = 'root'; 

flush privileges;

grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;  不设置密码 这句可以不要identified by 'password'

flush privileges; 修改生效  必须要的一句话

添加远程用户admin密码为password 

grant all privileges on *.* to admin@localhost identified by 'password' with grant option 
grant all privileges on *.* to admin@"%" identified by 'password' with grant option

ALTER TABLE `tbl_trnvs_idcard`  ADD UNIQUE INDEX IndexName(`ic_number`); 建立唯一键

ALTER TABLE `tbl_trnvs_idcard` ADD INDEX index_name ( `ic_number` )  建立索引

ALTER TABLE `tbl_sys_log_on` ADD INDEX index_name ( `log_code` )  建立索引
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: